Skip to content

Conversation

DylanRussell
Copy link

Description

Add gen_ai_latest_experimental to the Sem Conv stability env var.

Add ContentCapturingMode enum which will get it's value from the OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT env var

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Unit tests

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • [ x] No.

Checklist:

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

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

@DylanRussell DylanRussell requested a review from a team as a code owner August 28, 2025 14:00
@DylanRussell
Copy link
Author

For some reason tox -e ruff was not formatting the new opentelemetry-util-genai package. Does it need to be added to the top level pyproject.toml file ? I tried adding it to a few places in there but ran into some issues..

@emdneto
Copy link
Member

emdneto commented Aug 28, 2025

For some reason tox -e ruff was not formatting the new opentelemetry-util-genai package. Does it need to be added to the top level pyproject.toml file ? I tried adding it to a few places in there but ran into some issues..

what are you getting on your end? Installing ruff==0.6.9 and running it in opentelemetry-util-genai it returns me:

All checks passed!
8 files left unchanged

@DylanRussell
Copy link
Author

When I run tox -e ruff (from the root directory if that matters), it doesn't format the files in genai-utils when it clearly should

@@ -173,6 +174,7 @@ class _StabilityMode(Enum):
HTTP_DUP = "http/dup"
DATABASE = "database"
DATABASE_DUP = "database/dup"
GEN_AI_LATEST = "gen_ai_latest_experimental"
Copy link
Member

Choose a reason for hiding this comment

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

any reason not to spell it as is so there is no hypothetical conflict with future stable flags?

Suggested change
GEN_AI_LATEST = "gen_ai_latest_experimental"
GEN_AI_LATEST_EXPERIMENTAL = "gen_ai_latest_experimental"

try:
return ContentCapturingMode[envvar.upper()]
except KeyError:
raise RuntimeError(
Copy link
Member

Choose a reason for hiding this comment

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

do we want instrumentations to handle it? IMHO, all instrumentations should 1) write a warning 2) continue with default value. So it could make sense to do it in the helper method so it's consistent and none of them need to think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants