-
Notifications
You must be signed in to change notification settings - Fork 141
feat(@temporalio/interceptors-opentelemetry): implement all interceptors #1835
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
base: main
Are you sure you want to change the base?
feat(@temporalio/interceptors-opentelemetry): implement all interceptors #1835
Conversation
dd68680 to
b9e320c
Compare
| /** Default trace header for opentelemetry interceptors */ | ||
| export const TRACE_HEADER = '_tracer-data'; | ||
| /** As in workflow run id */ | ||
| export const RUN_ID_ATTR_KEY = 'run_id'; |
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.
Ruby OTEL uses temporalRunId
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.
Oh? Have you compared with other SDKs, beside Ruby? We'd ideally want cross-SDKs compatibility of OTel tracing, as a customer could be operating different languages within a single Temporal application.
Not saying we'll prioritize, of course, but at the very least we should settle on what names we want to normalize to across the board, so that we eventually converge to something consistent.
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.
- Java:
runId - Python
temporalRunId - Go: Doesn't have these
- PHP: N/A
- .NET:
temporalRunId
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 kept run_id as I wasn't sure if moving to temporalRunId could be considered a breaking change. I could see the case that users have dashboard/queries using run_id that would break if we changed this.
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.
Fair. We may however consider changing these while transitioning to OTel 2. I would mind being breaking at that point.
| }); | ||
|
|
||
| // Skipped as we only care that it compiles | ||
| test.skip('otel interceptors are complete', 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.
I built and checked at the docs and we end up leaking the Required type. Switched to a compile time check that these types satisfy the narrower type, but we only expose implementing the wider interface to users.
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.
Good thinking.
mjameswh
left a 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.
LGTM
What was changed
Add OTEL spans for all interceptors provided by the interface.
Why?
As discovered in #1677 these can end up causing NDE errors if replaying an old history without these interceptors. Adding these all at once makes gating their usage far easier.
Checklist
Closes [Feature Request] Add missing hooks on OTel interceptors #1678
How was this tested:
Doc comments should suffice