Skip to content
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

[telemetry] Centralize (as much as is practical) the creation of spans to ease upgrades #13887

Merged
merged 55 commits into from
Feb 26, 2021

Conversation

richardpark-msft
Copy link
Member

The opentelemetry package recently removed a field we were all using to propagate spans (.parent). This ends up breaking an unreasonable number of places because we have multiple copies of the 'createSpan' function in the codebase.

We already had a pretty solid version that would generate a personalized createSpan function for you so I moved that into azure/core-tracing and have changed everyone to call it instead.

For the most part this should be pretty straightforward to review. Apart from centralizing the createSpan calls (and moving code into core-tracing) I've made no code changes.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft
Copy link
Member Author

/azp run js - storage-queue - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft
Copy link
Member Author

/azp run js - storage-file-share - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft
Copy link
Member Author

/azp run js - storage-queue - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@sadasant sadasant left a comment

Choose a reason for hiding this comment

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

For identity this looks good!

sdk/core/core-tracing/src/createSpan.ts Show resolved Hide resolved
parent: span.context(),
attributes: {
...spanOptions.attributes,
"az.namespace": args.namespace
Copy link
Contributor

Choose a reason for hiding this comment

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

If we moved this to the original spanOptions, would we need to call span.setAttribute on our span object?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd have to try that out (I reserve that for another PR) but that makes logical sense to me. I moved this code so there might be some subtle behavior that I'm not aware of.

Copy link
Contributor

@EmmaZhu EmmaZhu left a 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.

@richardpark-msft richardpark-msft merged commit 82c42a2 into Azure:master Feb 26, 2021
@richardpark-msft richardpark-msft deleted the ot-upgrading-step1 branch February 26, 2021 05:36
@richardpark-msft
Copy link
Member Author

Thank you all for your help reviewing! :)

@praveenkuttappan
Copy link
Member

/azp run js - keyvault - ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.