opentelemetry-go icon indicating copy to clipboard operation
opentelemetry-go copied to clipboard

Add instrument provider caching

Open MrAlias opened this issue 3 years ago • 2 comments

Split from #3245

Create a cache for the instProvider type and use it for this method: https://github.com/open-telemetry/opentelemetry-go/blob/4146bd1403be895f9c1b1193e1aa177039c32001/sdk/metric/instrument_provider.go#L37

This will prevent the need for duplicate aggregator lookups when a user asks for the exact same instrument multiple times.

MrAlias avatar Dec 08 '22 19:12 MrAlias

Hi @MrAlias - I would like to take this issue on! I forked the repo but have noticed that there has been some restructuring done to the metric/sdk module since this issue was created. In particular, it appears there is a resolver struct which takes advantage of an instrumentCache to providing the caching behavior described above.

Is the issue referring to something else? Or does it need to be marked as closed/complete?

Omkar-Waingankar avatar Jan 17 '23 17:01 Omkar-Waingankar

@Omkar-Waingankar I would recommend holding of on this issue until we have a more stable SDK. There are still incoming changes in the instrument provider that would affect any caching at this level.

MrAlias avatar Jan 17 '23 20:01 MrAlias