Skip to content

Commit

Permalink
Update Custom Event sample size default value. (#1284)
Browse files Browse the repository at this point in the history
* change default value.

* Add CHANGELOG.

* fix CHANGELOG.md

* Fix a failing test.
  • Loading branch information
vuqtran88 authored Oct 25, 2022
1 parent 57d0dcb commit 3ab9337
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/Agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/Agent/NewRelic/Agent/Core/Config/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2466,7 +2466,7 @@ public configurationCustomEvents()
{
this.attributesField = new configurationCustomEventsAttributes();
this.enabledField = true;
this.maximumSamplesStoredField = 10000;
this.maximumSamplesStoredField = 30000;
}

public configurationCustomEventsAttributes attributes
Expand Down Expand Up @@ -2496,7 +2496,7 @@ public bool enabled
}

[System.Xml.Serialization.XmlAttributeAttribute()]
[System.ComponentModel.DefaultValueAttribute(10000)]
[System.ComponentModel.DefaultValueAttribute(30000)]
public int maximumSamplesStored
{
get
Expand Down
2 changes: 1 addition & 1 deletion src/Agent/NewRelic/Agent/Core/Config/Configuration.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="maximumSamplesStored" type="xs:int" default="10000">
<xs:attribute name="maximumSamplesStored" type="xs:int" default="30000">
<xs:annotation>
<xs:documentation>
The maximum number of samples to store in memory at a time. Default is 10000.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3ab9337

Please sign in to comment.