aws-otel-test-framework
aws-otel-test-framework copied to clipboard
Testing if the propagator is set correctly
Description
In PR on AWS OTel Python https://github.com/aws-observability/aws-otel-python/pull/14 I realized that I had not set the propagator correctly for one of my apps, yet I was still able to pass the validator
-c default-otel-trace-validation.yml --endpoint http://app:8080 --metric-namespace default -t ${{ github.run_id }}-${{ github.run_number }}
command without a problem because my traces were still appearing in X-Ray.
Is it possible to add an automatic test to check if the propagator is set by looking at the headers? The sample apps may need to be updated to do a more complicated setup too.
I remember I verified this manually by setting up CloudWatch Logs to monitor SQS messages sent from a Lambda which lead me to see that
"AWSTraceHeader": "Root=1-5fdd3a92-574ad3d7c4848e12227de280;Parent=018121e92134972f;Sampled=1",
was in fact included in the traces being sent to X-Ray.