Skip to content

Commit deef619

Browse files
skipper: configure OpenTelemetry tracing
Add configuration to enable OpenTelemetry tracing instead of OpenTracing. See zalando/skipper#3559 Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
1 parent fc42749 commit deef619

2 files changed

Lines changed: 37 additions & 2 deletions

File tree

cluster/config-defaults.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ skipper_ingress_lightstep_propagators: "lightstep"
308308
skipper_ingress_lightstep_log_events: ""
309309
lightstep_token: ""
310310
tracing_collector_host: "tracing.platform-infrastructure.zalan.do"
311+
# OpenTelemetry
312+
skipper_ingress_open_telemetry_enabled: "true" # TODO: false by default
311313

312314
# skipper_serve_method_metric sets the flag -serve-method-metric. It
313315
# defines if the http method is included in the dimension

cluster/manifests/skipper/deployment.yaml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{/* image-updater-bot detects *image variables so use print to disable it for main image */}}
22

3-
{{ $main_image := print "container-registry.zalando.net/teapot/skipper-internal:v0.22.103-1210" }}
4-
{{ $canary_image := "container-registry.zalando.net/teapot/skipper-internal:v0.22.103-1210" }}
3+
{{ $main_image := print "926694233939.dkr.ecr.eu-central-1.amazonaws.com/staging_namespace/teapot/skipper-internal-test:pr-3559-3-pr-49-1" }}
4+
{{ $canary_image := "926694233939.dkr.ecr.eu-central-1.amazonaws.com/staging_namespace/teapot/skipper-internal-test:pr-3559-3-pr-49-1" }}
55

66
{{/* Optional canary arguments separated by "[cf724afc]" to allow whitespaces, e.g. "-foo=has a whitespace[cf724afc]-baz=qux" */}}
77
{{ $canary_args := "" }}
@@ -118,6 +118,35 @@ spec:
118118
secretKeyRef:
119119
name: skipper-ingress
120120
key: lightstep-token
121+
{{ if eq .Cluster.ConfigItems.skipper_ingress_open_telemetry_enabled "true" }}
122+
# https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
123+
- name: OTEL_TRACES_EXPORTER
124+
value: otlp
125+
- name: OTEL_EXPORTER_OTLP_PROTOCOL
126+
value: grpc
127+
- name: OTEL_EXPORTER_OTLP_ENDPOINT
128+
value: "{{ .Cluster.ConfigItems.tracing_collector_host }}:8444"
129+
- name: OTEL_EXPORTER_OTLP_HEADERS
130+
value: "lightstep-access-token=$(LIGHTSTEP_TOKEN)"
131+
- name: OTEL_RESOURCE_ATTRIBUTES
132+
value: application=skipper-ingress,account={{ .Cluster.Alias }},cluster={{ .Cluster.Alias }},artifact={{ .image }}
133+
# TODO: consider adding
134+
# cloud.account.id={{ .Cluster.Alias }}
135+
# cloud.availability.zone -> fieldPath: metadata.annotations['topology.kubernetes.io/zone']
136+
# k8s.namespace.name -> fieldPath: metadata.namespace
137+
# k8s.node.name -> fieldPath: spec.nodeName
138+
# k8s.pod.name -> fieldPath: metadata.name
139+
- name: OTEL_PROPAGATORS
140+
value: tracecontext,ottrace,b3multi,baggage
141+
- name: OTEL_BSP_MAX_QUEUE_SIZE
142+
value: "2048"
143+
- name: OTEL_BSP_MAX_EXPORT_BATCH_SIZE
144+
value: "512"
145+
- name: OTEL_BSP_SCHEDULE_DELAY
146+
value: "5000"
147+
- name: OTEL_BSP_EXPORT_TIMEOUT
148+
value: "5000"
149+
{{ end }}
121150
{{ if or (eq .Cluster.ConfigItems.skipper_local_tokeninfo "production") (eq .Cluster.ConfigItems.skipper_local_tokeninfo "bridge") }}
122151
- name: LOCAL_TOKENINFO
123152
value: "true"
@@ -236,6 +265,9 @@ spec:
236265
{{ end }}
237266
{{ end }}
238267
- "-histogram-metric-buckets=.0001,.00025,.0005,.00075,.001,.0025,.005,.0075,.01,.025,.05,.075,.1,.2,.3,.4,.5,.75,1,2,3,4,5,7,10,15,20,30,60,120,300,600"
268+
{{ if eq .Cluster.ConfigItems.skipper_ingress_open_telemetry_enabled "true" }}
269+
- "-open-telemetry={}"
270+
{{ else }}
239271
- >-
240272
-opentracing=lightstep
241273
component-name=skipper-ingress
@@ -255,6 +287,7 @@ spec:
255287
max-logs-per-span={{ .Cluster.ConfigItems.skipper_ingress_lightstep_max_logs_per_span }}
256288
propagators={{ .Cluster.ConfigItems.skipper_ingress_lightstep_propagators }}
257289
{{ .Cluster.ConfigItems.skipper_ingress_lightstep_log_events }}
290+
{{ end }}
258291
- "-opentracing-excluded-proxy-tags={{ .Cluster.ConfigItems.skipper_ingress_opentracing_excluded_proxy_tags }}"
259292
{{ if eq .Cluster.ConfigItems.skipper_ingress_opentracing_backend_name_tag "true" }}
260293
- "-opentracing-backend-name-tag"

0 commit comments

Comments
 (0)