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

otelmongo: support OTEL_SEMCONV_STABILITY_OPT_IN for v1.26.0 semconv #6172

Merged
merged 43 commits into from
Mar 5, 2025

Conversation

prestonvasquez
Copy link
Contributor

@prestonvasquez prestonvasquez commented Oct 1, 2024

Resolves #6171, #2165

The specifications for maintaining multiple semantic convention versions is documented here: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md.

To use a non-default version:

export OTEL_SEMCONV_STABILITY_OPT_IN=database

To include both v1.26.0 and v1.21.0:

export OTEL_SEMCONV_STABILITY_OPT_IN=database/dup

To include the default (v1.21.0) version:

unset OTEL_SEMCONV_STABILITY_OPT_IN

@prestonvasquez prestonvasquez requested a review from a team as a code owner October 1, 2024 20:40
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.1%. Comparing base (b991afd) to head (aa7f16f).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #6172     +/-   ##
=======================================
+ Coverage   76.0%   76.1%   +0.1%     
=======================================
  Files        219     220      +1     
  Lines      21387   21448     +61     
=======================================
+ Hits       16265   16335     +70     
+ Misses      4561    4555      -6     
+ Partials     561     558      -3     
Files with missing lines Coverage Δ
.../mongo/otelmongo/internal/semconv/event_monitor.go 100.0% <100.0%> (ø)
....mongodb.org/mongo-driver/mongo/otelmongo/mongo.go 90.0% <100.0%> (+4.2%) ⬆️

... and 1 file with indirect coverage changes

@prestonvasquez prestonvasquez changed the title otelmongo#6171 bump semconv to 1.26.0 chore(deps) bump semconv to 1.26.0 Oct 1, 2024
@prestonvasquez
Copy link
Contributor Author

@pellared @dmathieu following up on issue #5551

@dmathieu
Copy link
Member

dmathieu commented Oct 2, 2024

Updating semconv is definitely not just a chore, especially since, as you mention, there are field name changes (which can cause issues with users, since they need to change their queries and dashboards).

We should either mark these breaking changes explicitely in a changelog entry, or follow a similar migration path as the otelhttp instrumentation is doing: #5132

@pellared
Copy link
Member

pellared commented Oct 2, 2024

We should either mark these breaking changes explicitely in a changelog entry, or follow a similar migration path as the otelhttp instrumentation is doing: #5132

@open-telemetry/specs-semconv-maintainers, @open-telemetry/semconv-db-approvers, do you have some recommendations or feedback regarding changes of database semantic conventions? Are we supposed to do some migrations in instrumentation libraries like for HTTP instrumentations?

CC @XSAM as you are the maintainer of https://github.com/XSAM/otelsql which AFAIK is the most popular instrumentation library for database/sql.

@prestonvasquez prestonvasquez changed the title chore(deps) bump semconv to 1.26.0 feat(attributes) bump semconv to 1.26.0 Oct 2, 2024
@trask
Copy link
Member

trask commented Oct 2, 2024

check out https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md:

Warning

Existing database instrumentations that are using v1.24.0 of this document (or prior):

  • SHOULD NOT change the version of the database conventions that they emit by default until the database semantic conventions are marked stable. Conventions include, but are not limited to, attributes, metric and span names, and unit of measure.
  • SHOULD introduce an environment variable OTEL_SEMCONV_STABILITY_OPT_IN in the existing major version which is a comma-separated list of values. If the list of values includes:
    • database - emit the new, stable database conventions, and stop emitting the old experimental database conventions that the instrumentation emitted previously.
    • database/dup - emit both the old and the stable database conventions, allowing for a seamless transition.
    • The default behavior (in the absence of one of these values) is to continue emitting whatever version of the old experimental database conventions the instrumentation was emitting previously.
    • Note: database/dup has higher precedence than database in case both values are present
  • SHOULD maintain (security patching at a minimum) the existing major version for at least six months after it starts emitting both sets of conventions.
  • SHOULD drop the environment variable in the next major version.

Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather first have a PR which bumps semconv to v1.24.0

@prestonvasquez
Copy link
Contributor Author

I would rather first have a PR which bumps semconv to v1.24.0

@pellared Could you clarify this?

@trask
Copy link
Member

trask commented Oct 4, 2024

I would rather first have a PR which bumps semconv to v1.24.0

would this go against the semconv recommendation?

SHOULD NOT change the version of the database conventions that they emit by default until the database semantic conventions are marked stable.

@prestonvasquez
Copy link
Contributor Author

@pellared

Please remember to also update the PR description.

Could you clarify this?

@pellared
Copy link
Member

pellared commented Feb 27, 2025

@pellared

Please remember to also update the PR description.

Could you clarify this?

It does not reflect current changes of the PR

@prestonvasquez prestonvasquez changed the title feat(attributes) bump semconv to 1.26.0 feat(attributes) Add OTEL_SEMCONV_STABILITY_OPT_IN to otelmongo for semconv 1.26.0 opt-in Feb 28, 2025
@prestonvasquez prestonvasquez changed the title feat(attributes) Add OTEL_SEMCONV_STABILITY_OPT_IN to otelmongo for semconv 1.26.0 opt-in feat(attributes) Support OTEL_SEMCONV_STABILITY_OPT_IN in otelmongo Feb 28, 2025
@pellared
Copy link
Member

pellared commented Mar 1, 2025

@prestonvasquez, I meant the PR description (not title) 😉

@prestonvasquez
Copy link
Contributor Author

@prestonvasquez, I meant the PR description (not title) 😉

Whoops I was doing this on my phone, guess I didn't hit save.

Co-authored-by: Robert Pająk <[email protected]>
…ternal/semconv/event_monitor.go

Co-authored-by: Damien Mathieu <[email protected]>
@pellared pellared changed the title feat(attributes) Support OTEL_SEMCONV_STABILITY_OPT_IN in otelmongo otelmongo: support OTEL_SEMCONV_STABILITY_OPT_IN and v1.26.0 semconv Mar 5, 2025
@pellared pellared changed the title otelmongo: support OTEL_SEMCONV_STABILITY_OPT_IN and v1.26.0 semconv otelmongo: support OTEL_SEMCONV_STABILITY_OPT_IN for v1.26.0 semconv Mar 5, 2025
@pellared
Copy link
Member

pellared commented Mar 5, 2025

@prestonvasquez, thank you for your work 👍

@dmathieu dmathieu merged commit 04b152d into open-telemetry:main Mar 5, 2025
31 checks passed
@prestonvasquez prestonvasquez deleted the otelmongo#6171 branch March 5, 2025 16:24
@XSAM XSAM added this to the v1.35.0 milestone Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[otelmongo] bump semconv to 1.26.0
5 participants