Skip to main content

OpenTelemetry Gateway

The gateway is an OpenTelemetry Collector that runs in your cluster between the platform and your observability tool. It receives OTLP from the platform, adds the tool's credential, converts what the tool needs, and sends the data out. The credential stays in the gateway; the platform needs none.

The ELK and Dynatrace pages use this gateway. Grafana Cloud uses Grafana Alloy, which plays the same role.

Step 1. Store the tool's token​

Store the token in the secret store that the External Secrets Operator reads (the same store the platform installation uses, or a store for monitoring only — see Secure the telemetry path). With AWS Secrets Manager:

read -rs -p 'Token: ' T; echo
printf '%s' "$T" | aws secretsmanager create-secret --region <region> --name <prefix>/observability-token \
--secret-string file:///dev/stdin --query Name --output text; unset T

Step 2. Sync the token into the cluster​

Use the store of your installation: its name and kind are in global.secrets.secretStore of your platform values. A namespaced SecretStore in the platform namespace cannot serve the monitoring namespace; then create a SecretStore in idv-monitoring for it.

kubectl create namespace idv-monitoring --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f - <<'EOF'
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: otel-gateway-auth
namespace: idv-monitoring
spec:
refreshInterval: 1h
secretStoreRef: {kind: ClusterSecretStore, name: <store-name>}
target: {name: otel-gateway-auth}
data:
- secretKey: token
remoteRef: {key: <prefix>/observability-token}
EOF
kubectl -n idv-monitoring get externalsecret otel-gateway-auth

Done when STATUS is SecretSynced. If not, kubectl -n idv-monitoring describe externalsecret otel-gateway-auth shows why (usually the entry name, the region or the store).

Step 3. Install the gateway​

Write otel-gateway-values.yaml: the common part below, plus the exporters and pipelines of your tool's page.

fullnameOverride: otel-gateway
mode: deployment
replicaCount: 2
image:
# The contrib image the platform's own collectors use; pin it by digest too.
repository: otel/opentelemetry-collector-contrib # or your registry mirror
tag: "<version>"
digest: "<sha256:...>"
command:
name: otelcol-contrib
extraEnvs:
- name: OTLP_TOKEN
valueFrom: {secretKeyRef: {name: otel-gateway-auth, key: token}}
resources:
requests: {cpu: 200m, memory: 256Mi}
limits: {cpu: "1", memory: 1Gi}
config:
receivers:
otlp:
protocols:
grpc: {endpoint: "${env:MY_POD_IP}:4317"}
http: {endpoint: "${env:MY_POD_IP}:4318"}
processors:
memory_limiter: {check_interval: 5s, limit_percentage: 80, spike_limit_percentage: 25}
batch: {}

The platform's own collectors use the same image; the version and digest that your chart pins are in its values (global.observability.collector.image). If every image must come from your own registry, mirror this one like the platform images.

Every tool page runs [memory_limiter, batch] in each pipeline. To drop, rename or sample data before it leaves the cluster, add the Collector's attributes, transform, filter or sampling processors to the pipelines.

Install it with the OpenTelemetry Collector Helm chart, pinned to a version:

helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo update
helm search repo open-telemetry/opentelemetry-collector # pin the version shown
helm install otel-gateway open-telemetry/opentelemetry-collector --version <pinned-version> \
-n idv-monitoring -f otel-gateway-values.yaml --wait
kubectl -n idv-monitoring get pods,svc -l app.kubernetes.io/instance=otel-gateway

Done when the pods are Running and the Service otel-gateway has ports 4317 and 4318. The platform endpoints are then:

SettingValue
otlpEndpointhttp://otel-gateway.idv-monitoring:4318
otlpGrpcEndpointhttp://otel-gateway.idv-monitoring:4317

Add the NetworkPolicy of Secure the telemetry path, so only the platform namespace can send to the gateway.

Remove the gateway​

helm uninstall otel-gateway -n idv-monitoring
kubectl -n idv-monitoring delete externalsecret otel-gateway-auth

Then revoke the token in the tool and delete its secret-store entry.