--- tags: Observability, open-telemetry, OpenTelemetry --- # Open-Telemetry Collector Resource ## ELK MEMO - [Elastic APM Open Telemetry Native Support](https://www.elastic.co/guide/en/apm/guide/8.8/open-telemetry-direct.html#connect-open-telemetry-collector) - [Elastic APM Open Telemetry Resource Attributes](https://www.elastic.co/guide/en/apm/guide/8.8/open-telemetry-resource-attributes.html) - [Elastic Collect Metrics](https://www.elastic.co/guide/en/apm/guide/current/open-telemetry-collect-metrics.html) - [Elastic Trace Resource Keys](https://www.elastic.co/guide/en/ecs/current/ecs-event.html) ## Open-Telmetry Semantic-Conventions Docs - [Open-Telemetry Resource (index page)](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/resource) - [Open-Telemetry Resource Cloud](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/cloud.md) - [Open-Telemetry Resource k8s](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/k8s.md) - [Open-Telemetry Trace Semantic Conventions General attributes](https://opentelemetry.io/docs/specs/otel/trace/semantic_conventions/span-general/) - [Open-Telemetry Configuration](https://opentelemetry.io/docs/collector/configuration) ## Config Memo :::info for open-telemetry collector-contrib 0.80.0 ::: ```yaml receivers: # https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver otlp: protocols: grpc: endpoint: 0.0.0.0:4317 http: endpoint: 0.0.0.0:4318 exporters: # https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/loggingexporter/README.md logging: verbosity: normal # https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/lokiexporter/README.md loki: endpoint: http://loki.kube-monitor.svc.cluster.local:3100/loki/api/v1/push tls: insecure: true # https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/README.md otlp/tempo: endpoint: http://tempo-distributor.kube-monitor.svc.cluster.local:4317 tls: insecure: true prometheus: endpoint: 0.0.0.0:8889 send_timestamps: true metric_expiration: 180m resource_to_telemetry_conversion: enabled: true otlp/elastic: # Elastic APM server https endpoint without the "https://" prefix endpoint: "http://<endpoint>:<port>" headers: # Elastic APM Server secret token Authorization: "Bearer <token>" tls: insecure: true processors: batch: memory_limiter: # 80% of maximum memory up to 2G limit_mib: 1500 # 25% of limit up to 2G spike_limit_mib: 512 check_interval: 5s # for grafana loki resource/loki: attributes: - action: insert key: loki.resource.labels value: service.name, service.namespace, service.version, ApplicationName # for elastic resource/elastic: attributes: - action: insert # this key is not Official Specifications key: service.organization value: my-organization - action: insert key: k8s.cluster.name value: product-cluster service: pipelines: logs: receivers: [otlp] processors: [resource/loki] exporters: [loki] logs/elastic: receivers: [otlp] processors: [resource/elastic] exporters: [otlp/elastic] traces: receivers: [otlp] processors: [memory_limiter, batch, resource/elastic] exporters: [otlp/tempo, otlp/elastic] metrics: receivers: [otlp] processors: [batch, resource/elastic] exporters: [prometheus, otlp/elastic] ```