-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Generate metrics reference docs #2164
Conversation
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.
This looks AMAZING 🎉
Where's the Netlify preview link when we need it? |
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.
Thanks, that will be a very useful addition to the doc!! Sorry I reviewed that one first but I wanted to highlight some things on the output of the autogenerated page.
"events": "Tetragon Events", | ||
} | ||
|
||
overrides := []metricsmd.LabelOverrides{ |
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 need to provide "false" values here or can you just pass an empty object? Can be a bit misleading
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.
I could pass empty strings as label values, then the docs would still list the label names but not values.
I'm thinking having example values is helpful (users can see the format), but currently the reference doesn't distinguish between example and real values, so I see how it can be misleading. Maybe the next iteration of metricstool could support rendering example and real label values differently or something.
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.
For the build info labels specifically, we can make them less confusing by updating them on a release too.
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.
I made some comments on the output of your tool, I see two ways of tweaking stuff:
- maybe you want your output to be consistent with a previous behavior and then we need some
sed
commands to modify the output as I do with gRPC and Helm (because I don't control the tool). - you can simply modify your tool output directly.
This will allow to drop the "autogenerated" comment when rendering the metrics reference as a Hugo docs page. Requested here: cilium/tetragon#2164 (comment) Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
This is useful when the metrics reference is embedded in another markdown document. Requested here: cilium/tetragon#2164 (comment) cilium/tetragon#2164 (comment) Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
This will allow to drop the "autogenerated" comment when rendering the metrics reference as a Hugo docs page. Requested here: cilium/tetragon#2164 (comment) Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
This is useful when the metrics reference is embedded in another markdown document. Requested here: cilium/tetragon#2164 (comment) cilium/tetragon#2164 (comment) Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
This is useful when the metrics reference is embedded in another markdown document. Requested here: cilium/tetragon#2164 (comment) cilium/tetragon#2164 (comment) Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
e9566d8
to
f775376
Compare
This is useful when the metrics reference is embedded in another markdown document. Requested here: cilium/tetragon#2164 (comment) cilium/tetragon#2164 (comment) Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
cebc21f
to
b24e3f1
Compare
52ced09
to
0004b79
Compare
This command utilizes github.com/isovalent/metricstool/pkg/metricsmd to generate a metrics reference. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
`make metrics-docs` generates metrics reference documentation page using `tetra metrics-docs` command. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Split InitMetrics function into multiple functions to divide metrics into logical groups. Introduce InitMetricsForDocs function used in `tetra metrics-docs` command. There are no functional changes in this commit. This refactoring is a preparation for further improvements in the generated metrics docs. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
0004b79
to
96d6f7b
Compare
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Update metrics-docs tetra command and Makefile rule to split metrics reference into three sections: health metrics, resources metrics and events metrics. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Initialize tetragon_events_total with all possible event types and example process metadata. Initialize tetragon_policy_events_total with example policy and kprobe. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Initialize tetragon_generic_kprobe_merge_errors_total with all possible error types and example kprobes. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Initialize tetragon_syscalls_total with example syscall and process metadata. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
observer.bpfCollector doesn't report any metrics if Tetragon isn't fully initialized - so also when we generate metrics docs with tetra. To include observer BPF metrics in metrics docs, let's define a "fake" collector - observer.bpfZeroCollector - reporting same metrics as observer.bpfCollector but with hardcoded zero values. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
eventmetrics.bpfCollector doesn't report any metrics if Tetragon isn't fully initialized - so also when we generate metrics docs with tetra. To include BPF event metrics in metrics docs, let's define a "fake" collector - eventmetrics.bpfZeroCollector - reporting same metrics as eventmetrics.bpfCollector but with hardcoded zero values. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
policyStateCollector doesn't report any metrics if Tetragon isn't fully initialized - so also when we generate metrics docs with tetra. To include policy state metrics in metrics docs, let's define a "fake" collector - policyStateZeroCollector - reporting same metrics as policyStateZeroCollector but with hardcoded zero values. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Use a Hugo shortcode so that the comment isn't rendered into the final HTML. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
96d6f7b
to
4288a63
Compare
Ok, after a few rebases this should be good now. Here is the final docs preview: https://deploy-preview-2164--tetragon.netlify.app/docs/reference/metrics/ |
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.
I think it looks good now and will be very useful, thanks a lot!
| `commit` | `931b70f2c9878ba985ba6b589827bea17da6ec33` | | ||
| `go_version` | `go1.22.0` | | ||
| `modified` | `false` | | ||
| `time ` | `2022-05-13T15:54:45Z` | |
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.
I like that it's referencing the OSS commit 😻
It looks a bit odd as it's not rendered as a link, especially in the TOC. Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
Add a metrics reference documentation page, autogenerated with github.com/isovalent/metricstool.
Fixes #1856