-
Notifications
You must be signed in to change notification settings - Fork 5.4k
general tracing context interface #16793
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a4cef7d
new general tracing context interface
b3fcd82
Merge branch 'main' of https://github.com/envoyproxy/envoy into new-t…
0238438
remove un-needed header file temporarily
f085453
fix build file
3f7e374
add comment
f8ff416
some minor update
23c1361
remove ambiguous constructor of lowercasestring
e6cf25d
remove ASSERT
3c61754
Merge branch 'main' of https://github.com/envoyproxy/envoy into new-t…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "envoy/common/pure.h" | ||
|
|
||
| #include "absl/strings/string_view.h" | ||
| #include "absl/types/optional.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Tracing { | ||
|
|
||
| /** | ||
| * Protocol-independent abstraction for traceable stream. It hides the differences between different | ||
| * protocol and provides tracer driver with common methods for obtaining and setting the tracing | ||
| * context. | ||
| */ | ||
| class TraceContext { | ||
| public: | ||
| virtual ~TraceContext() = default; | ||
|
|
||
| /** | ||
| * Get tracing context value by key. | ||
| * | ||
| * @param key The context key of string view type. | ||
| * @return The optional context value of string_view type. | ||
| */ | ||
| virtual absl::optional<absl::string_view> getTraceContext(absl::string_view key) const PURE; | ||
|
|
||
| /** | ||
| * Set new tracing context key/value pair. | ||
| * | ||
| * @param key The context key of string view type. | ||
| * @param val The context value of string view type. | ||
| */ | ||
| virtual void setTraceContext(absl::string_view key, absl::string_view val) PURE; | ||
|
|
||
| /** | ||
| * Set new tracing context key/value pair. The key MUST point to data that will live beyond | ||
| * the lifetime of any traceable stream that using the string. | ||
| * | ||
| * @param key The context key of string view type. | ||
| * @param val The context value of string view type. | ||
| */ | ||
| virtual void setTraceContextReferenceKey(absl::string_view key, absl::string_view val) { | ||
| // The reference semantics of key and value are ignored by default. Derived classes that wish to | ||
| // use reference semantics to improve performance or reduce memory overhead can override this | ||
| // method. | ||
| setTraceContext(key, val); | ||
| } | ||
|
|
||
| /** | ||
| * Set new tracing context key/value pair. Both key and val MUST point to data that will live | ||
| * beyond the lifetime of any traceable stream that using the string. | ||
| * | ||
| * @param key The context key of string view type. | ||
| * @param val The context value of string view type. | ||
| */ | ||
| virtual void setTraceContextReference(absl::string_view key, absl::string_view val) { | ||
| // The reference semantics of key and value are ignored by default. Derived classes that wish to | ||
| // use reference semantics to improve performance or reduce memory overhead can override this | ||
| // method. | ||
| setTraceContext(key, val); | ||
| } | ||
| }; | ||
|
|
||
| } // namespace Tracing | ||
| } // namespace Envoy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.