-
Notifications
You must be signed in to change notification settings - Fork 70
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
Edit pass over telemetry docs #268
Conversation
This mainly updates the documentation to cover the new Telemetry framework more fully, and remove references to prior functionality that are no longer correct. It also moves up coverage of how to export telemetry, since that's arguably what regular users will care about more than how to build out your own additional telemetry. I left those examples mostly unchanged though, they're really great. I did switch their port to 9090 since it's Prometheus's suggested default, and I simplified the sample outputs because it has in fact changed -- we no longer include timestamps in the exposition, and trailing fractional zeroes are now truncated as well ("1.0000" -> "1").
471a1d5
to
e32484a
Compare
Interesting. I guess we must have output the trailing zeroes and the timestamp as part of the Broker output, and prometheus-cpp doesn't do that. |
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.
Looks good to me. I had a couple of minor nits I'll fix during merge. I'll also cherry-pick this over into the 7.0 release branch.
Native Prometheus Export | ||
------------------------ | ||
|
||
Every Zeek process, regardless of whether it's runnig long-term standalone or as |
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.
Every Zeek process, regardless of whether it's runnig long-term standalone or as | |
Every Zeek process, regardless of whether it's running long-term standalone or as |
<https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#text-format-example>`_. | ||
|
||
The :zeek:see:`Telemetry::metrics_port` variable controls this behavior. Its | ||
default of ``0/unknown`` won't expose the port; setting it to another TCP port |
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.
default of ``0/unknown`` won't expose the port; setting it to another TCP port | |
default of ``0/unknown`` disables exposing the port; setting it to another TCP port |
This mainly expands the framework's documentation to give a bit more context on Prometheus, and moves the description of how to get telemetry out of Zeek up, before we give examples of the framework's use (which I think matters more for developers).
I noticed a few discrepancies while updating the code examples:
MetricOpts
says theunit
field is optional, but omitting it actually causes errors in the metrics registration functions (just search for unguarded access to$unit
—opts$unit
). I think that fix can wait for the first point release, particularly since existing code will still set the unit.This was a nice reminder that we'd catch such things earlier if we had a setup that automatically runs the documentation's code examples as btests, or some such.
The PR also updates the management framework side, though the changes here are much smaller.