Class: Datadog::OpenFeature::Transport::HTTP::FlagevaluationsSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/open_feature/transport.rb

Overview

API spec for the EVP flagevaluation endpoint. Path: /evp_proxy/v2/api/v2/flagevaluation Header: X-Datadog-EVP-Subdomain: event-platform-intake (same as exposures)

Instance Method Summary collapse

Constructor Details

#initialize ⇒ FlagevaluationsSpec

Returns a new instance of FlagevaluationsSpec.



44
45
46
47
48
# File 'lib/datadog/open_feature/transport.rb', line 44

def initialize
  @endpoint = Core::Transport::HTTP::API::Endpoint.new(
    :post, "/evp_proxy/v2/api/v2/flagevaluation"
  )
end

Instance Method Details

#call(env, &block) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/datadog/open_feature/transport.rb', line 50

def call(env, &block)
  @endpoint.call(env) do |request_env|
    request_env.headers["Content-Type"] = env.request.parcel.content_type
    request_env.headers[Core::EVP::SUBDOMAIN_HEADER_NAME] =
      Core::EVP::EVENT_PLATFORM_INTAKE_SUBDOMAIN
    request_env.headers["DD-EVP-ORIGIN"] = "dd-trace-rb"
    request_env.headers["DD-EVP-ORIGIN-VERSION"] = Datadog::VERSION::STRING
    request_env.body = env.request.parcel.data

    block.call(request_env)
  end
end