tracing: Allow setting some optional segment fields in X-Ray traces (#12618)

In the closed-source implementation of the AWS X-Ray tracer extension
there was additional span metadata that was hard-coded for the AWS App Mesh
service. This was expectedly removed from the implementation that was
upstreamed but there was a miss in adding an API to re-add this metadata
to spans.

Signed-off-by: Scott LaVigne <lavignes@amazon.com>

Mirrored from https://github.com/envoyproxy/envoy @ 64731cece4fb1c7a63251007e3f8bf319d1cb895
master-ci-test
data-plane-api(CircleCI) 4 years ago
parent 46bf0cb139
commit 31aa7c7afd
  1. 16
      envoy/config/trace/v3/xray.proto
  2. 19
      envoy/extensions/tracers/xray/v4alpha/xray.proto

@ -5,6 +5,8 @@ package envoy.config.trace.v3;
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/base.proto";
import "google/protobuf/struct.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
@ -23,6 +25,15 @@ message XRayConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.trace.v2alpha.XRayConfig";
message SegmentFields {
// The type of AWS resource, e.g. "AWS::AppMesh::Proxy".
string origin = 1;
// AWS resource metadata dictionary.
// See: `X-Ray Segment Document documentation <https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-aws>`__
google.protobuf.Struct aws = 2;
}
// The UDP endpoint of the X-Ray Daemon where the spans will be sent.
// If this value is not set, the default value of 127.0.0.1:2000 will be used.
core.v3.SocketAddress daemon_endpoint = 1;
@ -35,4 +46,9 @@ message XRayConfig {
// `X-Ray SDK documentation
// <https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go-configuration.html#xray-sdk-go-configuration-sampling>`_
core.v3.DataSource sampling_rule_manifest = 3;
// Optional custom fields to be added to each trace segment.
// see: `X-Ray Segment Document documentation
// <https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html>`__
SegmentFields segment_fields = 4;
}

@ -5,6 +5,8 @@ package envoy.extensions.tracers.xray.v4alpha;
import "envoy/config/core/v4alpha/address.proto";
import "envoy/config/core/v4alpha/base.proto";
import "google/protobuf/struct.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
@ -20,6 +22,18 @@ option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSIO
message XRayConfig {
option (udpa.annotations.versioning).previous_message_type = "envoy.config.trace.v3.XRayConfig";
message SegmentFields {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.trace.v3.XRayConfig.SegmentFields";
// The type of AWS resource, e.g. "AWS::AppMesh::Proxy".
string origin = 1;
// AWS resource metadata dictionary.
// See: `X-Ray Segment Document documentation <https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-aws>`__
google.protobuf.Struct aws = 2;
}
// The UDP endpoint of the X-Ray Daemon where the spans will be sent.
// If this value is not set, the default value of 127.0.0.1:2000 will be used.
config.core.v4alpha.SocketAddress daemon_endpoint = 1;
@ -32,4 +46,9 @@ message XRayConfig {
// `X-Ray SDK documentation
// <https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go-configuration.html#xray-sdk-go-configuration-sampling>`_
config.core.v4alpha.DataSource sampling_rule_manifest = 3;
// Optional custom fields to be added to each trace segment.
// see: `X-Ray Segment Document documentation
// <https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html>`__
SegmentFields segment_fields = 4;
}

Loading…
Cancel
Save