Skip to content

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

Merged
richardpark-msft merged 55 commits intoAzure:masterfrom
richardpark-msft:ot-upgrading-step1
Feb 26, 2021
Merged

[telemetry] Centralize (as much as is practical) the creation of spans to ease upgrades#13887
richardpark-msft merged 55 commits intoAzure:masterfrom
richardpark-msft:ot-upgrading-step1

Conversation

@richardpark-msft
Copy link
Copy Markdown
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
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft
Copy link
Copy Markdown
Member Author

/azp run js - storage-queue - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft
Copy link
Copy Markdown
Member Author

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

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@richardpark-msft
Copy link
Copy Markdown
Member Author

/azp run js - storage-queue - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
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!

parent: span.context(),
attributes: {
...spanOptions.attributes,
"az.namespace": args.namespace
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

@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
Copy Markdown
Member Author

Thank you all for your help reviewing! :)

@praveenkuttappan
Copy link
Copy Markdown
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.