Skip to content

semconv: mark the package as deprecated #13012

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

Merged

Conversation

codeboten
Copy link
Contributor

This package will be removed in the future, use go.opentelemetry.io/otel/semconv instead

This package will be removed in the future.

Signed-off-by: Alex Boten <[email protected]>
@codeboten codeboten requested a review from a team as a code owner May 9, 2025 19:25
@codeboten codeboten requested a review from songy23 May 9, 2025 19:25
Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.58%. Comparing base (ee2c784) to head (ef2188d).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13012   +/-   ##
=======================================
  Coverage   91.58%   91.58%           
=======================================
  Files         505      505           
  Lines       28319    28319           
=======================================
  Hits        25937    25937           
  Misses       1873     1873           
  Partials      509      509           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

Please explain how can we use that in the collector pdata world where the otel attributes (and KeyValues, etc.) are incompatible

@codeboten
Copy link
Contributor Author

@bogdandrutu sure, i created the following PRs to update the core/contrib repos to use the otelgo semconv package:

It seemed to work ok. See the comment in the original PR:

This updates the calls to the collector's internal semconv package with otelgo's instead. The main difference is how the keys can be used, they will need to be cast as strings where they key name is needed, otherwise it's not a huge change. This would allow us to stop producing our own semconv package once contrib is moved as well.

I ran some benchmarks of instantiating the service's Resource using the old semconv and the new ones to validate that using the new semconv wouldn't have an impact on allocations:

benchstat 20_runs_bench.txt 20_oldsemconv_runs_bench.txt 
goos: darwin
goarch: arm64
pkg: go.opentelemetry.io/collector/service/internal/resource
cpu: Apple M3 Max
               │ 20_runs_bench.txt │    20_oldsemconv_runs_bench.txt    │
               │      sec/op       │   sec/op     vs base               │
NewResource-14         332.2n ± 2%   323.4n ± 1%  -2.68% (p=0.000 n=20)

               │ 20_runs_bench.txt │  20_oldsemconv_runs_bench.txt  │
               │       B/op        │    B/op     vs base            │
NewResource-14          720.0 ± 0%   720.0 ± 0%  ~ (p=1.000 n=20) ¹
¹ all samples are equal

               │ 20_runs_bench.txt │  20_oldsemconv_runs_bench.txt  │
               │     allocs/op     │ allocs/op   vs base            │
NewResource-14          8.000 ± 0%   8.000 ± 0%  ~ (p=1.000 n=20) ¹
¹ all samples are equal

Is there a specific aspect of pdata using the otel go's semconv that you're thinking about?

@bogdandrutu
Copy link
Member

bogdandrutu commented May 12, 2025

@codeboten

Are we concerned about string(semconv.ServiceNameKey) being a bit too verbose/cryptic? Should we, if this is a pattern we want, at least extend the pcommon.Map to have some overloads that accepts as key the otel attrs? Or at least something like "PutKeyValue" for example?

I understand there is no performance problem, it is just the semantics and how code looks like that concerns me.

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

LGTM. I think the ergonomics suffer, but I think it is fine and that we can add the helpers if necessary.

If we don't do this we need to have a plan forward on maintaining semconv, we have been inconsistent in keeping it up to date.

It's also probably good to do this in terms of the binary size (historically I have heard complaints related to the amount of strings that our binaries have because of semconv)

@songy23
Copy link
Member

songy23 commented May 12, 2025

Is this a release blocker ?

Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

I agree with the approach of using otel-go instead of updating this package to be generated via weaver. If the ergonomics of string() gets too annoying we can add new functions to pdata to improve the experience.

@codeboten
Copy link
Contributor Author

Is this a release blocker ?

It doesn't have to block the release i don't think. We don't need to mark the semconv package as deprecated in this release

@bogdandrutu bogdandrutu dismissed their stale review May 12, 2025 17:12

Looks like other are ok with the downgraded usability experience, I am fine to not block this.

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

LGTM

@mx-psi
Copy link
Member

mx-psi commented May 21, 2025

#13065 removes the associated workflow

@codeboten codeboten added this pull request to the merge queue May 21, 2025
Merged via the queue into open-telemetry:main with commit 54ae936 May 21, 2025
56 checks passed
github-merge-queue bot pushed a commit that referenced this pull request May 21, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Removes workflow. It is broken and we will not use it anymore after
#13012
@codeboten codeboten deleted the codeboten/mark-semconv-deprecated branch May 21, 2025 16:19
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.

7 participants