Sha256: 6b230913b18af959bf54c4dcbfb70baf43666922b4d36c76163c8ded07fd861e

Contents?: true

Size: 514 Bytes

Versions: 1

Compression:

Stored size: 514 Bytes

Contents

# frozen_string_literal: true

require "splunk/otel/common"

module Splunk
  module Otel
    module Rack
      # RumMiddleware propagates context and instruments Rack responses
      # by way of its middleware system
      class RumMiddleware
        def initialize(app)
          @app = app
        end

        def call(env)
          status, headers, body = @app.call(env)

          headers = Splunk::Otel::Common.rum_headers(headers)

          [status, headers, body]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
splunk-otel-0.1.0 lib/splunk/otel/instrumentation/rack/middleware.rb