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

Gateway Trace: Fixes a bug where the ActivityId is being set to Guid.Empty #1720

Merged
merged 4 commits into from
Jul 23, 2020

Conversation

j82w
Copy link
Contributor

@j82w j82w commented Jul 23, 2020

Pull Request Template

Description

This fixes a bug where Trace.CorrelationManager.ActivityId was getting set to Guid.Empty instead of the response Activity Id. This causes any traces to have Guid.Empty instead of the correct value.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

Closing issues

To automatically close an issue: closes #IssueNumber

@j82w j82w added the bug Something isn't working label Jul 23, 2020
@j82w j82w self-assigned this Jul 23, 2020
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Please follow the required format: "[Internal] Category: (Adds|Fixes|Refactors) Description"

Examples:
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fixes null reference when using default(PartitionKey)
[v4] Client Encryption: Refactors code to external project
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.

@j82w j82w changed the title Gateway Trace: Fix a bug where the ActivityId is being set to Guid.Empty Gateway Trace: Fixes a bug where the ActivityId is being set to Guid.Empty Jul 23, 2020
@github-actions github-actions bot dismissed their stale review July 23, 2020 17:54

All good!

@@ -162,10 +162,6 @@ internal static INameValueCollection ExtractResponseHeaders(HttpResponseMessage
HttpResponseMessage responseMessage,
IClientSideRequestStatistics requestStatistics)
{
// ensure there is no local ActivityId, since in Gateway mode ActivityId
// should always come from message headers
Trace.CorrelationManager.ActivityId = Guid.Empty;
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a UT that checks that the ActivityId is not empty?

Copy link
Member

Choose a reason for hiding this comment

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

Can we do a dry run with our gates to see which paths will fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The debug assert that I added verifies it for all tests.

@sivethe
Copy link

sivethe commented Jul 23, 2020

Looks good to me

Copy link
Member

@kirankumarkolli kirankumarkolli left a comment

Choose a reason for hiding this comment

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

Please check the comments.

@j82w j82w merged commit 4c5fb5d into master Jul 23, 2020
@j82w j82w deleted the users/jawilley/bug/activityId branch July 23, 2020 19:54
fnarenji pushed a commit that referenced this pull request Oct 13, 2020
…Empty (#1720)

* Fixed tracing activity id

* Reverted unnecessary changes

* Always uses the local activity id
@ghost
Copy link

ghost commented Dec 15, 2021

Closing due to in-activity, pease feel free to re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants