linting: add depguard rule to enforce semconv version - #8041
Merged
Conversation
ajuijas
requested review from
MrAlias,
XSAM,
dashpole,
dmathieu,
flc1125 and
pellared
as code owners
March 11, 2026 08:45
|
|
dmathieu
reviewed
Mar 11, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8041 +/- ##
=====================================
Coverage 81.6% 81.6%
=====================================
Files 304 304
Lines 23448 23448
=====================================
+ Hits 19135 19136 +1
+ Misses 3927 3925 -2
- Partials 386 387 +1 🚀 New features to boost your workflow:
|
Member
|
An exception needs to be added for the zipkin exporter. |
ajuijas
force-pushed
the
add-semconv-depguard-rule
branch
2 times, most recently
from
March 11, 2026 10:01
9dc88ac to
aaf0ece
Compare
Member
|
You force-pushed the wrong commit. |
Contributor
Author
|
I just messed my local branch with changes in remote :( |
- Add Zipkin exporter exception to depguard. - Update sdk/log benchmarks to use semconv/v1.40.0. - Remove manual CHANGELOG entry.
Contributor
Author
|
Fixed
|
dmathieu
approved these changes
Mar 11, 2026
pellared
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a
depguardlinter rule to .golangci.yml to enforce the use of the latest semantic convention version (v1.40.0).This rule ensures that:
otel/semconvmust usev1.40.0.semconv/directory itself is excluded from this check to avoid linting legacy definitions.zipkin exporteris excluded from this checksemconvversion to v1.40.0 in thesdk/log/logger_bench_test.gotest.Verification Results
I verified this change locally using the following steps:
make precommit(which executesgolangci-lint run). It passed with 0 issues across the entire repository.go.opentelemetry.io/otel/semconv/v1.20.0in trace.go. The linter correctly reported the violation:This change is not performance-critical and does not affect the library's runtime behavior.
Checklist
make precommitpasses.Fixes #7842