Skip to content

Commit b8c0fca

Browse files
committed
Stop memoizing the span name
1 parent b1d707f commit b8c0fca

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/span_subscriber.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def initialize(name:, tracer:, notification_payload_transform: nil, disallowed_n
7575
# rubocop:enable Metrics/ParameterLists
7676

7777
def start(name, id, payload)
78-
span = @tracer.start_span(span_name(name).dup.freeze, kind: @kind)
78+
span = @tracer.start_span(safe_span_name_for(name), kind: @kind)
7979
token = OpenTelemetry::Context.attach(
8080
OpenTelemetry::Trace.context_with_span(span)
8181
)
@@ -138,15 +138,6 @@ def sanitized_value(value)
138138
end
139139
end
140140

141-
def span_name(name)
142-
case @name
143-
when Regexp
144-
safe_span_name_for(name)
145-
else
146-
@span_name ||= safe_span_name_for(@name)
147-
end
148-
end
149-
150141
# Helper method to try an shield the span name formatter from errors
151142
#
152143
# It wraps the user supplied formatter in a rescue block and returns the original name if a StandardError is raised by the formatter

instrumentation/active_support/test/opentelemetry/instrumentation/active_support/span_subscriber_test.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ def finish(name, id, payload)
3535
instrumentation.install({})
3636
end
3737

38-
it 'memoizes the span name' do
39-
span, = subscriber.start('oh.hai', 'abc', {})
40-
_(span.name).must_equal(notification_name)
41-
end
42-
4338
it 'uses the provided tracer' do
4439
subscriber = OpenTelemetry::Instrumentation::ActiveSupport::SpanSubscriber.new(
4540
name: 'oh.hai',

0 commit comments

Comments
 (0)