-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Decouple from OTel Collector semconv package #7318
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7318 +/- ##
==========================================
+ Coverage 96.27% 96.44% +0.17%
==========================================
Files 377 378 +1
Lines 22900 22910 +10
==========================================
+ Hits 22047 22096 +49
+ Misses 645 616 -29
+ Partials 208 198 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
internal/storage/v2/elasticsearch/tracestore/from_dbmodel_test.go
Outdated
Show resolved
Hide resolved
DBSystemKey = semconv.DBSystemNameKey | ||
PeerServiceKey = semconv.PeerServiceKey | ||
// Service | ||
ServiceNameKey = semconv.ServiceNameKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to convert these to strings here so that we don't have to do it all over the code??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurishkuro Because codebase has a mixed usage pattern where semantic convention keys are needed in two different contexts
- Internal operations (attribute lookups, map keys, string comparisons) that require string constants
examples:
- to_dbmodel.go: Uses conventions.ServiceNameKey as string for comparisons
if key == conventions.AttributeServiceName { - memory.go: Uses conventions.ServiceNameKey as string for attribute lookups
jaeger/internal/storage/v2/memory/memory.go
Line 223 in a9c1473
val, ok := resource.Attributes().Get(conventions.AttributeServiceName)
- OpenTelemetry SDK calls that require
attribute.Key
types with methods like.String()
examples:
- main.go: Needs
conventions.ServiceNameKey.String(svc)
for resource attributes
Line 89 in a9c1473
resource.WithAttributes(otelsemconv.ServiceNameKey.String(svc)), - query_logger.go : `conventions.DBSystemKey.String("elasticsearch")
otelsemconv.DBSystemKey.String("elasticsearch"),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurishkuro Should i Modify semconv.go to provide both string constants and attribute.Key types??
something like
const (
ServiceNameKeyStr = "service.name"
)
var (
ServiceNameKey = semconv.ServiceNameKey
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how many places where the actual attribute is required? If it's just a couple, I would convert all Key constants to strings but for the places where the actual attribute is being created define functions, e.g.
func ServiceNameAttribute(value strign) {
return otel.ServiceNameKey.String(svc)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurishkuro got it ! , atrribute keys are used in total of six files, namely :
otelsemconv.PeerServiceKey.String("mysql"), |
jaeger/internal/jtracer/jtracer.go
Line 106 in 598e0a2
resource.WithAttributes(otelsemconv.ServiceNameKey.String(svc)), |
otelsemconv.DBSystemKey.String("elasticsearch"), |
Line 89 in 598e0a2
resource.WithAttributes(otelsemconv.ServiceNameKey.String(svc)), |
otelsemconv.ServiceNameKey.String("test"), |
resource.WithAttributes(otelsemconv.ServiceNameKey.String(serviceName)), |
- Update semantic convention attribute access - Add comprehensive test coverage - Fix DCO compliance Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Pull request was closed
Which problem is this PR solving?
Description of the changes
This commit removes the dependency on
go.opentelemetry.io/collector/semconv
and internalizes the required semantic convention constants.Key changes:
Package
internal/telemetry/otelsemconv
host the semantic convention constants used throughout the project.All usages of the external semconv package have been replaced with the internal package.
This change reduces external dependencies, providing more stability and control over the semantic conventions used within Jaeger.
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test