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

Add Patching Mechanism with AWS SDK telemetry improvements #13

Merged
merged 11 commits into from
Aug 15, 2024

Conversation

jj22ee
Copy link
Contributor

@jj22ee jj22ee commented Aug 8, 2024

Issue #, if available:

Description of changes:

  1. aws-attribute-keys.ts:

    • Update values for keys: AWS_BUCKET_NAME, AWS_QUEUE_URL, AWS_QUEUE_NAME, AWS_STREAM_NAME, AWS_TABLE_NAME in order to match the actual attribute collected from AWS SDK auto-instrumentation
  2. aws-metric-attribute-generator.ts:

  3. aws-opentelemetry-configurator.ts:

    • Takes and sets instrumentations in constructor.
  4. instrumentation-patch.ts:

    • Applies patches for AWS SDK Instrumentation
  5. register.ts:

    • Applies patches from (4.) by default, unless AWS_APPLY_PATCHES env var is not 'true'

The following files are copied from upstream:

aws-distro-opentelemetry-node-autoinstrumentation/src/patches/aws/services/ServiceExtension.ts

The following files are being contributed to upstream:
See: open-telemetry/opentelemetry-js-contrib#2361

aws-distro-opentelemetry-node-autoinstrumentation/src/patches/aws/services/kinesis.ts
aws-distro-opentelemetry-node-autoinstrumentation/src/patches/aws/services/s3.ts

Testing:

  • Add unit tests

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jj22ee jj22ee requested a review from srprash August 8, 2024 19:58
@jj22ee jj22ee requested a review from a team as a code owner August 8, 2024 19:58
@thpierce
Copy link

Need more testing done - show that this works by generating spans & metrics that have the attributes in question please.

@jj22ee
Copy link
Contributor Author

jj22ee commented Aug 14, 2024

show that this works by generating spans & metrics that have the attributes in question please.

Added "integration/contract test" to test patched S3/Kinesis/SQS in test/register.patch.test.ts

@thpierce
Copy link

Added "integration/contract test" to test patched S3/Kinesis/SQS in test/register.patch.test.ts

See my comment on integ tests - I'm not crazy about having them. I was really more referring to manual test results, though yes, they are sufficient for addressing my earlier comment.

@jj22ee jj22ee merged commit a83c981 into main Aug 15, 2024
6 checks passed
@jj22ee jj22ee deleted the adot-js-patching-mechanism-pr branch August 15, 2024 19:45
pxaws pushed a commit that referenced this pull request Nov 27, 2024
*Issue #, if available:*
See context in:

#13 (comment)

The `register.patch.test.ts` is being removed in favor of the existing
contract tests for AWS SDK patches.

*Description of changes:*
Remove `register.patch.test.ts` and associated resources.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
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.

2 participants