open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/docs/languages/go
Apache License 2.0
5.25k stars 1.06k forks source link

Callbacks should be parallel #3034

Open MadVikingGod opened 2 years ago

MadVikingGod commented 2 years ago

Currently, callbacks are executed serially. Before beta release we should determine a way to make callbacks parallel, and if there is any benefit to doing so.

A suggested solution is a pool of callback workers. This would stop a large number of go routines from executing at once.

jmacd commented 2 years ago

The specification definitely allows for it!

Kaushal28 commented 1 year ago

Hi, can I pick this up? Also, could you provide some more details about getting started and specifically which callbacks are you referring to exactly?

Kaushal28 commented 1 year ago

Hey @pellared could you help me getting started with this issue? Thanks.

pellared commented 1 year ago

@Kaushal28 I guess it is about Asynchronous instruments callbacks. @MadVikingGod am I correct? This issue has been assigned to Go: Metric SDK (Post-GA) and I am not sure if it would be a good timing to work on it right now.

ajatprabha commented 5 days ago

I'm using ObservableGauges to keep track of some external dependencies.

One concern I have is, if the usage of Observables comes at a cost of increased handler scrape latency when using the go.opentelemetry.io/otel/exporters/prometheus.Exporter via the default prometheus.Registerer, which is exposed behind /metrics on the service.

Is there a possibility of such an issue? If yes, can making these callbacks execute in parallel improve it? I can contribute, if this is ready to pick up.

ps: @Kaushal28 were you able to look into this? any blockers?