From 97264dd79cb0ac9b3991e6f527ecc0e5424a2a60 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 | 1 + .../instrumentation/dalli/instrumentation_test.rb | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/utils.rb b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/utils.rb index 8f7ca47f3..843cd3557 100644 --- a/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/utils.rb +++ b/instrumentation/dalli/lib/opentelemetry/instrumentation/dalli/utils.rb @@ -42,6 +42,7 @@ module Utils 'multi_replace' => 'replaceq', 'multi_delete' => 'deleteq', '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