-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support sending OTEL metrics and spans from KrakenD plugins #21
Comments
Good suggestion! I've prepared a different pr for adding custom labels to already created metrics but I think it is not appropriate in your case. But it is in the same area of customizing metrics so it would be good to do the above! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
I have a request modifier plugin that uses go-redis, and I'd like to instrument it via https://pkg.go.dev/github.com/redis/go-redis/extra/redisotel/v9.
To be able to send custom metrics and spans from a plugin, I need access to the OTEL meter and tracer providers, but AFAIK krakend-otel never calls https://pkg.go.dev/go.opentelemetry.io/otel#SetMeterProvider and https://pkg.go.dev/go.opentelemetry.io/otel#SetTracerProvider, which means the only way to get them from a plugin is to import
github.com/krakend/krakend-otel/state
and callstate.GlobalState()
.This works, but I think it would be better if plugins didn't have to depend on krakend-otel directly 😄
I can prepare a PR to make these calls in https://github.com/krakend/krakend-otel/blob/main/state/global.go, if you want. Thanks!
The text was updated successfully, but these errors were encountered: