open-telemetry / opentelemetry-dotnet

The OpenTelemetry .NET Client
https://opentelemetry.io
Apache License 2.0
3.23k stars 765 forks source link

[question] How to handle token refresh in gRPC logs exporter for OpenTelemetry? #5820

Open jan-nemo opened 2 months ago

jan-nemo commented 2 months ago

What is the question?

We are integrating OpenTelemetry into our product to export logs via the OpenTelemetry gRPC protocol. Our target service uses OpenID Connect (Client Credentials Flow) for authentication, requiring a valid access token in the metadata of each request.

The issue we're facing is that when the access token expires, we are unable to update it in the metadata for subsequent requests. This is causing failures once the token becomes invalid.

Could you please provide guidance on how to handle refreshing the access token and updating it in the gRPC metadata for the logs exporter?

Thank you!

Additional context

No response

jpkrohling commented 1 month ago

We discussed this (in generic terms) during today's GC triage meeting and think it might be a good candidate for the spec. We already have a similar behavior as part of the Collector, and it could be helpful to standardize the behavior. For instance, we might want to provide a config option to refresh the token before it expires.