# 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