Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature increased custom event limit #674

Merged
merged 8 commits into from
Oct 26, 2022
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