lib/opentelemetry/instrumentation/dalli/patches/server.rb in opentelemetry-instrumentation-dalli-0.10.0 vs lib/opentelemetry/instrumentation/dalli/patches/server.rb in opentelemetry-instrumentation-dalli-0.11.0

- old
+ new

@@ -1,8 +1,8 @@ # frozen_string_literal: true -# Copyright 2020 OpenTelemetry Authors +# Copyright The OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 module OpenTelemetry module Instrumentation @@ -16,19 +16,23 @@ 'db.system' => 'memcached', 'db.statement' => Utils.format_command(operation, args), 'net.peer.name' => hostname, 'net.peer.port' => port } - + attributes['peer.service'] = config[:peer_service] if config[:peer_service] tracer.in_span(operation, attributes: attributes, kind: :client) do super end end private def tracer Dalli::Instrumentation.instance.tracer + end + + def config + Dalli::Instrumentation.instance.config end end end end end