You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently use Elastic Observability's Elastic APM Agent for our .NET applications that run on k8s and we are migrating to OpenTelemetry, so we can be vendor agnostic and use auto-instrumentation, not requiring specific code changes for each programming language.
I'm using the demo as a basis for this and created an OpenTelemetry Collector, as shown below:
mode: daemonset
image:
repository: otel/opentelemetry-collector-k8s
presets:
# enables the k8sattributesprocessor and adds it to the traces, metrics, and logs pipelines
kubernetesAttributes:
enabled: true
# enables the kubeletstatsreceiver and adds it to the metrics pipelines
kubeletMetrics:
enabled: true
# Enables the filelogreceiver and adds it to the logs pipelines
logsCollection:
enabled: true
## The chart only includes the loggingexporter by default## If you want to send your data somewhere you need to## configure an exporter, such as the otlpexporter
config:
receivers:
otlp:
protocols:
http:
cors:
allowed_origins:
- http://*
- https://*
exporters:
debug:
verbosity: detailed
sampling_initial: 5
sampling_thereafter: 200
otlp/elastic:
endpoint: ###.apm.us-central1.gcp.cloud.es.io:443
compression: none
headers:
Authorization: "Bearer ###"
processors:
batch: {}
k8sattributes:
extract:
metadata:
- k8s.namespace.name
- k8s.deployment.name
- k8s.statefulset.name
- k8s.daemonset.name
- k8s.cronjob.name
- k8s.job.name
- k8s.node.name
- k8s.pod.name
- k8s.pod.uid
- k8s.pod.start_time
passthrough: false
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: resource_attribute
name: k8s.pod.uid
- sources:
- from: connection
memory_limiter:
check_interval: 5s
limit_percentage: 80
spike_limit_percentage: 25
resource:
attributes:
- action: insert
from_attribute: k8s.pod.uid
key: service.instance.id
- action: insert
from_attribute: service.namespace
key: service.namespace
- action: insert
from_attribute: service.name
key: service.name
- action: insert
value: dev
key: deployment.environment
service:
pipelines:
traces:
receivers: [otlp]
processors: [k8sattributes, memory_limiter, resource, batch]
exporters: [debug, otlp/elastic]
metrics:
receivers: [otlp]
processors: [k8sattributes, memory_limiter, resource, batch]
exporters: [debug, otlp/elastic]
logs:
receivers: [otlp]
processors: [k8sattributes, memory_limiter, resource, batch]
exporters: [otlp/elastic, debug]
The logs are actually being exported, as I can see in Log Explorer, but the service.name, service.namespace and deployment.environment are not. In fact, I don't know if this is a problem with traces not appearing, apparently only pod logs are being exported, traces and metrics are not.
If the previous proposed solution does not work either, could you try setting a string value instead of reading from environment variables? (to discard any potential issue in Elasticsearch)
Question
Hello everyone.
We currently use Elastic Observability's Elastic APM Agent for our .NET applications that run on k8s and we are migrating to OpenTelemetry, so we can be vendor agnostic and use auto-instrumentation, not requiring specific code changes for each programming language.
I'm using the demo as a basis for this and created an OpenTelemetry Collector, as shown below:
The logs are actually being exported, as I can see in Log Explorer, but the service.name, service.namespace and deployment.environment are not. In fact, I don't know if this is a problem with traces not appearing, apparently only pod logs are being exported, traces and metrics are not.
Here are the environments variables:
Application Code:
Someone had the same problem and could give me some advices?
The text was updated successfully, but these errors were encountered: