-
Notifications
You must be signed in to change notification settings - Fork 789
feat(writer): initial implementation #3209
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
Merged
nirga
merged 37 commits into
traceloop:main
from
yanomaly:opentelemetry-instrumentation-writer
Aug 29, 2025
Merged
Changes from 36 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
912d93e
Writer instrumentation initial commit
yanomaly 4176386
feat: define base structure of writer instrumentaton
yanomaly 4e27bd8
fix: fixed _instrument/_uninstrument methods implementation
yanomaly c61f5a9
feat: start working on _wrap/_awrap implementation
yanomaly 1d26d8e
feat: define _wrat/_awrap structure and start subsidiary methods impl…
yanomaly 8d9873f
Events emitter and non-streaming
adeweaver 0b3f3be
Streaming response processor methods
adeweaver 30cac95
Response type and tools call setter
adeweaver ae7504d
Merge pull request #1 from adeweaver/opentelemetry-instrumentation-wr…
yanomaly 9161655
Merge branch 'main' into opentelemetry-instrumentation-writer
yanomaly 2d858fd
feat: add time_to_first_token and time_to_complete histograms
yanomaly bb89069
test: tests for chat/completion non-streaming modes
yanomaly 60ec527
fix: fix instrumentation to pass tests
yanomaly d96f21c
WRITER README addition
adeweaver 202538f
feat: update streaming handler for completions
yanomaly 24b1452
Merge remote-tracking branch 'origin/opentelemetry-instrumentation-wr…
yanomaly 481d3c2
refactof: style fixes
yanomaly f0b790d
test: tests for streaming chat
yanomaly 6f1e803
test: tests for streaming chat calls with story includes tool calling
yanomaly 1c89a9f
test: tests for chat non-streaming tool call request handling
yanomaly 8e9c4aa
feat: streaming tool call request handling
yanomaly 044479c
test: tests of metrics gathering
yanomaly 7ecae64
feat: writer instrumentation usage example app
yanomaly 9a5fbd8
Merge remote-tracking branch 'origin/main' into opentelemetry-instrum…
yanomaly 057558f
config: update dependencies
yanomaly fa20869
feat: streaming response multiple choices/tool calls accumulator
yanomaly 0c76206
test: tests for multiple tool call requests
yanomaly e44199d
Merge remote-tracking branch 'origin/main' into opentelemetry-instrum…
yanomaly a80c2bf
refactor: implement some CodeRabbit refactoring suggestions
yanomaly 1d47a4b
feat: add conditions and exceptions handling to stream processor
yanomaly 68737b3
refactor: style fixes
yanomaly 1d3ae93
fix: update poetry.lock
yanomaly a3e8821
fix: update python version limitations and update .lock file with ref…
yanomaly 921cb91
fix: update poetry.lock
yanomaly 5653637
lint: fix linting errors
yanomaly 389efe9
Merge branch 'main' into opentelemetry-instrumentation-writer
nirga f9d11be
chore: prepare for release
nirga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[flake8] | ||
exclude = | ||
.git, | ||
__pycache__, | ||
build, | ||
dist, | ||
.tox, | ||
venv, | ||
.venv, | ||
.pytest_cache | ||
max-line-length = 120 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12.5 | ||
yanomaly marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# OpenTelemetry Writer Instrumentation | ||
|
||
<a href="https://pypi.org/project/opentelemetry-instrumentation-writer/"> | ||
<img alt="PyPI version" src="https://badge.fury.io/py/opentelemetry-instrumentation-writer.svg"> | ||
</a> | ||
|
||
This library allows tracing calls to any of Writer's endpoints sent with the official [Writer Python Library](https://github.com/writer/writer-python). | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install opentelemetry-instrumentation-writer | ||
``` | ||
|
||
## Example usage | ||
|
||
```python | ||
from opentelemetry.instrumentation.writer import WriterInstrumentor | ||
|
||
WriterInstrumentor().instrument() | ||
``` | ||
|
||
## Privacy | ||
|
||
**By default, this instrumentation logs prompts, completions, and embeddings to span attributes**. This gives you a clear visibility into how your LLM application is working, and can make it easy to debug and evaluate the quality of the outputs. | ||
|
||
However, you may want to disable this logging for privacy reasons, as they may contain highly sensitive data from your users. You may also simply want to reduce the size of your traces. | ||
|
||
To disable logging, set the `TRACELOOP_TRACE_CONTENT` environment variable to `false`. | ||
|
||
```bash | ||
TRACELOOP_TRACE_CONTENT=false | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.