Skip to content

Commit e8c53c4

Browse files
committed
push
1 parent 6dd05e0 commit e8c53c4

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

‎langfuse/_client/client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def mask_otel_spans(
202202
if "gen_ai.prompt.0.content" in span.attributes:
203203
patches[identifier] = OtelSpanPatch(
204204
delete_attributes=("gen_ai.prompt.0.content",),
205-
set_attributes={"langfuse.masking.applied": True},
205+
set_attributes={"masking.applied": True},
206206
)
207207
208208
return MaskOtelSpansResult(span_patches=patches)

‎langfuse/types.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def mask_otel_spans(
260260
"gen_ai.prompt.0.content",
261261
"gen_ai.completion.0.content",
262262
),
263-
set_attributes={"langfuse.masking.applied": True},
263+
set_attributes={"masking.applied": True},
264264
)
265265
266266
return MaskOtelSpansResult(span_patches=patches)

‎tests/unit/test_mask_otel_spans.py‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def mask_otel_spans(*, params: MaskOtelSpansParams):
139139
target_identifier: OtelSpanPatch(
140140
set_attributes={
141141
"gen_ai.request.model": "masked-model",
142-
"langfuse.masking.applied": True,
142+
"masking.applied": True,
143143
}
144144
)
145145
}
@@ -184,10 +184,7 @@ def mask_otel_spans(*, params: MaskOtelSpansParams):
184184
== "masked-model"
185185
)
186186
assert (
187-
exported_by_name["third-party-media-span"].attributes[
188-
"langfuse.masking.applied"
189-
]
190-
is True
187+
exported_by_name["third-party-media-span"].attributes["masking.applied"] is True
191188
)
192189
assert (
193190
exported_by_name["third-party-unchanged-span"].attributes[
@@ -463,12 +460,12 @@ def test_clone_span_preserves_dropped_attribute_event_and_link_counts():
463460

464461
cloned_span = span_exporter_module.LangfuseTransformingSpanExporter._clone_span(
465462
span=span,
466-
attributes={"secret": "masked", "langfuse.masking.applied": True},
463+
attributes={"secret": "masked", "masking.applied": True},
467464
)
468465

469466
assert dict(cloned_span.attributes) == {
470467
"secret": "masked",
471-
"langfuse.masking.applied": True,
468+
"masking.applied": True,
472469
}
473470
assert cloned_span.dropped_attributes == 3
474471
assert cloned_span.dropped_events == 5
@@ -928,7 +925,7 @@ def mask_otel_spans(*, params: MaskOtelSpansParams):
928925
identifier: OtelSpanPatch(
929926
set_attributes={
930927
"secret": object(),
931-
"langfuse.masking.applied": True,
928+
"masking.applied": True,
932929
}
933930
)
934931
}
@@ -951,7 +948,7 @@ def mask_otel_spans(*, params: MaskOtelSpansParams):
951948

952949
assert "secret" not in exported_span.attributes
953950
assert exported_span.attributes["gen_ai.request.model"] == "gpt-4o"
954-
assert exported_span.attributes["langfuse.masking.applied"] is True
951+
assert exported_span.attributes["masking.applied"] is True
955952

956953

957954
def test_mask_otel_spans_set_wins_when_key_is_deleted_and_set():

0 commit comments

Comments
 (0)