Skip to content

Commit 4b27507

Browse files
fix!: Remove Span APIs for attributes and events (#1899)
* fix: Remove Span APIs for attributes and events These APIs are not spec compliant. The SDK description makes this clear. We need to find another solution for AWS Lambda instrumentation. * chore: Remove test
1 parent 385715c commit 4b27507

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

api/lib/opentelemetry/trace/span.rb

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,6 @@ def add_attributes(attributes)
7878
self
7979
end
8080

81-
# Retrieve attributes
82-
#
83-
# Note that the OpenTelemetry project
84-
# {https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-semantic-conventions.md
85-
# documents} certain "standard attributes" that have prescribed semantic
86-
# meanings.
87-
#
88-
# @return [hash] returns empty hash
89-
def attributes
90-
{}
91-
end
92-
9381
# Add a link to a {Span}.
9482
#
9583
# Adding links at span creation using the `links` option is preferred
@@ -135,18 +123,6 @@ def add_event(name, attributes: nil, timestamp: nil)
135123
self
136124
end
137125

138-
# Retrieve events
139-
#
140-
# Note that the OpenTelemetry project
141-
# {https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-semantic-conventions.md
142-
# documents} certain "standard event names and keys" which have
143-
# prescribed semantic meanings.
144-
#
145-
# @return [array] returns empty array
146-
def events
147-
[]
148-
end
149-
150126
# Record an exception during the execution of this span. Multiple exceptions
151127
# can be recorded on a span.
152128
#

api/test/opentelemetry/trace/span_test.rb

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@
3636
end
3737
end
3838

39-
describe '#attributes' do
40-
it 'returns empty hash' do
41-
_(span.attributes).must_equal({})
42-
end
43-
44-
it 'returns empty hash even after modification attempts' do
45-
span.attributes['test'] = 'value'
46-
_(span.attributes).must_equal({})
47-
end
48-
end
49-
5039
describe '#add_link' do
5140
it 'returns self' do
5241
_(span.add_link(OpenTelemetry::Trace::Link.new(span_context))).must_equal(span)
@@ -71,17 +60,6 @@
7160
end
7261
end
7362

74-
describe '#events' do
75-
it 'returns empty array' do
76-
_(span.events).must_equal([])
77-
end
78-
79-
it 'returns empty array even after modification attempts' do
80-
span.events << 'test event'
81-
_(span.events).must_equal([])
82-
end
83-
end
84-
8563
describe '#record_exception' do
8664
it 'returns nil' do
8765
_(span.record_exception(StandardError.new('oops'))).must_be_nil

0 commit comments

Comments
 (0)