Esempio n. 1
0
        private LambdaTracer()
        {
            _logger           = new Logger();
            ScopeManager      = new AsyncLocalScopeManager();
            AdaptiveSampler   = new AdaptiveSampler(Target, Interval, new Random());
            AccountId         = Environment.GetEnvironmentVariable("NEW_RELIC_ACCOUNT_ID") ?? string.Empty;
            TrustedAccountKey = Environment.GetEnvironmentVariable("NEW_RELIC_TRUSTED_ACCOUNT_KEY") ?? string.Empty;
            var primaryAppId = Environment.GetEnvironmentVariable("NEW_RELIC_PRIMARY_APPLICATION_ID");

            PrimaryApplicationId = string.IsNullOrEmpty(primaryAppId) ? "Unknown" : primaryAppId;

            var debug = Environment.GetEnvironmentVariable("NEW_RELIC_DEBUG_MODE");

            DebugMode = !string.IsNullOrEmpty(debug) && debug.Trim().ToLower() == "true" ? true : false;
        }
 public void ApplyAdaptiveSampling(AdaptiveSampler adaptiveSampler)
 {
     adaptiveSampler.RequestStarted();
     PrioritySamplingState.SetSampledAndGeneratePriority(adaptiveSampler.ComputeSampled());
 }