[transform processor] How to get original metric resource within a chain of OTEL Collectors? #35242
Unanswered
gregbrowndev
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
In my cluster, I've deployed a OTEL Collector "gateway", which contains OLTP receivers for push-based telemetry and centralises the processor and exporter logic.
I also have a small number of OTEL Collector "agents" deployed for specific services that have pull-based telemetry. These collectors simplify telemetry collection by sitting as sidecars to the main container and using the Prometheus receiver to scrape their metrics. These "agent" collectors export their telemetry to the "gateway" collector.
I want to use the Transform Processor in the gateway collector to add some common metric labels to all metrics using the resource attributes. Specifically, I want to ensure all metrics have the labels
service_namespace
andservice_name
(note: I can't add these labels in the instrumented service myself, but I can control the resource labels.) However, it seems that the upstream agent collector wraps the metric with its own resource object, or at least concatenates the resourceservice.name
together.So the metrics I see in Prometheus have the metric label:
service_name: "otel-collector;history"
when it should just say "history".How can I read the Resource attributes from the leaf/original resource rather than this "otel-collector" resource?
OTEL Collector gateway config
OTEL Collector agent config
Beta Was this translation helpful? Give feedback.
All reactions