Skip to content

skywalking: use upstream host address as addressUsedAtClient in propagation header#20367

Merged
mattklein123 merged 14 commits intoenvoyproxy:mainfrom
Shikugawa:span-stream-info
May 5, 2022
Merged

skywalking: use upstream host address as addressUsedAtClient in propagation header#20367
mattklein123 merged 14 commits intoenvoyproxy:mainfrom
Shikugawa:span-stream-info

Conversation

@Shikugawa
Copy link
Copy Markdown
Member

@Shikugawa Shikugawa commented Mar 16, 2022

Signed-off-by: Shikugawa rei@tetrate.io

Commit Message: skywalking: use remote IP address as addressUsedAtClient in propagation header
Additional Description: In Apache SkyWalking, the request pathname may be used as the span name, or the remote IP address may be set in propagation.
Risk Level: Low
Testing: Unit
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@Shikugawa
Copy link
Copy Markdown
Member Author

/assign-from @envoyproxy/envoy-maintainers

@repokitteh-read-only
Copy link
Copy Markdown

@envoyproxy/envoy-maintainers assignee is @KBaichoo

🐱

Caused by: a #20367 (comment) was created by @Shikugawa.

see: more, trace.

Copy link
Copy Markdown
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

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

//test/extensions/tracers/xray:xray_test fails to build btw

Copy link
Copy Markdown
Member

@wbpcode wbpcode 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 API change has big impact. So I think we need to think about it more carefully. I am thinking if there are some others method to achieve your target.

For the startSpan, the request path can be obtained from TraceContext and upstream address is unnecessary for the EntrySpan of SkyWalking.

May be we can update injectContext to add new parameter to provides upstream info. The ExitSpan of SkyWalking can get path and also remote address here.

This API will be more natural, because injectContext is called when the tracing info is propagated upstream, and a parameter providing upstream info is more reasonable.

@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Mar 22, 2022

/assign

@Shikugawa
Copy link
Copy Markdown
Member Author

Thanks. This API change has big impact. So I think we need to think about it more carefully. I am thinking if there are some others method to achieve your target.

For the startSpan, the request path can be obtained from TraceContext and upstream address is unnecessary for the EntrySpan of SkyWalking.

May be we can update injectContext to add new parameter to provides upstream info. The ExitSpan of SkyWalking can get path and also remote address here.

This API will be more natural, because injectContext is called when the tracing info is propagated upstream, and a parameter providing upstream info is more reasonable.

@wbpcode Thank you for your review. I also concerned about the impact of this change. Thus I considered to add new parameter in injectContext. But it will cause bloatedness there if we will need to inject additional parameter. This is why I used stream_info here. But as you pointed out, the timing of creation of child span will be perturbed with this change. Thus your proposal will be better, I think. Let me consider.

…on header

Signed-off-by: Shikugawa <rei@tetrate.io>
@Shikugawa Shikugawa changed the title tracing: set stream_info to utilize generic info in span skywalking: use remote IP address as addressUsedAtClient in propagation header Mar 22, 2022
@Shikugawa
Copy link
Copy Markdown
Member Author

@wbpcode @KBaichoo Fixed with your opinions. PTAL.

Copy link
Copy Markdown
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

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

thanks, seems like there are still build failures

Copy link
Copy Markdown
Member

@wbpcode wbpcode left a comment

Choose a reason for hiding this comment

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

It seems that there are still some issues that have not been resolved. The problem seems to be more complicated than expected. How to get the correct upstream when injectContext? It seems that only UpstreamRequest can get the target upstream correctly. 🤔

…stream-info

Signed-off-by: Shikugawa <rei@tetrate.io>
Signed-off-by: Shikugawa <rei@tetrate.io>
Signed-off-by: Shikugawa <rei@tetrate.io>
Signed-off-by: Shikugawa <rei@tetrate.io>
Signed-off-by: Shikugawa <rei@tetrate.io>
Signed-off-by: Shikugawa <rei@tetrate.io>
@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Mar 30, 2022

It looks like the work is almost done. 😄 There are still some problems with CI, some test cases are not fixed.

/wait

@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Apr 11, 2022

Hi, @Shikugawa, although we don't get a conclusion of #20454 , we still can complete this work first. And then we can discusss the method about how to inject peer address continuely in the #20454.

@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented May 2, 2022

After discussion with @wu-sheng, I will pick this up. Thanks for all your great contributions @Shikugawa.

Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
wbpcode
wbpcode previously approved these changes May 4, 2022
Copy link
Copy Markdown
Member

@wbpcode wbpcode left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks cc @Shikugawa.

cc @mattklein123 could you take a look for the final pass when you have free time? Thanks.

@wbpcode wbpcode changed the title skywalking: use remote IP address as addressUsedAtClient in propagation header skywalking: use upstream host address as addressUsedAtClient in propagation header May 4, 2022
@mattklein123 mattklein123 self-assigned this May 4, 2022
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.

Does this need a small release note? Otherwise LGTM, thanks.

/wait

wbpcode added 3 commits May 5, 2022 00:55
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
Signed-off-by: wbpcode <wangbaiping@corp.netease.com>
@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented May 5, 2022

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20367 (comment) was created by @wbpcode.

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!

@mattklein123 mattklein123 merged commit bd69ad4 into envoyproxy:main May 5, 2022
mum4k pushed a commit to envoyproxy/nighthawk that referenced this pull request May 11, 2022
- Update bazel/repositories.bzl
- Update .bazelrc. Uncommented platform_mappings override as it is necessary for nighthawk to build. 
- Update .bazelversion
- Update stream_decoder with updated interface (envoyproxy/envoy#20367). Setting to nullptr is fine as an appropriate default is set if nullptr is passed. In addition, tracing is not a large concern for nighthawk.
- Changes due to (envoyproxy/envoy#20862). Due to cipher deprecation, there is only 1 RSA and DSA cipher default left. As a result, to preserve testing coverage, the appropriate certs need to be loaded to the nighthawk instances to test multiple ciphers. As a result, created a new nighthawk configuration file and refactored integration tests. 
- Updated update process documentation to create PR as last step.
- Temporarily disable the `clang-tidy` CI step until #849 gets resolved.

Signed-off-by: tomjzzhang <4367421+tomjzzhang@users.noreply.github.com>
ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
…gation header (envoyproxy#20367)

Signed-off-by: Shikugawa <rei@tetrate.io>
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.

5 participants