From 3ab9337e8b3b8cecd8e08d87b3e29047c2736f1b Mon Sep 17 00:00:00 2001 From: Vu Tran Date: Tue, 25 Oct 2022 13:24:54 -0700 Subject: [PATCH] Update Custom Event sample size default value. (#1284) * change default value. * Add CHANGELOG. * fix CHANGELOG.md * Fix a failing test. --- src/Agent/CHANGELOG.md | 2 ++ src/Agent/NewRelic/Agent/Core/Config/Configuration.cs | 4 ++-- src/Agent/NewRelic/Agent/Core/Config/Configuration.xsd | 2 +- .../Core.UnitTest/Configuration/DefaultConfigurationTests.cs | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Agent/CHANGELOG.md b/src/Agent/CHANGELOG.md index fdb8fcb42d..8e969f6100 100644 --- a/src/Agent/CHANGELOG.md +++ b/src/Agent/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### New Features +* Custom Event Limit Increase + * This version increases the default limit of custom events from 10,000 events per minute to 30,000 events per minute. In the scenario that custom events were being limited, this change will allow more custom events to be sent to New Relic. There is also a new configurable maximum limit of 100,000 events per minute. To change the limits, see the documentation for [max_samples_stored](https://docs.newrelic.com/docs/apm/agents/net-agent/configuration/net-agent-configuration/#custom_events). To learn more about the change and how to determine if custom events are being dropped, see our Explorers Hub [post](https://discuss.newrelic.com/t/send-more-custom-events-with-the-latest-apm-agents/190497). [#1284](https://github.com/newrelic/newrelic-dotnet-agent/pull/1284) ### Fixes diff --git a/src/Agent/NewRelic/Agent/Core/Config/Configuration.cs b/src/Agent/NewRelic/Agent/Core/Config/Configuration.cs index 00ce8d44bc..31a3cce25f 100644 --- a/src/Agent/NewRelic/Agent/Core/Config/Configuration.cs +++ b/src/Agent/NewRelic/Agent/Core/Config/Configuration.cs @@ -2466,7 +2466,7 @@ public configurationCustomEvents() { this.attributesField = new configurationCustomEventsAttributes(); this.enabledField = true; - this.maximumSamplesStoredField = 10000; + this.maximumSamplesStoredField = 30000; } public configurationCustomEventsAttributes attributes @@ -2496,7 +2496,7 @@ public bool enabled } [System.Xml.Serialization.XmlAttributeAttribute()] - [System.ComponentModel.DefaultValueAttribute(10000)] + [System.ComponentModel.DefaultValueAttribute(30000)] public int maximumSamplesStored { get diff --git a/src/Agent/NewRelic/Agent/Core/Config/Configuration.xsd b/src/Agent/NewRelic/Agent/Core/Config/Configuration.xsd index 17b121302d..d409b38a18 100644 --- a/src/Agent/NewRelic/Agent/Core/Config/Configuration.xsd +++ b/src/Agent/NewRelic/Agent/Core/Config/Configuration.xsd @@ -736,7 +736,7 @@ - + The maximum number of samples to store in memory at a time. Default is 10000. diff --git a/tests/Agent/UnitTests/Core.UnitTest/Configuration/DefaultConfigurationTests.cs b/tests/Agent/UnitTests/Core.UnitTest/Configuration/DefaultConfigurationTests.cs index f07dd38037..b42ec9bb64 100644 --- a/tests/Agent/UnitTests/Core.UnitTest/Configuration/DefaultConfigurationTests.cs +++ b/tests/Agent/UnitTests/Core.UnitTest/Configuration/DefaultConfigurationTests.cs @@ -2992,7 +2992,7 @@ public bool CustomEventsEnabledMostSecureWinsWithSecurityPolicies(bool localEnab [Test] public void CustomEventsMaxSamplesStoredPassesThroughToLocalConfig() { - Assert.That(_defaultConfig.CustomEventsMaximumSamplesStored, Is.EqualTo(10000)); + Assert.That(_defaultConfig.CustomEventsMaximumSamplesStored, Is.EqualTo(30000)); _localConfig.customEvents.maximumSamplesStored = 10001; Assert.That(_defaultConfig.CustomEventsMaximumSamplesStored, Is.EqualTo(10001)); @@ -3021,7 +3021,7 @@ public void CustomEventsMaxSamplesStoredOverriddenByEventHarvestConfig() [TestCase(null, 20, 30, ExpectedResult = 30)] [TestCase(null, null, 30, ExpectedResult = 30)] [TestCase(null, 20, null, ExpectedResult = 20)] - [TestCase(null, null, null, ExpectedResult = 10000)] + [TestCase(null, null, null, ExpectedResult = 30000)] public int CustomEventsMaxSamplesStoredOverriddenByEnvironment(string environmentSetting, int? localSetting, int? serverSetting) { Mock.Arrange(() => _environment.GetEnvironmentVariable("MAX_EVENT_SAMPLES_STORED")).Returns(environmentSetting);