envoy icon indicating copy to clipboard operation
envoy copied to clipboard

OpenTelemetry metrics sink and access logger - Ability to configure OpenTelemetry Resource via Resource Detectors

Open evantorrie opened this issue 9 months ago • 3 comments

Title: Support OpenTelemetry Resource detectors for Otel Metrics sink

Description: The OpenTelemetry project defines the concept of a Resource. It is a bag of attributes that can be configured in different ways in OpenTelemetry, via environment variables, explicitly in code or via Resource detectors.

Issue #28929 and its resolution #29547 added support in the OpenTelemetry Tracer configuration for "Resource Detectors".

  1. However, the OpenTelemetry Logger implementation, while allowing configurable resource attributes does not support resource detectors.

  2. The OpenTelemetry Metrics sink does not seem to support allowing configurable resource attributes - not even service.name (please correct me if I'm wrong).

The OpenTelemetry Resource concept applies across all telemetry signals - traces, metrics and logs. It would be great to see if we can unify the different signal types in Envoy such that the OpenTelemetry Resource configuration is specified once, and then inherited by the three different signal generators.

Failing that, at least unifying support for each signal type to be able to specify a set of resource detectors (specifically the Environment Resource Detector which can set resource attributes from environment variables as defined in the OpenTelemetry specification) would greatly help in identifying the metrics and logs as emanating from the same underlying Envoy instance.

Relevant Links: #28929 - Adding Resource Detectors to OpenTelemetry Tracer

evantorrie avatar May 06 '24 18:05 evantorrie

cc @alexanderellis @htuch

phlax avatar May 08 '24 15:05 phlax

cc @joaopgrassi

phlax avatar May 08 '24 15:05 phlax

I didn't dig into details of how OTel metrics and logs are collected/recorded in Envoy. This would be another benefit if we would use the OTel SDK in Envoy instead of having a somewhat custom implementation of it.

Having said that, maybe it's possible to "move out" the concept of resource detector from the tracer package/module so other signals can be used? I'm not sure if that's possible..

joaopgrassi avatar May 15 '24 20:05 joaopgrassi

Yes, ideally there would be some sort of global setting for OpenTelemetry Resource, and the trace/metrics/logging OpenTelemetry exporters would refer to that when initializing themselves, so that the resource information gets associated with each set of outgoing telemetry data.

evantorrie avatar May 25 '24 21:05 evantorrie

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jun 25 '24 00:06 github-actions[bot]

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

github-actions[bot] avatar Jul 02 '24 04:07 github-actions[bot]

@joaopgrassi I think this is still important. Is it possible to label this as help wanted?

evantorrie avatar Jul 31 '24 06:07 evantorrie

I can't add labels or re-open. @wbpcode l, @phlax can you please reopen? Thank you!

joaopgrassi avatar Oct 06 '24 10:10 joaopgrassi