Class: Middleware::RubyGem::Profile::PyroscopeProfile

Inherits:
Object
  • Object
show all
Defined in:
lib/middleware/profile/pyroscope_profile.rb

Class Method Summary collapse

Class Method Details

.initObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/middleware/profile/pyroscope_profile.rb', line 13

def self.init
  authentication = Auth::Authentication.new
  return unless authentication.auth

  Pyroscope.configure do |config|
    config.application_name = ENV["OTEL_SERVICE_NAME"] || "default-service-name"
    config.server_address = ENV["MW_PROFILING_SERVER_URL"] || "https://profiling.middleware.io"
    config.tenant_id = authentication.get_response['data']['account']
  end

  MwLogger.info("Profiling started")
end