Sha256: bf0c9638df3d5dc4989a7c46e329a9d694b9c311fb2c564ae75927235bab0343

Contents?: true

Size: 704 Bytes

Versions: 5

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true

require_relative '../auth/authentication'
require_relative '../logger'
require "pyroscope"

module Middleware
  module RubyGem
    module Profile

      class PyroscopeProfile

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

          Pyroscope.configure do |config|
            config.application_name = "test.mw.app"
            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

      end

    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
middleware_apm-1.0.0 lib/middleware/profile/pyroscope_profile.rb
middleware_apm_dp-1.0.0 lib/middleware/profile/pyroscope_profile.rb
middleware_apm_dp-0.3.0 lib/middleware/profile/pyroscope_profile.rb
middleware_apm_dp-0.2.0 lib/middleware/profile/pyroscope_profile.rb
middleware_apm-0.2.0 lib/middleware/profile/pyroscope_profile.rb