GitLab instrumentation for OpenTelemetry
Enable OpenTelemetry tracing, metrics, and logs in GDK development
Currently the default GDK environment is not set up by default to properly
collect and display OpenTelemetry data. Therefore, you should point the
OTEL_EXPORTER_*_ENDPOINT
ENV vars to a GitLab project:
- Which has an Ultimate license, and where you have
- In which you have at least the Maintainer role
- In which you have access to enable top-level group feature flags (or is under the
gitlab-org
orgitlab-com
top-level groups which already have the flags enabled)
Once you have a project identified to use:
Note the ID of the project (from the three dots at upper right of main project page).
Note the ID of the top-level group which contains the project.
When setting the environment variables for the following steps, add them to
env.runit
in the root of thegitlab-development-kit
folder.Follow instructions to configure distributed tracing for a project, with the following custom settings:
For the
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
environment variable, use the following value:export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://<gitlab-host>/v3/<gitlab-top-level-group-id>/<gitlab-project-id>/ingest/traces"
Follow instructions to configure distributed metrics for a project, with the following custom settings:
For the
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
environment variable, use the following value:export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="https://<gitlab-host>/v3/<gitlab-top-level-group-id>/<gitlab-project-id>/ingest/metrics"
Follow instructions to configure distributed logs for a project, with the following custom settings:
For the
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT
environment variable, use the following value:export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="https://<gitlab-host>/v3/<gitlab-top-level-group-id>/<gitlab-project-id>/ingest/logs"
Also add the following to the
env.runit
file:# GitLab-specific flag to enable the Rails initializer to set up OpenTelemetry exporters export GITLAB_ENABLE_OTEL_EXPORTERS=true
gdk restart
.Navigate to your project, and follow the instructions in the above docs to enable and view the tracing, metrics, or logs.
References
Related design documents
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support