opentelemetry-dotnet-instrumentation
opentelemetry-dotnet-instrumentation copied to clipboard
[kafka] duck typing improvements
Since TTarget is always Confluent.Kafka.Consumer'2, you can always duck type (no chance of failure unless their API changes) and avoid doing it later. The only thing that changes is that now you'll need to change your call to the ConsumerCache so it's like:
ConsumerCache.TryGet(instance.Instance!, out var groupId)
Originally posted by @zacharycmontoya in https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/pull/3055#discussion_r1389913770