-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[v2][adjuster] Implement adjuster for correct timestamps for clockskew #6392
Conversation
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6392 +/- ##
========================================
Coverage 96.22% 96.23%
========================================
Files 363 364 +1
Lines 20748 20868 +120
========================================
+ Hits 19965 20082 +117
- Misses 599 601 +2
- Partials 184 185 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Let's make sure we reproduce the existing tests as close as possible |
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
// hostKey derives a unique string representation of a host based on resource attributes. | ||
// This is used to determine if two spans are from the same host. | ||
func hostKey(resource ptrace.ResourceSpans) string { | ||
if attr, ok := resource.Resource().Attributes().Get("ip"); ok { |
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.
We may need to reconsider this. Even in OpenTracing the tag "ip" was never standard, so why should we use it as a differentiator? In OTEL there are semantic conventions for host identity, we should be using those.
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 I see these semantic conventions related to hosts: https://github.com/open-telemetry/opentelemetry-go/blob/main/semconv/v1.26.0/attribute_group.go#L3853-L3854. Do we want to replace this with HostIPKey
?
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.
I think we should try (in order):
host.id
host.ip
host.name
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.
The host.ip
is an array, I think it's ok to look at the first element only.
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 Done. Let me know if this aligns with what you were thinking
|
||
const ( | ||
warningDuplicateSpanID = "duplicate span IDs; skipping clock skew adjustment" | ||
warningFormatInvalidParentID = "invalid parent span IDs=%s; skipping clock skew adjustment" |
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.
Why does this have format in the name? Are we warning about id format? I'd also tweak the error to be more specific - invalid is not really descriptive. I think here we mean that parent span id is not in the trace.
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 I think the "format" is there is because this is a format string. I removed the word format and changed the warning string per your suggestion.
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
return attr.Str() | ||
} | ||
if attr, ok := resource.Resource().Attributes().Get(string(otelsemconv.HostIPKey)); ok { | ||
ips := attr.Slice() |
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.
I suspect some people may ignore setting a slice and set just a plain string, so I would handle that use case too.
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
jaegertracing#6392) ## Which problem is this PR solving? - Towards jaegertracing#6344 ## Description of the changes - Implemented an adjuster to correct timestamps for clockskew. ## How was this change tested? - Added unit tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
jaegertracing#6392) ## Which problem is this PR solving? - Towards jaegertracing#6344 ## Description of the changes - Implemented an adjuster to correct timestamps for clockskew. ## How was this change tested? - Added unit tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test