Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ekump committed Jan 25, 2024
1 parent 1dc782c commit 26b6bf8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec/datadog/tracing/contrib/elasticsearch/transport_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,31 @@ def call(env)
end
end
end

describe 'client configuration override' do
context 'when #service is overridden' do
before { Datadog.configure_onto(client.transport, service_name: service_name) }

let(:service_name) { 'bar' }

describe 'then a GET request' do
subject(:response) { client.perform_request(method, path) }

let(:method) { 'GET' }
let(:path) { '_cluster/health' }

before do
stub_request(:get, "#{server}/#{path}").to_return(status: 200)
end

it 'produces a well-formed trace' do
expect(response.status).to eq(200)
expect(WebMock).to have_requested(:get, "#{server}/#{path}")
expect(spans).to have(1).items
expect(span.name).to eq('elasticsearch.query')
expect(span.service).to eq(service_name)
end
end
end
end
end

0 comments on commit 26b6bf8

Please sign in to comment.