Skip to content

Capture server attributes for botocore API calls #3448

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

Merged
merged 9 commits into from
Apr 30, 2025

Conversation

SrdjanLL
Copy link
Contributor

Description

  • Add server.* span attributes to all botocore calls.
  • server.address: endpoint name (eg. iam.amazonaws.com, ec2.us-west-2.amazonaws.com)
  • server.port (eg. 443 (default) or custom if specified)
  • These attributes are required for Generative AI spans (see semantic conventions).

Related issues:

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added unit tests to cover new attribute generation for different test scenarios: regional endpoints, global endpoints and custom endpoints (such as S3 endpoints).
  • Smoke-tested bedrock instrumentation and with span inspection using local otelcol

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Copy link

linux-foundation-easycla bot commented Apr 28, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@SrdjanLL SrdjanLL requested a review from a team as a code owner April 28, 2025 12:27
Copy link
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These attributes are required for Generative AI spans (see semantic conventions).

These are recommended not required. Said that I remember the semconv to pass the port only if it's different than 443 (and openai-v2 matches that) but I don't see it in the published doc so LGTM.

Copy link
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the attributes to asserts in the bedrock utils tests to check they are working fine there

@SrdjanLL
Copy link
Contributor Author

@xrmx - I've added server/port assertions for the bedrock API calls as well. Thanks for pointing that out.

@SrdjanLL SrdjanLL requested a review from xrmx April 28, 2025 13:39
@SrdjanLL SrdjanLL requested a review from xrmx April 29, 2025 08:54
@xrmx xrmx enabled auto-merge (squash) April 30, 2025 14:22
@xrmx xrmx merged commit e6869cd into open-telemetry:main Apr 30, 2025
969 of 970 checks passed
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