Sha256: 2e2bf893d2e5a1c25055c11749c0dd6360ac9ec5e85b498edaefa3a367d62254
Contents?: true
Size: 944 Bytes
Versions: 5
Compression:
Stored size: 944 Bytes
Contents
# frozen_string_literal: true # Copyright The OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 module OpenTelemetry module Instrumentation module Racecar module Patches # This module contains logic to patch Racecar::Consumer module Consumer def produce(payload, topic:, key: nil, partition: nil, partition_key: nil, headers: nil, create_time: nil) attributes = { 'messaging.system' => 'kafka', 'messaging.destination' => topic, 'messaging.destination_kind' => 'topic' } headers ||= {} tracer.in_span("#{topic} publish", attributes: attributes, kind: :producer) do OpenTelemetry.propagation.inject(headers) super end end def tracer Racecar::Instrumentation.instance.tracer end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems