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

spectator-go design considerations #184

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/spectator/lang/go/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,12 @@ by providing one as the third parameter of the `Config` constructor.
Use [spectator-go-runtime-metrics](https://github.com/Netflix/spectator-go-runtime-metrics). Follow
instructions in the [README](https://github.com/Netflix/spectator-go-runtime-metrics) to enable
collection.

## Design Considerations - Reporting Intervals

This client is stateless, and sends a UDP packet (or unixgram) to `spectatord` each time a meter is
updated. If you are performing high-volume operations, on the order of tens-of-thousands or millions
of operations per second, then you should pre-aggregate your metrics and report them at a cadence
closer to the `spectatord` publish interval of 5 seconds, or the Atlas metrics granularity of 1 minute.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that high resolution streaming is gaining more usage, I would omit the 1m part and just advise to batch and send every ~5s.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Batching as a feature is not yet available in spectator-go, but it will be added before the end of the quarter.

Good point on the timing aspect, though!

This will keep the CPU usage related to `spectator-go` and `spectatord` low (around 1% or less), as
compared to up to 40% for high-volume scenarios.