Skip to content

Commit caa9485

Browse files
hmstepanekTimPansinoumaannamalai
authored
Feature increased custom event limit (#674)
* Update reservoir size for custom events. * [Mega-Linter] Apply linters fixes * Increase custom event limit. (#666) * Remove duplicated CUSTOM_EVENT_RESERVOIR_SIZE Co-authored-by: Tim Pansino <[email protected]> Co-authored-by: TimPansino <[email protected]> Co-authored-by: Timothy Pansino <[email protected]> Co-authored-by: Uma Annamalai <[email protected]>
1 parent 7b82cb9 commit caa9485

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

newrelic/api/transaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
DST_NONE,
6060
DST_TRANSACTION_TRACER,
6161
)
62-
from newrelic.core.config import DEFAULT_RESERVOIR_SIZE, LOG_EVENT_RESERVOIR_SIZE
62+
from newrelic.core.config import CUSTOM_EVENT_RESERVOIR_SIZE, LOG_EVENT_RESERVOIR_SIZE
6363
from newrelic.core.custom_event import create_custom_event
6464
from newrelic.core.log_event_node import LogEventNode
6565
from newrelic.core.stack_trace import exception_stack
@@ -333,7 +333,7 @@ def __init__(self, application, enabled=None, source=None):
333333
capacity=self._settings.event_harvest_config.harvest_limits.log_event_data
334334
)
335335
else:
336-
self._custom_events = SampledDataSet(capacity=DEFAULT_RESERVOIR_SIZE)
336+
self._custom_events = SampledDataSet(capacity=CUSTOM_EVENT_RESERVOIR_SIZE)
337337
self._log_events = SampledDataSet(capacity=LOG_EVENT_RESERVOIR_SIZE)
338338

339339
def __del__(self):

newrelic/core/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
# reservoir. Error Events have a different default size.
5353

5454
DEFAULT_RESERVOIR_SIZE = 1200
55+
CUSTOM_EVENT_RESERVOIR_SIZE = 3600
5556
ERROR_EVENT_RESERVOIR_SIZE = 100
5657
SPAN_EVENT_RESERVOIR_SIZE = 2000
5758
LOG_EVENT_RESERVOIR_SIZE = 10000
@@ -738,7 +739,7 @@ def default_host(license_key):
738739
)
739740

740741
_settings.event_harvest_config.harvest_limits.custom_event_data = _environ_as_int(
741-
"NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED", DEFAULT_RESERVOIR_SIZE
742+
"NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED", CUSTOM_EVENT_RESERVOIR_SIZE
742743
)
743744

744745
_settings.event_harvest_config.harvest_limits.span_event_data = _environ_as_int(

tests/agent_features/test_configuration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,12 @@ def test_delete_setting_parent():
438438
TSetting("event_harvest_config.harvest_limits.error_event_data", 100, 100),
439439
),
440440
(
441-
TSetting("custom_insights_events.max_samples_stored", 1200, 1200),
442-
TSetting("event_harvest_config.harvest_limits.custom_event_data", 9999, 1200),
441+
TSetting("custom_insights_events.max_samples_stored", 3600, 3600),
442+
TSetting("event_harvest_config.harvest_limits.custom_event_data", 9999, 3600),
443443
),
444444
(
445-
TSetting("custom_insights_events.max_samples_stored", 9999, 1200),
446-
TSetting("event_harvest_config.harvest_limits.custom_event_data", 1200, 1200),
445+
TSetting("custom_insights_events.max_samples_stored", 9999, 3600),
446+
TSetting("event_harvest_config.harvest_limits.custom_event_data", 3600, 3600),
447447
),
448448
(
449449
TSetting("application_logging.forwarding.max_samples_stored", 10000, 10000),

0 commit comments

Comments
 (0)