-
Notifications
You must be signed in to change notification settings - Fork 5.4k
otel: create migration mechanism to semantic convention attribute names #45184
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
Open
fcfort
wants to merge
5
commits into
envoyproxy:main
Choose a base branch
from
fcfort:semconv
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+649
−211
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5e4790c
otel: create migration mechanism to semantic convention attribute names
fcfort d92192a
fix xray tracer compilation error
fcfort a88552c
prevent compiler virtual-function hiding warnings
fcfort d760b9c
fix proto formatting and test compilation error
fcfort c624d03
update opt-in api to use separate message and distinct bools
fcfort 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; | |
|
|
||
| // Configuration for the OpenTelemetry tracer. | ||
| // [#extension: envoy.tracers.opentelemetry] | ||
| // [#next-free-field: 9] | ||
| // [#next-free-field: 10] | ||
| message OpenTelemetryConfig { | ||
| // The upstream gRPC cluster that will receive OTLP traces. | ||
| // Note that the tracer drops traces if the server does not read data fast enough. | ||
|
|
@@ -76,4 +76,15 @@ message OpenTelemetryConfig { | |
| // Specifies whether to set the ``service.name`` resource attribute. | ||
| // If not specified, the default is to set this attribute. | ||
| google.protobuf.BoolValue set_service_name_resource_attribute = 8; | ||
|
|
||
| // Configures usage of Semantic Conventions standard tag names. Specifying both options will emit both legacy and semantic convention tags. If not specified, only legacy Envoy tags are emitted. | ||
| message OtelSemconvStabilityOptIn { | ||
| // Emit legacy Envoy attributes. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please describe what is the default value of each of the BoolValue fields. |
||
| google.protobuf.BoolValue emit_legacy_tags = 1; | ||
| // Emit the new stable semantic convention tags. | ||
| google.protobuf.BoolValue emit_semantic_convention_tags = 2; | ||
| } | ||
|
|
||
| // Configures which OpenTelemetry semantic convention stability levels to opt-in to. | ||
| OtelSemconvStabilityOptIn otel_semconv_stability_opt_in = 9; | ||
| } | ||
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,84 @@ | ||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "absl/strings/string_view.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Tracing { | ||
|
|
||
| /** | ||
| * Standardized tracing tag identifiers. | ||
| */ | ||
| enum class TagName { | ||
| Component, | ||
| DbInstance, | ||
| DbStatement, | ||
| DbUser, | ||
| DbType, | ||
| Error, | ||
| HttpMethod, | ||
| HttpStatusCode, | ||
| HttpUrl, | ||
| MessageBusDestination, | ||
| PeerAddress, | ||
| PeerHostname, | ||
| PeerIpv4, | ||
| PeerIpv6, | ||
| PeerPort, | ||
| PeerService, | ||
| SpanKind, | ||
| DownstreamCluster, | ||
| ErrorReason, | ||
| GrpcAuthority, | ||
| GrpcContentType, | ||
| GrpcMessage, | ||
| GrpcPath, | ||
| GrpcStatusCode, | ||
| GrpcTimeout, | ||
| GuidXClientTraceId, | ||
| GuidXRequestId, | ||
| HttpProtocol, | ||
| NodeId, | ||
| RequestSize, | ||
| ResponseFlags, | ||
| ResponseSize, | ||
| RetryCount, | ||
| Status, | ||
| UpstreamAddress, | ||
| UpstreamCluster, | ||
| UpstreamClusterName, | ||
| UserAgent, | ||
| Zone | ||
| }; | ||
|
|
||
| /** | ||
| * Encapsulates a tracing tag default name and its semantic enum identifier. | ||
| */ | ||
| class Tag { | ||
| public: | ||
| Tag(absl::string_view name, TagName id, absl::string_view sem_conv_name = "") | ||
| : name_(name), id_(id), sem_conv_name_(sem_conv_name.empty() ? name : sem_conv_name) {} | ||
|
|
||
| absl::string_view name() const { return name_; } | ||
| TagName id() const { return id_; } | ||
| absl::string_view semConvName() const { return sem_conv_name_; } | ||
|
|
||
| /** | ||
| * Implicit conversion to string_view enables transparent use at legacy call sites | ||
| * that expect string names. | ||
| */ | ||
| operator absl::string_view() const { return name_; } | ||
|
|
||
| bool operator==(const Tag& other) const { | ||
| return id_ == other.id_ && name_ == other.name_ && sem_conv_name_ == other.sem_conv_name_; | ||
| } | ||
|
|
||
| private: | ||
| const std::string name_; | ||
| const TagName id_; | ||
| const std::string sem_conv_name_; | ||
| }; | ||
|
|
||
| } // 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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
If not specified, only legacy Envoy tags are emitted.should probably be added to theotel_semconv_stability_opt_infield description.