Skip to content

Commit

Permalink
pass span_attributes when creating span inside start_span
Browse files Browse the repository at this point in the history
  • Loading branch information
alizenhom committed Oct 19, 2024
1 parent 9ac90f9 commit 2549f25
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def traced_method(wrapped, instance, args, kwargs):
span_attributes = {**get_llm_request_attributes(kwargs)}
span_name = f"{span_attributes[GenAIAttributes.GEN_AI_OPERATION_NAME]} {span_attributes[GenAIAttributes.GEN_AI_REQUEST_MODEL]}"

span = tracer.start_span(name=span_name, kind=SpanKind.CLIENT)
span = tracer.start_span(
name=span_name, kind=SpanKind.CLIENT, attributes=span_attributes
)
if span.is_recording():
_set_input_attributes(span, span_attributes)
set_event_prompt(span, json.dumps(llm_prompts))
Expand Down

0 comments on commit 2549f25

Please sign in to comment.