Sha256: 0b5dcdc74ee03a77e8aa1d5d69b2634f4422e8e6c0d5f4eaa1446e6b7d4c70ef

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

# frozen_string_literal: true

require "faraday"
require "faraday_middleware"

module Aspecto
  # Aspecto's OpenTelemetry distribution
  module OpenTelemetry
    def self.fetch_config(aspecto_auth)
      aspecto_config_url = ENV["ASPECTO_CONFIG_HOST"] || "https://config.aspecto.io"

      conn = Faraday.new "#{aspecto_config_url}/config/#{aspecto_auth}" do |f|
        f.response :json # decode response bodies as JSON
      end

      ::OpenTelemetry::Common::Utilities.untraced do
        response = conn.get
        response.body
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aspecto-opentelemetry-0.1.1 lib/aspecto/opentelemetry/remote_config.rb