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 server attributes to Vertex AI spans #3208

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aabmass
Copy link
Member

@aabmass aabmass commented Jan 24, 2025

Description

Add server.address and server.port semconv attributes to Gen AI spans.

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 new test case for parsing
  • Updated vcr tests

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

@aabmass aabmass force-pushed the vertex-1-serverattr branch from 5e4ff27 to 152fb20 Compare January 24, 2025 20:54
@aabmass aabmass marked this pull request as ready for review January 24, 2025 20:56
@aabmass aabmass requested a review from a team as a code owner January 24, 2025 20:56

return {
server_attributes.SERVER_ADDRESS: parsed.hostname,
server_attributes.SERVER_PORT: parsed.port or 443,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
consider using 443 as a default (unless Vertex has grpc endpoint and uses a different port by default). If virtually all vertex spans would have port 443, let's just default to it and reduce telemetry volume a bit.

We have this clause for azure ai

server.port | int | GenAI server port. [5] | 80; 8080; 443 | Conditionally Required If server.address is set.


https://github.com/open-telemetry/semantic-conventions/blob/d9f3e97a6604ac0b451550c467b3f9cb1d1f492b/docs/gen-ai/azure-ai-inference.md?plain=1#L30

Copy link
Member Author

Choose a reason for hiding this comment

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

If virtually all vertex spans would have port 443

Yes that's the case, and the suggestion makes sense to me. But isn't this special case for azure making server.port incompatible with the "parent type" GenAI span?

Conditionally Required If server.address is set.

Copy link
Contributor

Choose a reason for hiding this comment

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

we can add a note there that system-specific conventions can provide a default value. We can also add a small doc for vertex ai and mention default port there.

Copy link
Contributor

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

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

Left a minor suggestion to not populate port if it's 443, but LGTM

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.

8 participants