Class: Datadog::DI::Transport::HTTP::Diagnostics::API::Endpoint Private

Inherits:
Core::Transport::HTTP::API::Endpoint show all
Defined in:
lib/datadog/di/transport/http/diagnostics.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Endpoint for negotiation

Instance Attribute Summary collapse

Attributes inherited from Core::Transport::HTTP::API::Endpoint

#path, #verb

Instance Method Summary collapse

Constructor Details

#initialize(path, encoder) ⇒ Endpoint

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Endpoint.



45
46
47
48
# File 'lib/datadog/di/transport/http/diagnostics.rb', line 45

def initialize(path, encoder)
  super(:post, path)
  @encoder = encoder
end

Instance Attribute Details

#encoderObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



43
44
45
# File 'lib/datadog/di/transport/http/diagnostics.rb', line 43

def encoder
  @encoder
end

Instance Method Details

#call(env, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



50
51
52
53
54
55
56
57
# File 'lib/datadog/di/transport/http/diagnostics.rb', line 50

def call(env, &block)
  event_payload = Core::Vendor::Multipart::Post::UploadIO.new(
    StringIO.new(env.request.parcel.data), 'application/json', 'event.json'
  )
  env.form = {'event' => event_payload}

  super
end