apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: {Instrumentation name}
spec:
exporter:
endpoint: http://cocktail-telemetry-collector.cocktail-addon:4318
python:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python:0.44b0
env:
- name: OTEL_LOGS_EXPORTER
value: otlp_proto_http
- name: OTEL_METRICS_EXPORTER
value: none
- name: OTEL_TRACES_EXPORTER
value: none
- name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT
value: http://cocktail-telemetry-collector.cocktail-addon:4318/v1/logs
- name: OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED
value: 'true'
# 해당 네임스페이스의 anotation 값이 'true'인 모든 파이썬 어플리케이션을 수집하고싶을때 사용.
# 아래 설정은 네임스페이스내 모든 Python 애플리케이션을 같은 이름으로 선언하는 경우 사용함.
# 워크로드별 애플리케이션 이름을 다르게 사용하고자 하는 경우 각 애플리케이션 환경 변수에 설정.
- name: OTEL_SERVICE_NAME
value: {애플리케이션 이름}
- name: OTEL_EXPORTER_OTLP_LOGS_HEADERS
value: app_token={애플리케이션 토큰},app_name={애플리케이션 이름}