-
Notifications
You must be signed in to change notification settings - Fork 5
elastic-opentelemetry-instrumentation-openai: add examples #45
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
Conversation
instrumentation/elastic-opentelemetry-instrumentation-openai/examples/chat.py
Outdated
Show resolved
Hide resolved
codefromthecrypt
left a comment
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.
thanks for pulling this in!
codefromthecrypt
left a comment
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.
Sorry to make polishing suggestions, but below aligns things a bit better.
While arbitrary, when I originally asked chat about a geography question, I intended something more esoteric than the falklands. Recent versions of the presentation use Bouvet Island, which is what I meant to put in the first place.
instrumentation/elastic-opentelemetry-instrumentation-openai/examples/chat.py
Outdated
Show resolved
Hide resolved
instrumentation/elastic-opentelemetry-instrumentation-openai/examples/README.md
Show resolved
Hide resolved
…xamples/chat.py Co-authored-by: Adrian Cole <[email protected]>
codefromthecrypt
left a comment
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.
prefer the .env being there to match upstream examples which are less steps due to it
instrumentation/elastic-opentelemetry-instrumentation-openai/examples/README.md
Show resolved
Hide resolved
|
|
||
| ``` | ||
| opentelemetry-instrument python use_openai.py | ||
| # "examples/chat.py" is a simple script using the openai client library. |
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.
maybe just say something like this? that way we don't need to drift or repeat instructions about things like ENV vars?
See our examples for a quick start
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.
Sorry, I don't understand 😅, do you mean to replace this block with a reference to the examples or just replace this comment with "see our examples for a quick start"?
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.
made a top-level comment here #45 (comment)
I'll propose an alternative PR here and into elastic-otel-python..
| # OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 | ||
| # OTEL_EXPORTER_OTLP_PROTOCOL=grpc | ||
|
|
||
| OTEL_SERVICE_NAME=opentelemetry-python-openai |
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.
@codefromthecrypt So this should be openai-example right?
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.
yep
|
after thinking about this with @trentm etc I think maybe it would be better to put the example into an openai directory here https://github.com/elastic/elastic-otel-python/tree/main/examples Then, the copy of examples in this directory can reference relative path for the instrumentation, and have that in the requirements.txt. In other words, the examples copy here could be used to test-drive the current code (keeping README in-tact), while the copy of examples in the EDOT tree are the end-user first start which use whatever the current version of EDOT is. |
|
so the EDOT driven examples were merged here elastic/elastic-otel-python#226, so we can revert this to examples that use package references relative to the source directory as I think was done initially. I'll give a try porting |
What does this pull request do?
Add examples for instrumenting chat and embeddings calls.
Related issues