Set up Service Ping for GitLab Orbit
- Tier: Premium, Ultimate
- Offering: GitLab Self-Managed
GitLab Orbit reports its usage through Service Ping. On GitLab Self-Managed, two components next to GitLab Orbit do this:
- The Data Insights Platform (DIP) receives the usage events from GitLab Orbit and stores them in ClickHouse.
- The Service Ping exporter counts them once a week and sends the counts to
version.gitlab.com.
Raw events are never sent to GitLab. They stay in the ClickHouse database that DIP writes to. The exporter follows the Service Ping settings of your GitLab instance, so nothing is sent while Service Ping is turned off. The Service Ping settings control only what the exporter sends. GitLab Orbit still sends its usage events to DIP, and ClickHouse stores them, until you stop local collection.
Prerequisites:
- GitLab Orbit 1.3.0 or later, with Helm chart 7.1.0 or later.
- GitLab 19.6 or later. The exporter reads the Service Ping settings through an API that earlier versions do not have. On GitLab 19.6, also turn on Enable Registration Features under Admin > Settings > Metrics and profiling > Usage statistics. Without it, the exporter sends no GitLab Orbit metrics. GitLab 19.7 and later do not need it.
- The NATS server and the ClickHouse server that GitLab Orbit uses.
- A ClickHouse account that can create databases and users, for the DIP migrations.
- Outbound HTTPS from the exporter pod to
version.gitlab.com. - Outbound access from the DIP pod to
iglucentral.comandgitlab-org.gitlab.io, to resolve event schemas. The DIP chart reachesgitlab-org.gitlab.ioover HTTPS and, by default,iglucentral.comover HTTP on port 80. To use HTTPS for both, set the Iglu Central entry insingle.pipeline.iglu.repositoriestohttps://iglucentral.com, or point it at an internal Iglu mirror. The override replaces the whole list, so list theIglu GitLabentry (https://gitlab-org.gitlab.io/iglu, vendor prefixcom.gitlab) again.
Set up Service Ping for GitLab Orbit in this order:
- Create the Secrets.
- Install the Data Insights Platform.
- Install the Service Ping exporter.
- Point GitLab Orbit at the Data Insights Platform.
- Verify the setup.
Create the Secrets
DIP and the exporter can run in any namespace.
This page uses dip as the namespace and every command below assumes it.
To use another namespace, replace dip in the commands and in the collector URL in Point GitLab Orbit at the Data Insights Platform.
Both components read three Secrets from that namespace:
gitlab-service-ping-key: the Service Ping key of your GitLab instance. The exporter uses it to read the Service Ping settings of your instance.dip-clickhouse-dsn: the ClickHouse connection for DIP, as a user that can create databases and users. The DIP migrations run with it. The DIP pod also connects with it, so keep this Secret in place. To keep the pod on a user that cannot create databases and users, give the migrations their own user withmigrate.adminUserandmigrate.adminSecret, as described in the DIP chart README. Either way, limit who can read Secrets in thedipnamespace, for example with Kubernetes RBAC.dip-serviceping-exporter: a new password for the exporter’s ClickHouse user. The DIP migrations create the user with it, and the exporter connects with it.
To create the Secrets:
Create the namespace:
kubectl create namespace dipCopy the Service Ping key from GitLab:
sudo cat /var/opt/gitlab/gitlab-rails/etc/gitlab_service_ping_secretThe GitLab chart keeps the key in the Secret
<release>-gitlab-service-ping-secretin the GitLab namespace, under the entrysecretby default:kubectl -n <gitlab_namespace> get secret <release>-gitlab-service-ping-secret -o jsonpath='{.data.secret}' | base64 -dCreate the Secrets:
kubectl -n dip create secret generic dip-clickhouse-dsn \ --from-literal=CLICKHOUSE_DSN='clickhouse://<dip_user>:<dip_password>@<clickhouse_host>:9000' kubectl -n dip create secret generic dip-serviceping-exporter \ --from-literal=password='<exporter_password>' kubectl -n dip create secret generic gitlab-service-ping-key \ --from-literal=secret='<service_ping_key>'Replace the following values:
<clickhouse_host>: The host name of your ClickHouse server.<dip_user>and<dip_password>: The ClickHouse user that DIP runs as, and its password. The DIP migrations create the databases, so this user needs the grants listed in the DIP chart README.<exporter_password>: A new password. The DIP migrations create theserviceping_exporteruser with it.<service_ping_key>: The Service Ping key of your GitLab instance.
Install the Data Insights Platform
The DIP chart ships a values file for an install next to GitLab Orbit.
To install DIP:
Download the chart to get the values file:
helm pull data-insights-platform --version 2.10.1 --untar \ --repo https://gitlab.com/api/v4/projects/70800837/packages/helm/stableInstall the chart with that values file and your NATS address:
helm upgrade --install dip data-insights-platform \ --repo https://gitlab.com/api/v4/projects/70800837/packages/helm/stable \ --version 2.10.1 \ --namespace dip \ --values data-insights-platform/values-orbit.yaml \ --set single.pipeline.nats.addr=nats://nats.nats.svc.cluster.local:4222The install runs the ClickHouse migrations first. They create the
snowplowandservicepingdatabases, theserviceping_exporteruser, and theserviceping.eventstable the exporter reads, with the view that fills it.Confirm that the
platform-single-0pod isRunning:kubectl -n dip get pods -l app=platform-single
Adjust the values for your environment.
Put your changes in your own dip-values.yaml and add --values dip-values.yaml after values-orbit.yaml, so that a new download of the chart does not overwrite them:
- If NATS requires TLS client certificates, mount them with
natsClientCertsSecretNameand setsingle.pipeline.nats.caCertPath,clientCertPath, andclientKeyPath. DIP mounts the Secret at/etc/ssl/certs/custom, so the paths are, for example,/etc/ssl/certs/custom/ca.crt,tls.crt, andtls.key. - A NATS server that requires a username and password is not supported. See issue 225.
- For ClickHouse over TLS, such as ClickHouse Cloud, use the secure native port, 9440 by default, and add
?secure=trueto the DSN in thedip-clickhouse-dsnSecret, for exampleclickhouse://<dip_user>:<dip_password>@<clickhouse_host>:9440?secure=true. - On a replicated ClickHouse cluster, set
single.pipeline.clickhouse.selfManaged: true. The DIP migrations then create the databases, tables, and usersON CLUSTER '{cluster}'with replicated table engines. Every ClickHouse server needs ClickHouse Keeper and the{cluster},{shard}, and{replica}macros. Set it before the first install. If DIP already created its tables on a single node, the migrations stop and name the tables to drop first.
For every value, see the DIP chart README.
Install the Service Ping exporter
The exporter is a weekly CronJob.
It starts in dry-run mode, which builds each payload and logs it without sending anything.
To install the exporter:
Save the following as
exporter-values.yaml:gitlab: url: <gitlab_url> keySecret: name: gitlab-service-ping-key clickhouse: host: <clickhouse_host> passwordSecret: secretName: dip-serviceping-exporter component: version: "<orbit_version>" command: dry-runReplace the following values:
<gitlab_url>: A GitLab address that goes through Workhorse: the public URL of your GitLab instance, or, when the exporter runs in the GitLab cluster, thewebserviceService’s Workhorse port, for examplehttp://<release>-webservice-default.<gitlab_namespace>.svc:8181. The exporter chart has no setting for a custom CA, host aliases, or a proxy. The exporter pod must resolve this address and trust its certificate with its default settings. With thehttp://address inside the cluster, every run logs a warning that the token is sent unencrypted. This is expected.<clickhouse_host>: The host name of your ClickHouse server.<orbit_version>: The GitLab Orbit version you run, 1.3.0 or later. Use the same value you set asimage.tagin Point GitLab Orbit at the Data Insights Platform. To see the version that runs today:kubectl -n gitlab-orbit get deployment orbit-webserver -o jsonpath='{.spec.template.spec.containers[0].image}'The output ends with the image tag. Use only the tag. If the running version is earlier than 1.3.0, use the version you plan to upgrade to.
Install the chart:
helm upgrade --install serviceping-exporter \ oci://registry.gitlab.com/gitlab-org/analytics-section/analytics-instrumentation/serviceping-exporter/charts/serviceping-exporter \ --version 0.1.0 --namespace dip --values exporter-values.yaml
Keep command: dry-run until Verify the setup shows a payload for a closed week with your events.
Then set command: run and upgrade the release.
From then on the CronJob posts every Monday at 03:00 UTC.
For ClickHouse over TLS, store a full DSN for the serviceping_exporter user under the key CLICKHOUSE_DSN in a Secret, for example clickhouse://serviceping_exporter:<exporter_password>@<clickhouse_host>:9440?secure=true. Then set clickhouse.existingSecret to its name instead of clickhouse.host and clickhouse.passwordSecret.
The exporter cannot trust a private CA for ClickHouse either, so the ClickHouse certificate must be signed by a public CA.
For every value, see the exporter chart.
Point GitLab Orbit at the Data Insights Platform
GitLab Orbit sends its usage events to DIP when analytics.local_collector.enabled is true.
To point GitLab Orbit at DIP:
Add the values to
orbit-values.yaml:image: tag: "<orbit_version>" analytics: local_collector: enabled: true url: http://platform-single.dip.svc:8082Replace
<orbit_version>with GitLab Orbit 1.3.0 or later. The chart fails to render with an older version.Run the
helm upgradecommand from Install GitLab Orbit.
The webserver, indexer, and dispatcher pods restart, and GitLab Orbit sends every usage event to DIP from then on.
To stop local collection, set enabled: false and upgrade again.
The URL can stay.
GitLab Orbit sends events to DIP over HTTP inside the cluster. To limit which pods can reach DIP, add a NetworkPolicy that allows only the GitLab Orbit namespace on port 8082.
Verify the setup
To verify the setup:
Run a query in GitLab Orbit, for example the one from Verify the installation.
Count the events DIP stored, with your ClickHouse client:
SELECT count() FROM serviceping.events WHERE app_id = 'gkg-server'The count is greater than zero about a minute after the query.
Run the exporter once and read its log:
kubectl -n dip create job --from=cronjob/serviceping-exporter serviceping-exporter-check kubectl -n dip logs -f job/serviceping-exporter-checkIn
dry-runmode the log shows the JSON payload for each closed weekly window, followed bydry run complete. A window closes on Monday at 00:00 UTC, so the first payload appears after the first Monday that follows your first event. Until then, the log showsnothing to send. If Include optional data in Service Ping is off in GitLab, the log showsnothing to send, the Service Ping settings allow no metrics, because every GitLab Orbit metric is optional. On GitLab 19.6, the log shows the same line while Enable Registration Features is off. If Service Ping itself is off,dry-runstill prints the payloads, except on GitLab 19.6.runsends nothing and keeps each new window asheld. The exporter never sends a held window, even after you turn Service Ping back on, so make sure Service Ping is on before you setcommand: run. To change the Service Ping settings, see Usage statistics.
Upgrade
Upgrade the DIP and exporter releases with the helm upgrade commands above, with the new chart versions in --version, and GitLab Orbit as in Upgrade GitLab Orbit.
Download the new DIP chart again to get its values-orbit.yaml.
When you upgrade GitLab Orbit, set the new version as image.tag in orbit-values.yaml, because a pinned tag is not changed by a chart upgrade.
Then set component.version in exporter-values.yaml to the same version and upgrade the exporter release.
The DIP migrations run again on every upgrade.
Remove Service Ping for GitLab Orbit
To remove Service Ping for GitLab Orbit:
Set
analytics.local_collector.enabledtofalseinorbit-values.yamland upgrade GitLab Orbit.Uninstall the exporter and DIP:
helm uninstall serviceping-exporter --namespace dip helm uninstall dip --namespace dipDelete the namespace, which removes the Secrets and the migration Job and ConfigMap that Helm leaves behind:
kubectl delete namespace dip
The snowplow and serviceping databases, the serviceping_exporter user, and the serviceping_reader role stay in ClickHouse.
If you no longer need them, drop them with your ClickHouse client.
The RAW_EVENTS_* and ENRICHED_EVENTS_* streams that DIP created also stay on the NATS server. If you no longer need them, delete them with the NATS CLI.
Troubleshooting
The exporter log shows 403 Forbidden from GitLab
GitLab answers the Service Ping settings request only through Workhorse.
Set gitlab.url in exporter-values.yaml to an address that goes through Workhorse, not to the Rails port.
The exporter request to GitLab times out
If the GitLab chart’s webservice NetworkPolicy is on, allow the exporter’s namespace on port 8181.
serviceping.events stays empty
Check that
analytics.local_collector.enabledistrueand that the URL matches the DIP Service:kubectl -n dip get service platform-singleCheck the DIP pod log for errors:
kubectl -n dip logs platform-single-0Count the events DIP rejected, with your ClickHouse client:
SELECT count() FROM snowplow.bad_eventsIf the count is greater than zero, check that the DIP pod can reach the schema registries listed in the prerequisites.