mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
test(otel v2): cache one langfuse tracer per key pair and host
This commit is contained in:
parent
8a5f763164
commit
4c47558dbf
1 changed files with 14 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
"""Per-request multi-tenant credential routing (V1 parity)."""
|
||||
|
||||
import base64
|
||||
from typing import Final
|
||||
|
||||
import pytest
|
||||
from opentelemetry.trace import NoOpTracer
|
||||
|
|
@ -769,3 +770,16 @@ def test_langfuse_host_stamped_onto_owned_exporter_only():
|
|||
"Authorization=Basic team-b",
|
||||
)
|
||||
assert by_owner[None] == ("http://self-hosted-collector:4318", "x=base-collector")
|
||||
|
||||
|
||||
def test_langfuse_provider_cached_per_key_pair_and_host():
|
||||
cache: Final = _cache("langfuse_otel")
|
||||
default: Final = NoOpTracer()
|
||||
team_a: Final = {**LANGFUSE_CREDS, "langfuse_host": "http://team-a-langfuse:3100"}
|
||||
cache.route_for(default, team_a)
|
||||
cache.route_for(default, team_a)
|
||||
assert len(cache._providers) == 1
|
||||
cache.route_for(default, {**LANGFUSE_CREDS, "langfuse_host": "http://team-b-langfuse:3100"})
|
||||
assert len(cache._providers) == 2
|
||||
cache.route_for(default, LANGFUSE_CREDS)
|
||||
assert len(cache._providers) == 3
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue