mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-31 06:26:19 -02:30
Fix containerd tracing with containerd 2.x (#13630)
* fix(containerd): pass tracing settings as OpenTelemetry environment variables * fix(containerd): address review on tracing * fix(containerd): drop tracing comments
This commit is contained in:
@@ -91,15 +91,3 @@ oom_score = {{ containerd_oom_score }}
|
||||
|
||||
[plugins."io.containerd.nri.v1.nri"]
|
||||
disable = {{ 'false' if nri_enabled else 'true' }}
|
||||
|
||||
{% if containerd_tracing_enabled %}
|
||||
[plugins."io.containerd.tracing.processor.v1.otlp"]
|
||||
endpoint = "{{ containerd_tracing_endpoint }}"
|
||||
protocol = "{{ containerd_tracing_protocol }}"
|
||||
{% if containerd_tracing_protocol == "grpc" %}
|
||||
insecure = false
|
||||
{% endif %}
|
||||
[plugins."io.containerd.internal.v1.tracing"]
|
||||
sampling_ratio = {{ containerd_tracing_sampling_ratio }}
|
||||
service_name = "{{ containerd_tracing_service_name }}"
|
||||
{% endif %}
|
||||
|
||||
@@ -40,6 +40,13 @@ OOMScoreAdjust=-999
|
||||
{% if kube_reserved is defined and kube_reserved|bool %}
|
||||
Slice={{ kube_reserved_cgroups_for_service_slice }}
|
||||
{% endif %}
|
||||
{% if containerd_tracing_enabled and containerd_version is version('2.0.0', '>=') %}
|
||||
Environment="OTEL_EXPORTER_OTLP_ENDPOINT={{ containerd_tracing_endpoint }}"
|
||||
Environment="OTEL_EXPORTER_OTLP_PROTOCOL={{ containerd_tracing_protocol }}"
|
||||
Environment="OTEL_SERVICE_NAME={{ containerd_tracing_service_name }}"
|
||||
Environment="OTEL_TRACES_SAMPLER=parentbased_traceidratio"
|
||||
Environment="OTEL_TRACES_SAMPLER_ARG={{ containerd_tracing_sampling_ratio }}"
|
||||
{% endif %}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user