-
Notifications
You must be signed in to change notification settings - Fork 63
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
Fix JS HTTP template #611
Fix JS HTTP template #611
Conversation
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.
It's not too important, but maybe you can find out why we needed this response
before?
Can you also confirm that the X-Ray UI Console has the look and experience we expect?
That's why changing the template is kind of risky. Because although we can fix the tests, we need to check and make sure the backend isn't using this for something important on their end.
Response was always empty as shown in this PR. After we have added this template ADOT JS integration tests were never successful. Not sure what do you mean by X-Ray UI console has the look and experience? FYI, validation templates are only being used by test framework and not X-Ray backend. I think they are very safe to change to address integration testing needs. Thanks for approving this. |
@vasireddy99 can you take a look as well? we might need |
Sure but I think we should figure out why. The tests were passing with this empty dictionary before. I meant you should check OTel JS upstream to see if there were any changes to why this changed because we didn't change the template so upstream must have changed.
Are you sure? That PR was merged Dec 2020, but the tests succeeded 5 moths ago Nov 2021.
I mean the X-Ray UI for the Service Graph, Service Timeline, for a given trace. Check out this issue to learn how upstream changing they way they instrumented affected the X-Ray UI console experience. It degraded it.
Yup they are not being used by the backend, but we set up these templates so that we can guarantee some attributes will arrive at the X-Ray backend if customers use OTel JS. It's our responsibility to make sure they are set, not the X-Ray backend's responsibility that's why they don't use it. If it breaks then it will break on the backend and they won't realize it. That's why these tests have to check it.
I agree it's a small change. But you can enhance the PR description by posting screenshots of the X-Ray UI to give confidence that this is the right change. |
I'm not sure this is the right change. It looks like the failing tests have more data in the
|
Yeah, the upstream probably started populating response fields so we should definitely add some of the fields like |
Yep. I think you're right I was confusing years. I have made the change to add |
Opened the issue to use only default template: #613. I don't want to add this change in this PR for better tracking and visibility. Also, I want to make sure first that this change really fixes JS integration test failures before making other enhancements. |
@@ -21,6 +22,7 @@ | |||
"method": "GET" | |||
}, | |||
"response": { | |||
"status": 200 |
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.
Is this correct? Doesn't this get a 301 to https://...
?
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.
yep. this should be 301
. Just tested the sample app locally.
{
"Id": "1-62448ed9-4733ff1a38db832ba446bbb7",
"Duration": 0.075,
"LimitExceeded": false,
"Segments": [
{
"Id": "20130a68ea1b0408",
"Document": {
"id": "20130a68ea1b0408",
"name": "aws-otel-integ-test",
"start_time": 1648660185.9195466,
"trace_id": "1-62448ed9-4733ff1a38db832ba446bbb7",
"end_time": 1648660185.990404,
"fault": false,
"error": false,
"throttle": false,
"http": {
"request": {
"url": "http://localhost:8080/outgoing-http-call",
"method": "GET",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36",
"client_ip": "127.0.0.1"
},
"response": {
"status": 200,
"content_length": 0
}
},
"aws": {
"xray": {
"auto_instrumentation": false,
"sdk_version": "0.25.0",
"sdk": "opentelemetry for nodejs"
}
},
"metadata": {
"default": {
"otel.resource.telemetry.sdk.name": "opentelemetry",
"net.transport": "ip_tcp",
"http.flavor": "1.1",
"http.route": "/outgoing-http-call",
"http.status_text": "OK",
"otel.resource.service.name": "aws-otel-integ-test",
"otel.resource.telemetry.sdk.language": "nodejs",
"net.host.ip": "127.0.0.1",
"otel.resource.telemetry.sdk.version": "0.25.0"
}
},
"subsegments": [
{
"id": "584849890004c9f8",
"name": "aws.amazon.com:80",
"start_time": 1648660185.9197578,
"end_time": 1648660185.9947398,
"fault": false,
"error": false,
"throttle": false,
"http": {
"request": {
"url": "http://aws.amazon.com/",
"method": "GET",
"client_ip": "18.65.225.66"
},
"response": {
"status": 301,
"content_length": 0
}
},
"aws": {
"xray": {
"auto_instrumentation": false,
"sdk_version": "0.25.0",
"sdk": "opentelemetry for nodejs"
}
},
"metadata": {
"default": {
"net.transport": "ip_tcp",
"http.flavor": "1.1",
"http.response_content_length_uncompressed": 183,
"http.status_text": "MOVED PERMANENTLY"
}
},
"namespace": "remote"
}
]
}
},
{
"Id": "0d16cdad11ac4230",
"Document": {
"id": "0d16cdad11ac4230",
"name": "aws.amazon.com:80",
"start_time": 1648660185.9197578,
"trace_id": "1-62448ed9-4733ff1a38db832ba446bbb7",
"end_time": 1648660185.9947398,
"parent_id": "584849890004c9f8",
"inferred": true,
"http": {
"request": {
"url": "http://aws.amazon.com/",
"method": "GET",
"client_ip": "18.65.225.66"
},
"response": {
"status": 301,
"content_length": 0
}
}
}
}
]
}
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.
I suppose this raises the question of why there isn't a segment for following the redirect, but that can be investigated separately from this PR.
@Aneurysm9 can you also merge this PR? I don't think I have permissions to merge this PR. |
Description:
Bug:
original JS HTTP template has empty http response where as the retrieved trace would definitely have a non empty response.
Fix:
add
Status
http response fields in JS HTTP template to have parity with other languages template.JS integration tests are failing since in expected template we are trying to compare against
[0].http.response={},
which is never present in retrieved traceLink to tracking Issue:
https://github.com/aws-observability/aws-otel-js/runs/5041312760?check_suite_focus=true#step:8:182
Testing:
Documentation: