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

[exporter/awsxray] Add aws sdk http error events to x-ray subsegment and strip prefix AWS.SDK. from aws remote service name #113

Merged
merged 4 commits into from
Oct 12, 2023

Conversation

jknollmeyer
Copy link

Description:

  • Convert individual HTTP error events into exceptions within subsegments for AWS SDK spans.
  • Normalize the service name from awsxray.AWSServiceAttribute attribute by removing the AWS.SDK. prefix (in some aws sdk instrumentation, we have added the prefix to produce metrics with the prefix to clearly indicate the resource). This change ensures that X-Ray backend recognizes standard service names like "DynamoDb", "S3", etc., enabling correct identification of AWS service types.

Link to tracking Issue: NA

Testing: Unit tests are added.

Documentation: NA

This is a copy of a open PR to open-telemetry/opentelemetry-collector-contrib open-telemetry#27232. The goal of is this PR is to directly merge this change instead of waiting for upstream to review + approve

pxaws and others added 3 commits October 11, 2023 10:27
- Define "aws-api" as a const
- Rename some variables in cause.go to make the intended behavior a little more clear
- PR: open-telemetry#27232
- timestamp.String() generates a string like "2023-10-10 01:58:24.675761 +0000 UTC", which is not a standardized format
- Under the hood, it is just calling AsTime().String() https://github.com/open-telemetry/opentelemetry-collector/blob/pdata/v0.66.0/pdata/pcommon/timestamp.go#L36
- Time.String() has the warning "The returned string is meant for debugging; for a stable serialized representation, use t.MarshalText, t.MarshalBinary, or t.Format with an explicit format string." https://pkg.go.dev/time#Time.String
@jknollmeyer jknollmeyer changed the title Add aws http error event cwa dev [exporter/awsxray] Add aws sdk http error events to x-ray subsegment and strip prefix AWS.SDK. from aws remote service name Oct 11, 2023
@lisguo lisguo merged commit 20c10ba into amazon-contributing:aws-cwa-dev Oct 12, 2023
67 of 78 checks passed
lisguo pushed a commit to lisguo/opentelemetry-collector-contrib that referenced this pull request Oct 20, 2023
…and strip prefix AWS.SDK. from aws remote service name (amazon-contributing#113)

* add aws sdk http error events to x-ray subsegment

* Pull Request review changes for open-telemetry#27232

- Define "aws-api" as a const
- Rename some variables in cause.go to make the intended behavior a little more clear
- PR: open-telemetry#27232

* Change the time used for X-Ray exception events to unix epoch time

- timestamp.String() generates a string like "2023-10-10 01:58:24.675761 +0000 UTC", which is not a standardized format
- Under the hood, it is just calling AsTime().String() https://github.com/open-telemetry/opentelemetry-collector/blob/pdata/v0.66.0/pdata/pcommon/timestamp.go#L36
- Time.String() has the warning "The returned string is meant for debugging; for a stable serialized representation, use t.MarshalText, t.MarshalBinary, or t.Format with an explicit format string." https://pkg.go.dev/time#Time.String

* Change the time used for X-Ray exception events to microsecond precision

- This matches X-Ray guidance for timestamps - "Microsecond reoslution is recommended when available" https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-fields

---------

Co-authored-by: Ping Xiang <pinxiang@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants