Skip to content

tracing: inject tracing context in router#5661

Merged
mattklein123 merged 2 commits intoenvoyproxy:masterfrom
DataDog:cgilmour/fix-5504
Jan 21, 2019
Merged

tracing: inject tracing context in router#5661
mattklein123 merged 2 commits intoenvoyproxy:masterfrom
DataDog:cgilmour/fix-5504

Conversation

@cgilmour
Copy link
Copy Markdown
Contributor

Description:

This moves the moment that headers related to tracing are injected
in proxied requests.
More details in issue #5504 and the earlier PR #5529 that didn't fix this correctly

Signed-off-by: Caleb Gilmour caleb.gilmour@datadoghq.com

Risk Level: Low
Testing: unit tests and E2E with

  • tracing disabled
  • datadog tracer with healthchecks from "front-end" to "service1"
  • zipkin tracer

Docs Changes: N/A
Release Notes: N/A

Fixes #5504

This moves the moment that headers related to tracing are injected
in downstream requests.

Fixes envoyproxy#5504

Signed-off-by: Caleb Gilmour <caleb.gilmour@datadoghq.com>
@mattklein123 mattklein123 self-assigned this Jan 19, 2019
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this. A comment to get started.

/wait


Http::TestHeaderMapImpl headers;
HttpTestUtility::addDefaultHeaders(headers);
EXPECT_CALL(callbacks_, activeSpan()).Times(1);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These type of accessor expectations aren't really useful. Since callbacks_ isn't a NiceMock, I would just do something like this in the test constructor.

EXPECT_CALL(callbacks_, activeSpan()).WillRepeatedly(Return(...))

Then, some test should actually make sure the span has injectContext called on it with an expectation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review!

Yup, they were added to appease the existing code / RouterTest constructor
I think the value it returns is already handled here

I'll see what I can do to tidy it up and making it more precisely check that injectContext was called.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes understood, my suggestion is how to still use a strict mock and appease it for this type of case, then you don't need to repeat it in every test which isn't useful.

Signed-off-by: Caleb Gilmour <caleb.gilmour@datadoghq.com>
@cgilmour
Copy link
Copy Markdown
Contributor Author

Updated based on the suggestion from @mattklein123
The coverage test failure seems to be the CI runner being out of memory.

test/integration/xds_integration_test_base.cc:86:1: fatal error: error writing to /tmp/ccTaHsmy.s: Cannot allocate memory
 } // namespace Envoy
 ^
compilation terminated.

@mattklein123
Copy link
Copy Markdown
Member

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🔨 rebuilding ci/circleci: coverage (failed build)

🐱

Caused by: a #5661 (comment) was created by @mattklein123.

see: more, trace.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks this looks perfect. @objectiser @rnburn any concerns?

@mattklein123 mattklein123 merged commit 253fce4 into envoyproxy:master Jan 21, 2019
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Jan 24, 2019
This moves the moment that headers related to tracing are injected
in downstream requests.

Fixes envoyproxy#5504

Signed-off-by: Caleb Gilmour <caleb.gilmour@datadoghq.com>

Signed-off-by: Dan Zhang <danzh@google.com>
@cgilmour cgilmour deleted the cgilmour/fix-5504 branch January 30, 2019 22:12
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
This moves the moment that headers related to tracing are injected
in downstream requests.

Fixes envoyproxy#5504

Signed-off-by: Caleb Gilmour <caleb.gilmour@datadoghq.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

datadog tracer samples heathchecks

3 participants