lhotari commented on issue #25212: URL: https://github.com/apache/pulsar/issues/25212#issuecomment-3851877100
> Oh, I see, it's the developer's duty to pass a different `OpenTelemetry` instance into `PulsarClientSharedResourcesBuilder`, just like the `ClientBuilderImpl#openTelemetry()` method. Yes. The original reason here was to be able to configure the underlying shared MemoryBufferStats instance. > Every `ClientBuilderImpl` and `PulsarClientSharedResourcesBuilder` should use different `OpenTelemetry` instances, otherwise they will shared the same global `OpenTelemetry` instance. Is this understanding correct? > But, using the same global `OpenTelemetry` instance across multiple `MemoryBufferStats` instances seems to cause them to affect each other? Yes, it would be possible to configure the `OpenTelemetry` instances differently. However, that's very clumbersome and usually the global instance is shared. The limitation in the `org.apache.pulsar.client.impl.metrics.InstrumentProvider` class is that there's no way to scope the instance further so that different client instances could produce different type of metrics (let's say with different attributes). I'm not sure how much of a problem it is to share an instance. Perhaps it's not. I'm sure that the source information would be missing so that you couldn't distinguish the source of a particular metric. It's also possible that there would be some clashes if the same instance is used to create a duplicate metric with the same attributes. However I think that solving that problem could be postponed since it's already possible to manually configure different `OpenTelemetry`/`InstrumentProvider` instances for the clients and have them configured in a way where the metrics don't clash. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
