-
Notifications
You must be signed in to change notification settings - Fork 1
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
Catch up to spectator-cpp #3
Conversation
This change is a companion to the fix for monotonic counter implementations in spectatord. Netflix-Skunkworks/spectatord#90 The original monotonic counter (`C`) was always intended to be used for the case where a monotonic data source needs to be transformed into base units for recording data. For example, transforming nanoseconds into seconds. This requires division, which results in floats. There is a valid use case for handling uints in monotonic counters, if the data source is already in a base unit, such as bytes. Thus, a new meter type `U` is added to spectatord which supports this use case.
It was using the existing `send` method, which formatted the value as a float, when it needs to be formatted as a uint.
It is easy enough to break the spectatord line protocol, if any of the control characters (`:,=`) are inserted in unexpected places. Since metric names and tags are often programmatically generated, we want to only construct id strings which are valid.
This file is generated by tools/gen_valid_chars.
The write up is excellent, thanks for all the details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to also check in the docker run script you wrote for the tests?
#include <array> | ||
#include <fstream> | ||
|
||
void dump_array(std::ostream& os, const std::string& name, const std::array<bool, 256>& chars) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this file useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That file is used to generate spectator/valid_chars.inc
, which is not checked in by the upstream.
The upstream library calls this tool at build time to generate valid_chars.inc
. I ended up calling it locally to generate the file.
Description
This change updates the fork to catch up with Netflix/spectator-cpp.
The main change that was needed was the commit that replaces invalid characters in ids, but I pulled in another couple of changes that happened before that. That fix is needed to address an issue where some IPC metrics are being silently dropped due to having invalid characters in tags.
NOTE: There are a couple departures from the upstream repo:
spectator/valid_chars.inc
into git, rather than having it be auto-generated. This was also to facilitate import into proxyd.How was this tested?
The repo's GitHub actions don't run against forks, so I built a container to build and test the library based on the CI script: