Skip to content

Commit 971eba7

Browse files
Merge branch 'main' into dependabot/github_actions/DavidAnson/markdownlint-cli2-action-20
2 parents 7e34768 + 434473c commit 971eba7

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

instrumentation/dalli/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History: opentelemetry-instrumentation-dalli
22

3+
### v0.27.3 / 2025-05-27
4+
5+
* FIXED: Compact Dalli attributes
6+
37
### v0.27.2 / 2025-04-30
48

59
* FIXED: Do not pollute the `OpenTelemetry::Instrumentation` namespace

instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/patches/server.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ def request(op, *args) # rubocop:disable Naming/MethodParameterName
1515
attributes = {
1616
'db.system' => 'memcached',
1717
'db.operation' => operation,
18-
'net.peer.name' => hostname,
19-
'net.peer.port' => port
18+
'net.peer.name' => hostname
2019
}
20+
attributes['net.peer.port'] = port if port
21+
2122
if config[:db_statement] == :include
2223
attributes['db.statement'] = Utils.format_command(operation, args)
2324
elsif config[:db_statement] == :obfuscate

instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
module OpenTelemetry
88
module Instrumentation
99
module Dalli
10-
VERSION = '0.27.2'
10+
VERSION = '0.27.3'
1111
end
1212
end
1313
end

instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,24 @@
142142
_(span.name).must_equal 'gat'
143143
_(span.attributes['db.statement']).must_equal 'gat foo 0'
144144
end
145+
146+
it 'supports unix domain socket' do
147+
dalli.version
148+
exporter.reset
149+
150+
server = dalli.instance_variable_get(:@ring).servers.first
151+
server.stub(:hostname, '/tmp/memcached.sock') do
152+
server.stub(:port, nil) do
153+
dalli.set('foo', 'bar')
154+
155+
puts exporter.finished_spans
156+
_(exporter.finished_spans.size).must_equal 1
157+
_(span.name).must_equal 'set'
158+
_(span.attributes).wont_include 'net.peer.port'
159+
_(span.attributes['net.peer.name']).must_equal '/tmp/memcached.sock'
160+
end
161+
end
162+
end
145163
end
146164
end
147165

0 commit comments

Comments
 (0)