GitLab instrumentation for OpenTelemetry
Enable OpenTelemetry tracing, metrics, and logs in GDK development
NOTE:
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 root-group feature flags (or is under the
gitlab-org
orgitlab-com
root 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 root 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.