Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions instrumentation/racecar/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Release History: opentelemetry-instrumentation-racecar

* Renamed messaging.kafka.message_key to messaging.kafka.message.key to match semantic conventions.

* Renamed messaging.destination to messaging.destination.name to match semantic conventions.

* Renamed messaging.kafka.partition to messaging.destination.partition.id to match semantic conventions.

* Removed messaging.destination_kind to match semantic conventions.

* Add messaging.operation.type attribute as per semantic conventions.
Comment on lines +3 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our release tooling will add the changelog entry. The default is based on the name of the PR. I'm happy to edit the entry to match this text, but we'll have to wait until the release phase to do so.


### v0.4.0 / 2025-01-16

* BREAKING CHANGE: Set minimum supported version to Ruby 3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module Consumer
def produce(payload, topic:, key: nil, partition: nil, partition_key: nil, headers: nil, create_time: nil)
attributes = {
'messaging.system' => 'kafka',
'messaging.destination' => topic,
'messaging.destination_kind' => 'topic'
'messaging.destination.name' => topic,
'messaging.operation.type' => 'send'
}

headers ||= {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def start(_name, _id, payload)
def attributes(payload)
attributes = {
'messaging.system' => 'kafka',
'messaging.destination' => payload[:topic],
'messaging.destination_kind' => 'topic',
'messaging.kafka.partition' => payload[:partition],
'messaging.kafka.offset' => payload[:offset]
'messaging.destination.name' => payload[:topic],
'messaging.destination.partition.id' => payload[:partition],
'messaging.kafka.offset' => payload[:offset],
'messaging.operation.type' => 'receive'
}

message_key = extract_message_key(payload[:key])
attributes['messaging.kafka.message_key'] = message_key if message_key
attributes['messaging.kafka.message.key'] = message_key if message_key

attributes
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def stop_racecar(thread)
first_process_span = process_spans[0]
_(first_process_span.name).must_equal("#{topic_name} process")
_(first_process_span.kind).must_equal(:consumer)
_(first_process_span.attributes['messaging.destination']).must_equal(topic_name)
_(first_process_span.attributes['messaging.kafka.partition']).wont_be_nil
_(first_process_span.attributes['messaging.destination.name']).must_equal(topic_name)
_(first_process_span.attributes['messaging.destination.partition.id']).wont_be_nil

first_process_span_link = first_process_span.links[0]
linked_span_context = first_process_span_link.span_context
Expand Down Expand Up @@ -184,10 +184,10 @@ def stop_racecar(thread)
process_spans = spans.select { |s| s.name == "#{topic_name} process" }

first_process_span = process_spans[0]
_(first_process_span.attributes['messaging.kafka.message_key']).must_equal('Key 1')
_(first_process_span.attributes['messaging.kafka.message.key']).must_equal('Key 1')

second_process_span = process_spans[1]
_(second_process_span.attributes).wont_include('messaging.kafka.message_key')
_(second_process_span.attributes).wont_include('messaging.kafka.message.key')
end
end
end
Expand Down Expand Up @@ -216,8 +216,8 @@ def stop_racecar(thread)
first_process_span = process_spans[0]
_(first_process_span.name).must_equal("#{topic_name} process")
_(first_process_span.kind).must_equal(:consumer)
_(first_process_span.attributes['messaging.destination']).must_equal(topic_name)
_(first_process_span.attributes['messaging.kafka.partition']).wont_be_nil
_(first_process_span.attributes['messaging.destination.name']).must_equal(topic_name)
_(first_process_span.attributes['messaging.destination.partition.id']).wont_be_nil

first_process_span_link = first_process_span.links[0]
linked_span_context = first_process_span_link.span_context
Expand Down
Loading