From 1e84858c71bff2eb51e76caf183f08bd630bfc02 Mon Sep 17 00:00:00 2001 From: Robert Laurin Date: Thu, 19 Dec 2024 13:39:38 -0600 Subject: [PATCH] fix: Format gat commands --- .../lib/opentelemetry/instrumentation/dalli/utils.rb | 3 ++- .../instrumentation/dalli/instrumentation_test.rb | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/utils.rb b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/utils.rb index 8f7ca47f3..189e88b7c 100644 --- a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/utils.rb +++ b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/utils.rb @@ -41,7 +41,8 @@ module Utils 'multi_add' => 'addq', 'multi_replace' => 'replaceq', 'multi_delete' => 'deleteq', - 'touch' => 'touch' + 'touch' => 'touch', + 'gat' => 'gat' # 'sasl_authentication' => 'auth_negotiation', # 'sasl_authentication' => 'auth_request', }.freeze diff --git a/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb b/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb index 512ba0359..f8a018335 100644 --- a/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb +++ b/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb @@ -127,6 +127,14 @@ _(span.name).must_equal 'set' _(span.attributes['db.statement']).must_equal 'set ?' end + + it 'supports gat' do + dalli.gat('foo') + + _(exporter.finished_spans.size).must_equal 1 + _(span.name).must_equal 'gat' + _(span.attributes['db.statement']).must_equal 'gat foo 0' + end end # Dalli 3.x has different behavior than 2.x versions and attempts to retry on network errors