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

feat!: Change type of DD_TRACE_RATE_LIMIT to int #160

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zacharycmontoya
Copy link
Contributor

@zacharycmontoya zacharycmontoya commented Oct 3, 2024

Description

Changes the type of the DD_TRACE_RATE_LIMIT input to int (previously double)

Motivation

This aligns the cpp tracer behavior for DD_TRACE_RATE_LIMIT with the expected behavior of all the tracers in our Config Consistency initiative, such that only integer values are used.

Additional Notes

This may be unnecessary as we may be able to standardize our documentation that only integer values are accepted (what even is 0.1 of a trace?) and in doing so we are still compatible because integers on the command line can still be interpreted as a double. However, it could be good to do this in the type system just to be more specific. Thoughts?

Jira ticket: APMAPI-511

…ault value of DD_TRACE_RATE_LIMIT to 100

Issues: APMAPI-511
@dgoffredo
Copy link
Contributor

what even is 0.1 of a trace?

0.1 traces in a second is 1 trace in 10 seconds. DD_TRACE_RATE_LIMIT has units of "traces per second," not "traces."

Possibly best to make it an integer for consistency's sake, but I did make sure that the existing Limiter implementation could handle values smaller than 1.

@zacharycmontoya
Copy link
Contributor Author

what even is 0.1 of a trace?

0.1 traces in a second is 1 trace in 10 seconds. DD_TRACE_RATE_LIMIT has units of "traces per second," not "traces."

Possibly best to make it an integer for consistency's sake, but I did make sure that the existing Limiter implementation could handle values smaller than 1.

Ah you're right since it's traces per second it makes sense why this was implemented as a double earlier. It seems that the remaining languages only use integer values so there's a strong motivation to align. Thanks for clearing that up @dgoffredo 😄

@zacharycmontoya zacharycmontoya force-pushed the zach.montoya/config-consistency/rate-limit-int branch from a685dc5 to 067edaa Compare October 3, 2024 23:45
…o only accept ints instead of doubles, in alignment with the rest of the tracers

Issues: APMAPI-511
@zacharycmontoya zacharycmontoya force-pushed the zach.montoya/config-consistency/rate-limit-int branch from 067edaa to d059561 Compare October 3, 2024 23:47
@pr-commenter
Copy link

pr-commenter bot commented Oct 3, 2024

Benchmarks

Benchmark execution time: 2024-10-04 00:07:10

Comparing candidate commit c7ce9e3 in PR branch zach.montoya/config-consistency/rate-limit-int with baseline commit f682d03 in branch zach.montoya/config-consistency/rate-limit.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@zacharycmontoya zacharycmontoya force-pushed the zach.montoya/config-consistency/rate-limit-int branch from ef43ce3 to c7ce9e3 Compare October 4, 2024 00:05
Base automatically changed from zach.montoya/config-consistency/rate-limit to main October 7, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants