Skip to content

Conversation

keith-decker
Copy link
Collaborator

Description

Creation of tools for GenAI utils for generating spans for inference calls.

Fixes # (issue)

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

  • Unit Test created to show invocation of llm_start and llm_stop. Checks for basic span attributes

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

@keith-decker keith-decker marked this pull request as draft August 17, 2025 23:25
) -> LLMInvocation:
with self._lock:
invocation = self._llm_registry.pop(run_id)
invocation.end_time = time.time()

Choose a reason for hiding this comment

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

this isn't thread safe all operations should be within the lock. The same for emitter.emit and same for emitter.init

start_time: float
request_model: Optional[str] = None
system: Optional[str] = None
db_system: Optional[str] = None

Choose a reason for hiding this comment

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

what's this used for?


def _message_to_event(message, system, framework) -> Optional[Event]:
content = _get_property_value(message, "content")
if content:

Choose a reason for hiding this comment

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

in the poc there was a todo item to check if content should be collected, is that no longer needed?

attributes = {
# TODO: add below to opentelemetry.semconv._incubating.attributes.gen_ai_attributes
"gen_ai.framework": framework,
GenAI.GEN_AI_SYSTEM: system,

Choose a reason for hiding this comment

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

why is gen_ai.provider.name not included?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I only see SYSTEM_NAME in our constants. I've added the provider_name manually, with a todo to update once the semconvs from python catches up

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