Skip to content

Draft: POC for tracing a pipeline

Reuben Pereira requested to merge rp/trace-pipeline into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Tracing a pipeline gives us data about the amount of time that each part of the pipeline takes.

Note that this can be used to trace any pipeline, not just the deployment pipelines.

Test this on a local machine

  1. Switch your release-tools repo to the following branch: rp/trace-pipeline.

  2. Start a collector on your local system. Command taken from https://opentelemetry.io/docs/instrumentation/ruby/getting-started/#exporting-traces.

    export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
    
    git clone git@github.com:open-telemetry/opentelemetry-ruby.git; \
        cd opentelemetry-ruby/examples/otel-collector; \
           docker-compose up -d
  3. Run the rake task with:

    RELEASE_BOT_DEV_TOKEN='' RELEASE_BOT_OPS_TOKEN='' OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 be rake 'release:trace[https://ops.gitlab.net/gitlab-org/release/tools/-/pipelines/1147161]'
  4. Once the rake task completes, open http://localhost:16686/ to view the Jaeger UI.

    When searching for traces, make sure to:

    1. For the Service field, select Release-Tools from the dropdown.
    2. Set the Lookback field based on when your pipeline was executed. If the pipeline you are tracing was executed 1 week back, set the Lookback to a custom time range that includes the date when the pipeline was executed.

Example of a traced pipeline viewed using the Jaeger UI:

image

gitlab-com/gl-infra/delivery#2345 (closed)

Author Check-list

  • Has documentation been updated?
Edited by Reuben Pereira

Merge request reports