Skip to content

Commit

Permalink
Feature increased custom event limit (#674)
Browse files Browse the repository at this point in the history
* 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 <timpansino@gmail.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
  • Loading branch information
5 people authored Oct 26, 2022
1 parent 7b82cb9 commit caa9485
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions newrelic/api/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
DST_NONE,
DST_TRANSACTION_TRACER,
)
from newrelic.core.config import DEFAULT_RESERVOIR_SIZE, LOG_EVENT_RESERVOIR_SIZE
from newrelic.core.config import CUSTOM_EVENT_RESERVOIR_SIZE, LOG_EVENT_RESERVOIR_SIZE
from newrelic.core.custom_event import create_custom_event
from newrelic.core.log_event_node import LogEventNode
from newrelic.core.stack_trace import exception_stack
Expand Down Expand Up @@ -333,7 +333,7 @@ def __init__(self, application, enabled=None, source=None):
capacity=self._settings.event_harvest_config.harvest_limits.log_event_data
)
else:
self._custom_events = SampledDataSet(capacity=DEFAULT_RESERVOIR_SIZE)
self._custom_events = SampledDataSet(capacity=CUSTOM_EVENT_RESERVOIR_SIZE)
self._log_events = SampledDataSet(capacity=LOG_EVENT_RESERVOIR_SIZE)

def __del__(self):
Expand Down
3 changes: 2 additions & 1 deletion newrelic/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
# reservoir. Error Events have a different default size.

DEFAULT_RESERVOIR_SIZE = 1200
CUSTOM_EVENT_RESERVOIR_SIZE = 3600
ERROR_EVENT_RESERVOIR_SIZE = 100
SPAN_EVENT_RESERVOIR_SIZE = 2000
LOG_EVENT_RESERVOIR_SIZE = 10000
Expand Down Expand Up @@ -738,7 +739,7 @@ def default_host(license_key):
)

_settings.event_harvest_config.harvest_limits.custom_event_data = _environ_as_int(
"NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED", DEFAULT_RESERVOIR_SIZE
"NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED", CUSTOM_EVENT_RESERVOIR_SIZE
)

_settings.event_harvest_config.harvest_limits.span_event_data = _environ_as_int(
Expand Down
8 changes: 4 additions & 4 deletions tests/agent_features/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,12 @@ def test_delete_setting_parent():
TSetting("event_harvest_config.harvest_limits.error_event_data", 100, 100),
),
(
TSetting("custom_insights_events.max_samples_stored", 1200, 1200),
TSetting("event_harvest_config.harvest_limits.custom_event_data", 9999, 1200),
TSetting("custom_insights_events.max_samples_stored", 3600, 3600),
TSetting("event_harvest_config.harvest_limits.custom_event_data", 9999, 3600),
),
(
TSetting("custom_insights_events.max_samples_stored", 9999, 1200),
TSetting("event_harvest_config.harvest_limits.custom_event_data", 1200, 1200),
TSetting("custom_insights_events.max_samples_stored", 9999, 3600),
TSetting("event_harvest_config.harvest_limits.custom_event_data", 3600, 3600),
),
(
TSetting("application_logging.forwarding.max_samples_stored", 10000, 10000),
Expand Down

0 comments on commit caa9485

Please sign in to comment.