ODOCK.AI
ObservabilityLGTM Stack

OTEL configuration

Environment variables and Kubernetes wiring for OpenTelemetry on odock-server.

OTEL configuration

This page is primarily for platform owners and operators. Organisation users who only investigate requests usually do not need to change OTEL settings, but understanding the variables helps explain why signals are labeled and sampled the way they are.

odock-server configures OpenTelemetry from OBSERVABILITY_* environment variables. The same set controls exporter selection, endpoint wiring, resource attributes, and trace sampling.

Environment Variables

VariableDefault in composeMeaning
OBSERVABILITY_OTEL_EXPORTERotlphttpDefault exporter for any signal without an explicit override
OBSERVABILITY_OTEL_TRACES_EXPORTERotlphttpTrace exporter. Set none to disable trace export
OBSERVABILITY_OTEL_METRICS_EXPORTERnoneMetrics exporter. /metrics scraping is the default path
OBSERVABILITY_OTEL_ENDPOINThttp://otel-collector:4318OTLP HTTP endpoint of the Collector
OBSERVABILITY_SERVICE_NAMEodock-serverStable service identifier across replicas
OBSERVABILITY_SERVICE_NAMESPACEodockLogical service namespace
OBSERVABILITY_SERVICE_VERSIONdevBuild version
OBSERVABILITY_SERVICE_INSTANCE_ID${HOSTNAME}Unique instance id
OBSERVABILITY_DEPLOYMENT_ENVIRONMENTproductionEnvironment label attached to all signals
OBSERVABILITY_K8S_CLUSTER_NAMEunsetKubernetes cluster label
OBSERVABILITY_K8S_NAMESPACE_NAMEunsetKubernetes namespace label
OBSERVABILITY_K8S_DEPLOYMENT_NAMEunsetKubernetes deployment label
OBSERVABILITY_K8S_POD_NAMEunsetPod label
OBSERVABILITY_K8S_NODE_NAMEunsetWorker node label
OBSERVABILITY_SAMPLE_RATE0.1Head sampling rate for traces

If OBSERVABILITY_SERVICE_INSTANCE_ID is unset, the gateway falls back to POD_NAME, then HOSTNAME.

How They Map To Resource Attributes

Env varResource attribute
OBSERVABILITY_SERVICE_NAMEservice.name
OBSERVABILITY_SERVICE_NAMESPACEservice.namespace
OBSERVABILITY_SERVICE_VERSIONservice.version
OBSERVABILITY_SERVICE_INSTANCE_IDservice.instance.id
OBSERVABILITY_DEPLOYMENT_ENVIRONMENTdeployment.environment.name
OBSERVABILITY_K8S_*k8s.cluster.name, k8s.namespace.name, k8s.deployment.name, k8s.pod.name, k8s.node.name

Kubernetes Wiring

For multi-replica deployments:

  • keep service.name the same across replicas
  • set service.instance.id to the pod name
  • attach Kubernetes metadata so traces, metrics, and logs can be split by namespace, deployment, pod, or node

Recommended Deployment env block:

env:
  - name: OBSERVABILITY_SERVICE_INSTANCE_ID
    valueFrom:
      fieldRef:
        fieldPath: metadata.name
  - name: OBSERVABILITY_K8S_POD_NAME
    valueFrom:
      fieldRef:
        fieldPath: metadata.name
  - name: OBSERVABILITY_K8S_NAMESPACE_NAME
    valueFrom:
      fieldRef:
        fieldPath: metadata.namespace
  - name: OBSERVABILITY_K8S_NODE_NAME
    valueFrom:
      fieldRef:
        fieldPath: spec.nodeName
  - name: OBSERVABILITY_K8S_DEPLOYMENT_NAME
    value: odock-gateway
  - name: OBSERVABILITY_K8S_CLUSTER_NAME
    value: prod-eu-1

If you run Grafana Alloy or the OpenTelemetry Collector in-cluster, enrich telemetry with the k8sattributes processor as well.

OTLP Endpoint Choices

EndpointWhen to use
http://otel-collector:4318Default compose setup with OTLP HTTP
http://otel-collector:4317gRPC alternative if your SDK configuration matches
External managed CollectorHosted or centralised OTEL destination

Disabling Telemetry

To disable exported telemetry:

OBSERVABILITY_OTEL_TRACES_EXPORTER=none
OBSERVABILITY_OTEL_METRICS_EXPORTER=none

/metrics remains available from the runtime even if nothing scrapes it.

Tips

Temporarily set OBSERVABILITY_SAMPLE_RATE=1.0 during incident response if you need deterministic trace capture.

Do not enable both /metrics scraping and OTLP metrics export for odock-server at the same time unless you intentionally want duplicate series and have separated the queries.

On this page