-
Notifications
You must be signed in to change notification settings - Fork 106
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
Link workflow run spans together #278
Conversation
4f4e55a
to
6996cc0
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.
On the one hand I like that everything connects but I don't like how otel took over the SDK and I'm not sure we want to interfere with user's spans at all.
Let's discuss this.
packages/worker/src/worker.ts
Outdated
for (const j of rest.jobs) { | ||
if (j.startWorkflow != null) { | ||
const ctx = await extractSpanContextFromHeaders(j.startWorkflow.headers ?? {}); | ||
if (ctx != null && linkedContext == null) { |
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.
Again these are undefined
s not null.
I'll add a lint rule to prohibit using ==
.
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 wouldn't just b/c we still need it for not overly verbose checking of null/undef in protos
fd86014
to
0f3a480
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.
I'm still not convinced we should mix user spans with framework spans.
In case we decide to go that direction this PR is definitely the way to go.
835eb01
to
a1d382c
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.
I'm approving, none of my comments are critical enough to block this PR.
|
||
export const tracer = otel.trace.getTracer('workflow'); | ||
function getTracer(): otel.Tracer { |
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.
What's the reason for this change?
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.
Easier on users. They don't have to remember to call this register function
makeWorkflowExporter, | ||
OpenTelemetryActivityInboundInterceptor, | ||
} from '@temporalio/interceptors-opentelemetry/lib/worker'; | ||
import { OpenTelemetryDependencies } from '@temporalio/interceptors-opentelemetry/lib/workflow'; | ||
|
||
// Un-skip this test and run it by hand to inspect outputted traces | ||
test.skip('Otel spans connected', async (t) => { |
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 much work would it be to run this and add assertions?
Doesn't have to be in this PR but I'd at least track it.
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.
Not a ton. I want to do that as a follow up with fixing the sample.
a1d382c
to
91dc2c8
Compare
* Other various improvements to otel interceptors
91dc2c8
to
3820af5
Compare
bac236e
to
d45fe60
Compare
What was changed
Links all spans in a workflow run to whatever was attached to workflow execution start headers
Why?
Best option available at the moment. Ideally everything would be part of one trace which looks best in Jaeger UI but that is currently not feasible due to open-telemetry/opentelemetry-rust#643
In theory this is maybe the more "right" way to do it, but Jaeger isn't good at displaying this sort of thing due to
jaegertracing/jaeger-ui#662
Checklist
Closes
How was this tested:
Otel manual test
Any docs updates needed?