Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instrument provider caching #3527

Closed
MrAlias opened this issue Dec 8, 2022 · 2 comments · Fixed by #4820
Closed

Add instrument provider caching #3527

MrAlias opened this issue Dec 8, 2022 · 2 comments · Fixed by #4820
Assignees
Labels
area:metrics Part of OpenTelemetry Metrics enhancement New feature or request pkg:SDK Related to an SDK package
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Dec 8, 2022

Split from #3245

Create a cache for the instProvider type and use it for this method:

func (p *instProvider[N]) lookup(kind InstrumentKind, name string, opts []instrument.Option) (*instrumentImpl[N], error) {

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

@MrAlias MrAlias added enhancement New feature or request pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics labels Dec 8, 2022
@MrAlias MrAlias moved this to Backlog in Go: Metric SDK (Post-GA) Dec 8, 2022
@MrAlias MrAlias mentioned this issue Dec 8, 2022
5 tasks
@Omkar-Waingankar
Copy link

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?

@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 17, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics enhancement New feature or request pkg:SDK Related to an SDK package
Projects
3 participants