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

Move otelgin/internal/semconvutil into otelgin #4581

Closed
els0r opened this issue Nov 15, 2023 · 2 comments
Closed

Move otelgin/internal/semconvutil into otelgin #4581

els0r opened this issue Nov 15, 2023 · 2 comments
Labels
area: instrumentation Related to an instrumentation package enhancement New feature or request instrumentation: otelgin
Milestone

Comments

@els0r
Copy link

els0r commented Nov 15, 2023

Problem Statement

Analogous to #4580, just for gin-gonic.

The semconvutil package follows semantic conventions for span attributes set during handling of a request by a server.

Exposing the utility functions from semconvutil would allow other gin middlewares to use them, leading to consistent, semconv-aligned telemetry.

In my specific use case, I'm providing a logging middleware and would like to use the same attribute keys as the otelgin Middleware does.

Proposed Solution

Move semconvutil from go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin/internal/semconvutil to go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin/semconvutil

Alternatives

  • Copy-pasting the internals of semconvutil to internal instrumentation library. Which isn't really maintainable
  • Or keep the current implementation, which doesn't align with the semantic conventions
  • Accessing the attributes of the parent span from the otelgin middleware (if that's even possible)

Prior Art

Not aware of any.

Additional Context

We have some servers which handle a low frequency of requests and would like to correlate log messages in our system with the corresponding spans we export.

@els0r els0r added area: instrumentation Related to an instrumentation package enhancement New feature or request instrumentation: otelgin labels Nov 15, 2023
@MrAlias
Copy link
Contributor

MrAlias commented Nov 15, 2023

These are all copied packages from https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/internal/shared/semconvutil

There should be no difference between the semconvutil packge in otelhttp and otelgin. I would recommend closing this issue in favor of #4580 given we do not plan to export two of the same package.

@els0r
Copy link
Author

els0r commented Nov 15, 2023

Thanks for the broader context and the link to the semconvutil generators. No need to track two issues, then. Let's continue discussion in #4580 .

@els0r els0r closed this as completed Nov 15, 2023
@pellared pellared added this to the untracked milestone Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: instrumentation Related to an instrumentation package enhancement New feature or request instrumentation: otelgin
Projects
None yet
Development

No branches or pull requests

3 participants