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
account = authentication.get_response['data']['account']
Pyroscope.configure do |config|
config.application_name = ENV["OTEL_SERVICE_NAME"] || "default-service-name"
config.server_address = ENV["MW_PROFILING_SERVER_URL"] || "https://#{account}.middleware.io/profiling"
config.tenant_id = account
end
MwLogger.info("Profiling started")
end
|