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

[feature request] allow export instrumentationName #16

Closed
futurist opened this issue Mar 7, 2023 · 1 comment
Closed

[feature request] allow export instrumentationName #16

futurist opened this issue Mar 7, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@futurist
Copy link

futurist commented Mar 7, 2023

A clear and concise description of what you want to happen.

currently it's not possible to get tracerProvider from otel, like below:

tracer := otel.GetTracerProvider().Tracer(instrumentationName)

since below is not exported:

const (
	instrumentationName = "github.com/hertz-contrib/obs-opentelemetry"
)

Describe alternatives you've considered

Make instrumentationName be exported so can get the same tracer of hertz, then add new span into exiting hertz tracer.

@Duslia Duslia added the enhancement New feature or request label Mar 7, 2023
@CoderPoet
Copy link
Collaborator

This is the tracer of the internal library, and it is recommended that the tracer of the business layer be separated from it. Consider customizing a tracer name, like:

otel.GetTracerProvider().Tracer("your business tracer")

li-jin-gou pushed a commit to li-jin-gou/obs-opentelemetry that referenced this issue Jan 15, 2024
fix: print span info with ctx  && add  CtxKVLog method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants