-
Notifications
You must be signed in to change notification settings - Fork 786
Implement OpenAI Agents span processing #3817
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
base: main
Are you sure you want to change the base?
Conversation
|
||
def _operation_name(self, span_data: Any) -> str: | ||
span_type = getattr(span_data, "type", None) | ||
if span_type == "generation": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these span_types always going to be in lowercase?
|
||
@property | ||
def type(self) -> str: | ||
return "function" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these strings like function, generation, etc. are being used in multiple places, can these be made constants instead of hardcoding the values.
|
||
processor = _OpenAIAgentsSpanProcessor(tracer=tracer, system=system) | ||
|
||
tracing = _load_tracing_module() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why we are loading the module during init of the instrumentor and not at the beginning of runtime/
return value | ||
|
||
|
||
def _get_registered_processors(provider) -> list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Include type annotations for provider and provide docstring on what the fields look like.
Description
Updates the previous barebones PR to include genai spans and traces.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Testing
cleanly with integer timestamps.
exporter errors.
timestamps and attribute mapping.
Environment
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.