Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hairyhenderson
Copy link
Member

What is this feature?

Adds support for setting multiple OTel propagators.

Why do we need this feature?

When migrating from Jaeger to W3C propagation with OTel, it's helpful to be support both propagation formats simultaneously, so as not to break any traces.

Who is this feature for?

Anyone operating and monitoring Grafana

Which issue(s) does this PR fix?:

Fixes #61198

Special notes for your reviewer:

Signed-off-by: Dave Henderson [email protected]

@hairyhenderson hairyhenderson added this to the 9.4.0 milestone Jan 9, 2023
@hairyhenderson hairyhenderson self-assigned this Jan 9, 2023
@grafanabot grafanabot added type/docs Flags the technical writing team for documentation support; auto adds to org-wide docs project pr/external This PR is from external contributor labels Jan 9, 2023
@hairyhenderson hairyhenderson force-pushed the hairyhenderson/otel-tracing-support-multi-propagators branch from 8e84b2a to a7af9be Compare January 12, 2023 14:18
@grafanabot grafanabot removed this from the 9.4.0 milestone Feb 3, 2023
@grafanabot
Copy link
Contributor

This pull request was removed from the 9.4.0 milestone because 9.4.0 is currently being released.

@grafanabot
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@grafanabot grafanabot added the stale Issue with no recent activity label Mar 6, 2023
@bboreham
Copy link
Contributor

I want to use this change; I'm going to see if I can fix the tests.

@hairyhenderson
Copy link
Member Author

Thanks @bboreham 🙇‍♂️ - I got pulled away to other things and couldn't focus on this 😞 (and then it turned out I don't actually need this). Let me know if you need anything from me!

@bboreham
Copy link
Contributor

Here's one way to change it so the tests pass: 40ef798

@CLAassistant
Copy link

CLAassistant commented Mar 14, 2023

CLA assistant check
All committers have signed the CLA.

@hairyhenderson
Copy link
Member Author

I'll rebase if this passes!

@hairyhenderson hairyhenderson force-pushed the hairyhenderson/otel-tracing-support-multi-propagators branch from 32e9bdf to fe73882 Compare March 14, 2023 18:58
@hairyhenderson hairyhenderson marked this pull request as ready for review March 14, 2023 19:52
@hairyhenderson hairyhenderson requested review from a team and chri2547 as code owners March 14, 2023 19:52
@hairyhenderson hairyhenderson requested review from andresmgot, marefr, mildwonkey, suntala and yangkb09 and removed request for a team March 14, 2023 19:52
Copy link
Contributor

@chri2547 chri2547 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs suggestions added. Please make sure I didn't change the technical meaning. Please request re-review when you are done. Thanks!

@hairyhenderson hairyhenderson requested a review from chri2547 March 14, 2023 20:45
@hairyhenderson hairyhenderson added the no-backport Skip backport of PR label Mar 14, 2023
Copy link
Contributor

@chri2547 chri2547 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs look good, thank you! I approve (soft approve).

@hairyhenderson hairyhenderson changed the title tracing: Support multiple OTel propagators Tracing: Support multiple OTel propagators Mar 14, 2023
@hairyhenderson
Copy link
Member Author

@chri2547 can you un-request changes? this is still blocked by #61199 (review)

@hairyhenderson hairyhenderson added this to the 9.5.0 milestone Mar 14, 2023
@hairyhenderson
Copy link
Member Author

CI is failing with:

[warn] Code style issues found in the above file. Forgot to run Prettier?

(I guess this is from 3d448b6) I'll take a look tomorrow

@grafanabot grafanabot removed the stale Issue with no recent activity label Mar 15, 2023
@bboreham
Copy link
Contributor

Today I realised there is an existing function TraceIDFromContext() which might be used to do the same thing I did with TradeIDString(). This probably needs someone with context on the tracing package to weigh in.

@marefr marefr requested a review from sakjur March 21, 2023 12:13
@marefr
Copy link
Contributor

marefr commented Mar 21, 2023

@hairyhenderson sync with main should do the trick I believe.

@hairyhenderson
Copy link
Member Author

@marefr yup - was trying to commit, but the precommit hook was broken:

file:///Users/hairyhenderson/go/src/github.com/grafana/grafana/.yarn/cache/lint-staged-npm-13.1.2-6f136d35c9-f854ad5c88.zip/node_modules/lint-staged/lib/index.js:113
    if (runAllError?.ctx?.errors) {
                    ^

SyntaxError: Unexpected token '.'
    at Loader.moduleStrategy (internal/modules/esm/translators.js:140:18)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

I think I've got it now.

@hairyhenderson hairyhenderson force-pushed the hairyhenderson/otel-tracing-support-multi-propagators branch from 3d448b6 to c7462f5 Compare March 21, 2023 12:16
@hairyhenderson
Copy link
Member Author

Today I realised there is an existing function TraceIDFromContext() which might be used to do the same thing I did with TradeIDString(). This probably needs someone with context on the tracing package to weigh in.

Given that TraceIDFromContext requires a context, and TraceIDString is only used in tests, IMO it's fine as-is.

@hairyhenderson
Copy link
Member Author

Given that TraceIDFromContext requires a context, and TraceIDString is only used in tests, IMO it's fine as-is.

I spoke too soon - we have a context indeed, so using tracing.TraceIDFromContext is simpler - I've made that change!

hairyhenderson and others added 5 commits March 23, 2023 08:36
This method will be useful elsewhere if we want to log the trace ID.
Co-authored-by: Christopher Moyer <[email protected]>
Signed-off-by: Dave Henderson <[email protected]>
@hairyhenderson hairyhenderson force-pushed the hairyhenderson/otel-tracing-support-multi-propagators branch from f3137a1 to 1fd7807 Compare March 23, 2023 12:37
@hairyhenderson
Copy link
Member Author

@marefr @bboreham PTAL 🙏

Copy link
Contributor

@marefr marefr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add to changelog area/backend enterprise-failed no-backport Skip backport of PR pr/external This PR is from external contributor type/docs Flags the technical writing team for documentation support; auto adds to org-wide docs project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to configure composite OTel propagators

6 participants