Skip to content
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

Xray subsegment #3

Merged
merged 8 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Bug Fixes
* eds: fix the eds cluster update by allowing update on the locality of the cluster endpoints. This behavioral change can be temporarily reverted by setting runtime guard ``envoy.reloadable_features.support_locality_update_on_eds_cluster_endpoints`` to false.
* tls: fix a bug while matching a certificate SAN with an exact value in ``match_typed_subject_alt_names`` of a listener where wildcard ``*`` character is not the only character of the dns label. Example, ``baz*.example.net`` and ``*baz.example.net`` and ``b*z.example.net`` will match ``baz1.example.net`` and ``foobaz.example.net`` and ``buzz.example.net``, respectively.
* xray: fix the AWS X-Ray tracer extension to not sample the trace if ``sampled=`` keyword is not present in the header ``x-amzn-trace-id``.
* xray: fix the AWS X-Ray tracer extension to annotate a child span with ``type=subsegment`` to correctly relate subsegments to a given segment. Previously a subsegment would be treated as an independent segment.
rexnp marked this conversation as resolved.
Show resolved Hide resolved

Removed Config or Runtime
-------------------------
Expand Down
2 changes: 1 addition & 1 deletion source/extensions/tracers/xray/tracer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void Span::injectContext(Tracing::TraceContext& trace_context) {
Tracing::SpanPtr Span::spawnChild(const Tracing::Config& config, const std::string& operation_name,
Envoy::SystemTime start_time) {
auto child_span = std::make_unique<XRay::Span>(time_source_, random_, broker_);
child_span->setName(name());
child_span->setName(operation_name);
child_span->setOperation(operation_name);
child_span->setDirection(Tracing::HttpTracerUtility::toString(config.operationName()));
child_span->setStartTime(start_time);
Expand Down
2 changes: 1 addition & 1 deletion source/extensions/tracers/xray/tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Span : public Tracing::Span, Logger::Loggable<Logger::Id::config> {
}

/**
* Sets the type of the Span. In Xray, an independent subsegment has a type of ``subsegment``.
* Sets the type of the Span. In Xray, an independent subsegment has a type of "subsegment".
* https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-subsegments
*/
void setType(absl::string_view type) { type_ = std::string(type); }
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/tracers/xray/tracer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ TEST_F(XRayTracerTest, ChildSpanHasParentInfo) {
TestUtility::validate(s);
// Hex encoded 64 bit identifier
EXPECT_STREQ("00000000000003e7", s.parent_id().c_str());
EXPECT_EQ(expected_->span_name, s.name().c_str());
EXPECT_EQ(expected_->operation_name, s.name().c_str());
EXPECT_TRUE(xray_parent_span->type().empty());
EXPECT_EQ(Subsegment, s.type().c_str());
EXPECT_STREQ(xray_parent_span->traceId().c_str(), s.trace_id().c_str());
Expand Down