-
Notifications
You must be signed in to change notification settings - Fork 180
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
[Performance] OpenTracing to OpenTelemetry migration #2823
Conversation
FVM Benchstat comparisonThis branch with compared with the base branch onflow:master commit 888b34b The command Bench tests were run a total of 10 times on each branch. Collapsed results for better readability
|
aa4cc0f
to
804e281
Compare
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.
it's hard to review large sweeping changes to both api and implementation at the same time. next time use the bridge pattern to decouple the changes
attribute.Int64("tx_index", int64(txIndex)), | ||
attribute.Int("col_index", collectionIndex), | ||
) | ||
defer txSpan.End() | ||
|
||
var traceID string |
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.
traceID is uninitialized. rm this is logging below
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.
it is used down there on line 403
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.
logging an uninitialized traceId is pointless. just rm it from line 403 and rm the decl here (same with my other comment)
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 the goal here is twofold:
- for traces that are sampled we want to log traceid, but for ones that are not we do not want to log 000000000000...
- for traces that are not sampled, logging "" is cheaper than creating a whole new logger within an
if isSampled {}
block.
@@ -99,16 +98,14 @@ func (c *Core) OnBlockProposal(originID flow.Identifier, proposal *messages.Bloc | |||
|
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.
traceID is uninitialized. rm declaration and logging below
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.
it is used in the log line on line 124
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.
Looks good to me, just some minor questions
ctx := trace.ContextWithSpan(context.Background(), parentSpan) | ||
_, span := t.tracer.Start(ctx, string(operationName), opts...) | ||
return span |
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.
is ContextWithSpan
automatically label the span relationship as children/parent ?
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.
yep!
ctx := trace.ContextWithSpanContext(context.Background(), parentSpan.SpanContext()) | ||
opts = append(opts, | ||
trace.WithAttributes(attrs...), | ||
trace.WithTimestamp(start), |
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.
same here how do we label it as FollowsFrom label.
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.
do we need to add this label? IIUC there should be no need for additional labels/links given that we have parent-child relationship here.
2853: [FVM] Update cadence to support Executor pattern r=SaveTheRbtz a=SaveTheRbtz Factored out cadence update and test fixes out of #2837 so that we can break circular dependency on #2823 Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> Co-authored-by: Alexey Ivanov <rbtz@dapperlabs.com>
2853: [FVM] Update cadence to support Executor pattern r=SaveTheRbtz a=SaveTheRbtz Factored out cadence update and test fixes out of #2837 so that we can break circular dependency on #2823 Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> 2856: migrate environment to new span api r=pattyshack a=pattyshack Co-authored-by: Alexey Ivanov <rbtz@dapperlabs.com> Co-authored-by: Patrick Lee <patrick.lee@dapperlabs.com>
2853: [FVM] Update cadence to support Executor pattern r=SaveTheRbtz a=SaveTheRbtz Factored out cadence update and test fixes out of #2837 so that we can break circular dependency on #2823 Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> Co-authored-by: Alexey Ivanov <rbtz@dapperlabs.com>
2853: [FVM] Update cadence to support Executor pattern r=SaveTheRbtz a=SaveTheRbtz Factored out cadence update and test fixes out of #2837 so that we can break circular dependency on #2823 Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> 2858: [FVM] cleanup and regenerate mocks r=SaveTheRbtz a=SaveTheRbtz Co-authored-by: Alexey Ivanov <rbtz@dapperlabs.com>
2853: [FVM] Update cadence to support Executor pattern r=SaveTheRbtz a=SaveTheRbtz Factored out cadence update and test fixes out of #2837 so that we can break circular dependency on #2823 Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> Co-authored-by: Alexey Ivanov <rbtz@dapperlabs.com>
Codecov Report
@@ Coverage Diff @@
## master #2823 +/- ##
==========================================
+ Coverage 56.44% 56.48% +0.03%
==========================================
Files 695 695
Lines 63211 63174 -37
==========================================
+ Hits 35678 35681 +3
+ Misses 24577 24538 -39
+ Partials 2956 2955 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
bors merge |
Issue: #2796
OpenTracing spec is deprecated: opentracing/specification#163. Switching to the supported OpenTelemetry implementation.
Note that new tracing code would honor OTEL env vars instead of JAEGER ones, e.g.:
JAEGER_ENDPOINT
->OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
,OTEL_EXPORTER_OTLP_TRACES_INSECURE
, etc(cc: @sjonpaulbrown @haroldsphinx)
New API is slightly slower and consumes more memory but does substantially less allocs (~ -50%):
An example of both extensive tracing and cadence tracing enabled: