Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ which it already is in any project that calls Anthropic. When an
instrumentation's library is missing or too old, `init()` logs a warning naming
the version it needs and leaves that one integration off. For example,
`openinference-instrumentation-anthropic` 3.x needs `anthropic>=1.8.0`; with
an older `anthropic`, upgrade it or keep the instrumentation on 2.x.
an older `anthropic`, upgrade it.

```python
rius.init() # auto-enables installed instrumentors
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ dependencies = [
# installed `mcp` would be the one place the SDK added a runtime library to a
# user's environment, which is exactly what the rule above exists to prevent.
openai = ["openinference-instrumentation-openai>=0.1.52"]
anthropic = ["openinference-instrumentation-anthropic>=2.1.0"]
anthropic = ["openinference-instrumentation-anthropic>=3.1.1"]
langchain = ["openinference-instrumentation-langchain>=0.1.67"]
llama-index = ["openinference-instrumentation-llama-index>=4.4.3"]
litellm = ["openinference-instrumentation-litellm>=0.1.34"]
instruments = [
"openinference-instrumentation-openai>=0.1.52",
"openinference-instrumentation-anthropic>=2.1.0",
"openinference-instrumentation-anthropic>=3.1.1",
"openinference-instrumentation-langchain>=0.1.67",
"openinference-instrumentation-llama-index>=4.4.3",
"openinference-instrumentation-litellm>=0.1.34",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_anthropic_native_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
and cost counted twice, a second ``error.type`` spelled ``not_found_error``,
and an unflagged duplicate after ``mark_compaction()``. When rius registered
that instrumentor, the SDK's chat span is exported as a plain client span.
From openinference-instrumentation-anthropic 3.2.0, OpenInference stops the
From openinference-instrumentation-anthropic 3.1.1, OpenInference stops the
SDK from starting that chat span at all, so the demotion has nothing to do.

These run each scenario in a fresh interpreter (``anthropic_native_span_run.py``):
Expand Down Expand Up @@ -92,7 +92,7 @@ def _sdk_traces() -> bool:
def _openinference_leaves_the_sdk_chat_span() -> bool:
"""Whether the SDK's chat span still starts beside OpenInference's.

From openinference-instrumentation-anthropic 3.2.0 it does not: OpenInference
From openinference-instrumentation-anthropic 3.1.1 it does not: OpenInference
stops the SDK from starting a chat span for a call it traces, so there is
nothing to demote. The SDK's tool-runner and other API spans still start.
"""
Expand All @@ -102,7 +102,7 @@ def _openinference_leaves_the_sdk_chat_span() -> bool:
_NO_SDK_TRACING = "this anthropic has no tracing of its own (it starts in 1.14.0)"
_SDK_CHAT_SPAN_LEFT = "this OpenInference leaves the SDK's chat span; the demotion tests cover it"
_NO_SDK_CHAT_SPAN = (
"OpenInference stops the SDK's chat span (3.2.0 on): nothing to demote; "
"OpenInference stops the SDK's chat span (3.1.1 on): nothing to demote; "
"see test_openinference_that_stops_the_sdk_chat_span_leaves_one_llm_span"
)

Expand Down Expand Up @@ -314,7 +314,7 @@ def test_bridged_to_another_sdk_each_call_still_counts_once(case: str) -> None:
@pytest.mark.integration
@pytest.mark.parametrize("case", [*_CASES, "compaction", "rate_limited"])
def test_openinference_that_stops_the_sdk_chat_span_leaves_one_llm_span(case: str) -> None:
# The SDK traces on its own, but OpenInference (3.2.0 on) keeps it from
# The SDK traces on its own, but OpenInference (3.1.1 on) keeps it from
# starting a chat span for the calls it traces: no duplicate to demote.
if not _sdk_traces():
pytest.skip(_NO_SDK_TRACING)
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading