Skip to content

Commit 111f18c

Browse files
committed
chore: add test for peer.service
1 parent 60ec2e7 commit 111f18c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

instrumentation/net_ldap/test/opentelemetry/instrumentation/net/ldap/instrumentation_test.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def modify(args)
5555

5656
before do
5757
exporter.reset
58-
instrumentation.install
58+
instrumentation.install(peer_service: 'test:ldap')
5959
end
6060

6161
after do
@@ -81,6 +81,7 @@ def modify(args)
8181
_(span.attributes['ldap.request.message']).must_equal '{}'
8282
_(span.attributes['ldap.response.status_code']).must_equal 0
8383
_(span.attributes['network.protocol.name']).must_equal 'ldap'
84+
_(span.attributes['peer.service']).must_equal 'test:ldap'
8485
_(span.attributes['server.address']).must_equal 'test.mocked.com'
8586
_(span.attributes['server.port']).must_equal 636
8687
end
@@ -99,6 +100,7 @@ def modify(args)
99100
_(span.attributes['ldap.request.message']).must_equal '{"filter":"(uid=user1)","paged_searches_supported":false,"base":"dc=com"}'
100101
_(span.attributes['ldap.response.status_code']).must_equal 0
101102
_(span.attributes['network.protocol.name']).must_equal 'ldap'
103+
_(span.attributes['peer.service']).must_equal 'test:ldap'
102104
_(span.attributes['server.address']).must_equal 'test.mocked.com'
103105
_(span.attributes['server.port']).must_equal 636
104106
end
@@ -121,6 +123,7 @@ def modify(args)
121123
_(span.attributes['ldap.encryption']).must_equal '{"method":"simple_tls","tls_options":{"foo":"bar"}}'
122124
_(span.attributes['ldap.request.message']).must_equal '{}'
123125
_(span.attributes['network.protocol.name']).must_equal 'ldap'
126+
_(span.attributes['peer.service']).must_equal 'test:ldap'
124127
_(span.attributes['server.address']).must_equal 'test.mocked.com'
125128
_(span.attributes['server.port']).must_equal 636
126129
end
@@ -142,6 +145,7 @@ def modify(args)
142145
_(span.attributes['ldap.request.message']).must_equal '{"dn":"CN=test,OU=test,DC=com","operations":[["replace","unicodePwd",["[REDACTED]"]]]}'
143146
_(span.attributes['ldap.response.status_code']).must_equal 0
144147
_(span.attributes['network.protocol.name']).must_equal 'ldap'
148+
_(span.attributes['peer.service']).must_equal 'test:ldap'
145149
_(span.attributes['server.address']).must_equal 'test.mocked.com'
146150
_(span.attributes['server.port']).must_equal 636
147151
end

0 commit comments

Comments
 (0)