Skip to content

Commit e99ee07

Browse files
committed
fix: status handling in span
1 parent 34111f7 commit e99ee07

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/agents/tool_wrapper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def call(args)
6464

6565
# Record exception in span
6666
span.record_exception(e)
67-
span.set_status(OpenTelemetry::Trace::Status.error(e.message)) if defined?(OpenTelemetry::Trace::Status)
67+
span.status = OpenTelemetry::Trace::Status.error(e.message) if defined?(OpenTelemetry::Trace::Status)
6868

6969
raise
7070
end

lib/agents/tracing.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def set_attribute(_key, _value); end
206206

207207
def add_event(_name, _attributes = {}); end
208208

209-
def set_status(_status); end
209+
def status=(_status); end
210210

211211
def record_exception(_exception); end
212212
end

spec/agents/tracing_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@
274274
expect { noop_span.add_event("event_name") }.not_to raise_error
275275
end
276276

277-
it "provides no-op set_status" do
278-
expect { noop_span.set_status("status") }.not_to raise_error
277+
it "provides no-op status=" do
278+
expect { noop_span.status = "status" }.not_to raise_error
279279
end
280280

281281
it "provides no-op record_exception" do

0 commit comments

Comments
 (0)