open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.46k stars 1.47k forks source link

[config] Allow grpc interceptor configuration for otlp exporter #6494

Open abeach-nr opened 2 years ago

abeach-nr commented 2 years ago

Currently, it is not possible to configure client grpc interceptors on the otlp exporter.

This function is public, and supports extra grpc dial options: https://github.com/open-telemetry/opentelemetry-collector/blob/52ef7bde6f3724746625498e2a090bc44cfcbb7d/config/configgrpc/configgrpc.go#L186

However, there is no way to pass in additional dial options (for example, an interceptor) https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/otlp.go#L77

I have a use case where i want to modify the grpc request within the exporter based on resource attributes

jpkrohling commented 4 months ago

@abeach-nr, if you are still interested in this feature, can you help me understand how you'd use this? Are you an API consumer of the OTLP exporter?