Hi, I have problem with empty node name in services APM
Kibana version :
9.0.3
Elasticsearch version :
9.0.3
My stack
TIBCO BW send otel data to local EDOT collector, collector directly send data to elasticsearch
Is there any posibility to enrich data in otel.yml ?
I would like also add environment to service
Use the resource processor to set or apply changes to resource attributes when using the EDOT Collector.
processors:
resource:
attributes:
- key: service.node.name
value: "my-node-01" # Sets "Node Name"
action: upsert
- key: deployment.environment
value: "production" # Sets "Environment"
action: upsert
Not about actions.
Comparison of Actions
Action
If Attribute is Missing
If Attribute Exists
insert
Adds the new value.
Does nothing. (Won't fix wrong values).
update
Does nothing.
Overwrites with the new value.
upsert
Adds the new value.
Overwrites with the new value.
Use the resource processor to set or apply changes to resource attributes when using the EDOT Collector. | In OpenTelemetry, an attribute is a key-value pair. Attributes are similar to labels in that they add metadata to transactions, spans, and...
Forgot add otel config, Already added before
metadata
otel.yml
receivers:
otlp/fromsdk:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
extensions:
file_storage:
directory: /opt/Elastic/Agent/data/otelcol
processors:
batch:
send_batch_size: 1000
timeout: 10s
resourcedetection:
detectors: [env, system]
attributes/dataset:
actions:
- key: event.dataset
from_attribute: data_stream.dataset
action: upsert
attributes/env:
actions:
- key: deployment.environment
value: PRD
action: upsert
- key: service.environment
value: PRD
action: upsert
- key: environment
value: PRD
action: upsert
attributes/nodename:
actions:
- key: service.node.name
value: hostname
action: upsert
transform/spanname:
trace_statements:
- context: span
statements:
- set(name, attributes["ActivityName"])
elastictrace: {}
exporters:
elasticsearch/otel:
endpoints:
- "http://:9200"
- "http://:9200"
- "http://:9200"
api_key: "=="
mapping:
mode: otel
metrics_dynamic_index:
enabled: true
traces_dynamic_index:
enabled: true
service:
extensions: [file_storage]
pipelines:
traces:
receivers: [otlp/fromsdk]
processors: [resourcedetection, elastictrace, attributes/dataset, batch, attributes/env, attributes/nodename, transform/spanname]
exporters: [elasticsearch/otel]
metrics:
receivers: [otlp/fromsdk]
processors: [resourcedetection, attributes/dataset, batch]
exporters: [elasticsearch/otel]
telemetry:
logs:
level: debug
Without changing anything on the collector, you should also be able to configure the “resource attributes” directly at the service level, those are shared for the whole service instance and are applied to all the captured signals.
If you configure otel SDK/instrumentation through environment variables you can use `OTEL_RESOURCE_ATTRIBUTES` to set `service.environment.name` (which has been renamed recently in semconv from `service.environment`), same for `service.node.name`.