Repository navigation
xray: aws xray tracer span data bug fix - #17171
Conversation
Update xray segment data to contain error, fault & throttle tag in the "Errors and exceptions" section as per the xray documentation at https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html Signed-off-by: Sunil Narasimhamurthy <[email protected]>
Signed-off-by: Sunil Narasimhamurthy <[email protected]>
throttle is seen Signed-off-by: Sunil Narasimhamurthy <[email protected]>
|
/assign-from @envoyproxy/first-pass-reviewers |
|
@envoyproxy/first-pass-reviewers assignee is @tonya11en |
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Sunil Narasimhamurthy <[email protected]>
Signed-off-by: Sunil Narasimhamurthy <[email protected]>
|
/retest |
|
Retrying Azure Pipelines: |
|
/retest |
|
Retrying Azure Pipelines: |
|
Hi @tonya11en this PR is ready for review. Thank you for your time. |
|
Sorry, I'm on vacation until 7/12. I can take a look as soon as I get back. |
|
Sorry about that, no hurry. This can wait. |
| string origin = 9; | ||
| string parent_id = 6; | ||
| google.protobuf.Struct aws = 10; | ||
| bool error = 11; |
There was a problem hiding this comment.
Can you add some 1-liner comments explaining what each message is. I know there's a link to the documentation there, but it's still seems appropriate to have some information here.
| auto on_send = [&](const std::string& json) { | ||
| ASSERT_FALSE(json.empty()); | ||
| daemon::Segment s; | ||
| MessageUtil::loadFromJson(json, s, ProtobufMessage::getNullValidationVisitor()); | ||
| ASSERT_FALSE(s.trace_id().empty()); | ||
| ASSERT_FALSE(s.id().empty()); | ||
| ASSERT_TRUE(s.parent_id().empty()); | ||
| ASSERT_STREQ(expected_span_name, s.name().c_str()); | ||
| ASSERT_STREQ(expected_origin_name, s.origin().c_str()); | ||
| ASSERT_STREQ(expected_aws_key_value, s.aws().fields().at("key").string_value().c_str()); | ||
| ASSERT_STREQ(expected_http_method, | ||
| s.http().request().fields().at("method").string_value().c_str()); | ||
| ASSERT_STREQ(expected_http_url, s.http().request().fields().at("url").string_value().c_str()); | ||
| ASSERT_STREQ( | ||
| expected_user_agent, | ||
| s.http().request().fields().at(Tracing::Tags::get().UserAgent).string_value().c_str()); | ||
| ASSERT_FALSE(s.fault()); /*server error*/ | ||
| ASSERT_TRUE(s.error()); /*client error*/ | ||
| ASSERT_TRUE(s.throttle()); /*request throttled*/ | ||
| ASSERT_DOUBLE_EQ(expected_status_code, | ||
| s.http().response().fields().at(Tracing::Tags::get().Status).number_value()); | ||
| }; |
There was a problem hiding this comment.
Is it possible to dedup this across some of the tests? Seems like you can capture a struct with the expected values and pass it into a func with all the common assertions.
Also, why ASSERT vs. EXPECT?
There was a problem hiding this comment.
There were 6 checked that was common across all these functions. As you suggested I created a func and extracted out the repeated code.
Yes actually EXPECT makes more sense, and I have transformed most of the ASSERT into EXPECT.
|
|
||
| auto on_send = [&](const std::string& json) { | ||
| ASSERT_FALSE(json.empty()); | ||
| daemon::Segment s; |
There was a problem hiding this comment.
Does it make sense to also validate this proto?
There was a problem hiding this comment.
Yes true, I added validate on this proto in the new revision. Thanks for this tip.
… code Signed-off-by: Sunil Narasimhamurthy <[email protected]>
tonya11en
left a comment
There was a problem hiding this comment.
thanks and sorry for the delay
|
Hi @lizan, can you help merge this PR? |
Update xray segment data to contain error, fault & throttle tag in the "Errors and exceptions" section as per the xray documentation at https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html Signed-off-by: Sunil Narasimhamurthy <[email protected]>
Commit Message: fix AWS X-Ray tracer bug where span error was not properly reported.
Additional Description: Remove 'error' tag in the trace span from getting reported inside annotations section of xray tracer segment data and instead move it inside "Errors and faults" section as per the xray documentation. Bug description available at aws/aws-app-mesh-roadmap#344 .
Risk Level: Low
Testing: Unit tests added
Docs Changes: No
Release Notes: Bug info
Platform Specific Features: No