Sha256: 7f4b40d261bc3cda608dc9c6cca88384e898c3247ad6da4da818bcdeddc28822

Contents?: true

Size: 692 Bytes

Versions: 3

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Instrumentation
    module AwsSdk
      # DbHelper class provides methods for calculating aws db span attributes
      class DbHelper
        class << self
          def get_db_attributes(context, service_name, operation)
            return get_dynamodb_attributes(context, operation) if service_name == 'DynamoDB'

            {}
          end

          def get_dynamodb_attributes(context, operation)
            {
              SemanticConventions::Trace::DB_SYSTEM => 'dynamodb'
            }
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aspecto-opentelemetry-instrumentation-aws_sdk-0.1.2 lib/opentelemetry/instrumentation/aws_sdk/db_helper.rb
aspecto-opentelemetry-instrumentation-aws_sdk-0.1.1 lib/opentelemetry/instrumentation/aws_sdk/db_helper.rb
aspecto-opentelemetry-instrumentation-aws_sdk-0.1.0 lib/opentelemetry/instrumentation/aws_sdk/db_helper.rb