Skip to content

Improve visibility of time spent with external IO

Related issues

Closes gitlab-com/gl-infra/scalability#302 (closed). Depends on https://gitlab.com/gitlab-org/labkit-ruby/-/merge_requests/50, and must wait until bumping labkit verison

What does this MR do?

After Labkit publishes External HTTP notification events powered by ActiveSupport::Notification, those events are captured, stored, and accumulated. Those information are used:

  • Add external-http to the performance bar.
  • Add external_http_count and external_http_duration fields into Puma logs and Sidekiq logs
  • Expose some metrics to Prometheus:
    • gitlab_external_http_total: total numbers of external requests. This metric has two labels: code, which is the return HTTP code, and method. Request URI and its parts are removed to reduce metric cardinality.
    • gitlab_external_http_duration_seconds: histogram of external request duration. No labels are provided.
    • gitlab_external_exception_total: a counter to expose the number of exception when making such requests.

Screenshots (strongly suggested)

Performance bar overview. The warning sign is added when there are too many requests or the total duration exceeds the threshold or any of request duration exceeds the individual threshold.

Screenshot_from_2020-12-29_15-30-33

Performance bar details. For each external request:

  • Display duration
  • Display request destination
  • Display status code or exception
  • Display proxy if available

Screenshot_from_2020-12-31_14-58-33 Screenshot_from_2020-12-31_14-58-56

External HTTP Sidekiq logs

Screenshot_from_2020-12-30_16-14-10

External HTTP Puma logs

Screenshot_from_2020-12-30_16-16-29

A portion of exposed prometheus metrics. This screenshot is captured from the /-/metrics endpoint.

Screenshot_from_2020-12-30_16-19-09

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Andrew Kelly

Merge request reports

Loading