Skip to content

Commit 0877919

Browse files
committed
Fix mixed-API spec for renamed monitor root span
`set_action` now renames the OpenTelemetry root span to the action, so the mixed-API integration spec could no longer find the monitor root by the old "appsignal.transaction http_request" placeholder name. Look it up by SpanKind (SERVER) instead, matching the traces spec. [skip changeset]
1 parent 49d7b04 commit 0877919

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

spec/integration/collector_mode_mixed_api_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
by_name = spans.to_h { |s| [s.name, s] }
1818

1919
outer = by_name.fetch("outer.otel")
20-
monitor_root = by_name.fetch("appsignal.transaction http_request")
20+
# `Appsignal.monitor` renames its root span to the action, so look it
21+
# up by SpanKind (SERVER is the subtrace root the collector keys on)
22+
# rather than by name.
23+
monitor_root = spans.find { |s| s.kind == :SPAN_KIND_SERVER }
24+
expect(monitor_root).not_to be_nil
2125
event_with_otel_child = by_name.fetch("event.with.otel.child")
2226
inner_otel = by_name.fetch("inner.otel.inside_instrument")
2327
manual_otel = by_name.fetch("manual.otel.in_monitor")

0 commit comments

Comments
 (0)