Skip to content

Commit

Permalink
Remove propagated parent ID key
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-Kim committed Sep 23, 2024
1 parent c99c0bc commit 191a0d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion ddtrace/llmobs/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
METADATA = "_ml_obs.meta.metadata"
METRICS = "_ml_obs.metrics"
ML_APP = "_ml_obs.meta.ml_app"
PROPAGATED_PARENT_ID_KEY = "_dd.p.llmobs_parent_id"
PARENT_ID_KEY = "_ml_obs.llmobs_parent_id"
TAGS = "_ml_obs.tags"

Expand Down
6 changes: 3 additions & 3 deletions tests/llmobs/test_llmobs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,15 +1389,15 @@ def test_activate_distributed_headers_calls_httppropagator_extract(LLMObs, mock_

def test_activate_distributed_headers_no_trace_id_does_nothing(LLMObs, mock_logs):
with mock.patch("ddtrace.llmobs._llmobs.HTTPPropagator.extract") as mock_extract:
mock_extract.return_value = Context(span_id=123, meta={PROPAGATED_PARENT_ID_KEY: "123"})
mock_extract.return_value = Context(span_id=123)
LLMObs.activate_distributed_headers({})
assert mock_extract.call_count == 1
mock_logs.warning.assert_called_once_with("Failed to extract trace/span ID from request headers.")


def test_activate_distributed_headers_no_span_id_does_nothing(LLMObs, mock_logs):
with mock.patch("ddtrace.llmobs._llmobs.HTTPPropagator.extract") as mock_extract:
mock_extract.return_value = Context(trace_id=123, meta={PROPAGATED_PARENT_ID_KEY: "123"})
mock_extract.return_value = Context(trace_id=123)
LLMObs.activate_distributed_headers({})
assert mock_extract.call_count == 1
mock_logs.warning.assert_called_once_with("Failed to extract trace/span ID from request headers.")
Expand All @@ -1416,7 +1416,7 @@ def test_activate_distributed_headers_no_llmobs_parent_id_does_nothing(LLMObs, m

def test_activate_distributed_headers_activates_context(LLMObs, mock_logs):
with mock.patch("ddtrace.llmobs._llmobs.HTTPPropagator.extract") as mock_extract:
dummy_context = Context(trace_id=123, span_id=456, meta={PROPAGATED_PARENT_ID_KEY: "789"})
dummy_context = Context(trace_id=123, span_id=456)
mock_extract.return_value = dummy_context
with mock.patch("ddtrace.llmobs.LLMObs._instance.tracer.context_provider.activate") as mock_activate:
LLMObs.activate_distributed_headers({})
Expand Down

0 comments on commit 191a0d0

Please sign in to comment.