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

Generate metrics reference docs #2164

Merged
merged 16 commits into from
Mar 1, 2024
Merged

Generate metrics reference docs #2164

merged 16 commits into from
Mar 1, 2024

Commits on Mar 1, 2024

  1. tetra: Add metrics-docs command

    This command utilizes github.com/isovalent/metricstool/pkg/metricsmd to
    generate a metrics reference.
    
    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    bcc9620 View commit details
    Browse the repository at this point in the history
  2. Makefile: Add metrics-docs rule

    `make metrics-docs` generates metrics reference documentation page using
    `tetra metrics-docs` command.
    
    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    71bbde8 View commit details
    Browse the repository at this point in the history
  3. metricsconfig: Split InitMetrics and introduce InitMetricsForDocs

    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 <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    a27a421 View commit details
    Browse the repository at this point in the history
  4. tetra: Split metrics reference into sections

    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 <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    f4ce807 View commit details
    Browse the repository at this point in the history
  5. eventmetrics: Initialize metrics with example labels for docs

    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 <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    8ab6167 View commit details
    Browse the repository at this point in the history
  6. kprobemetrics: Initialize metrics with example labels for docs

    Initialize tetragon_generic_kprobe_merge_errors_total with all possible error
    types and example kprobes.
    
    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    816c97b View commit details
    Browse the repository at this point in the history
  7. syscallmetrics: Initialize metrics with example labels for docs

    Initialize tetragon_syscalls_total with example syscall and process metadata.
    
    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    50e20dd View commit details
    Browse the repository at this point in the history
  8. observer: Initialize custom collectors for docs

    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 <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    5f452d2 View commit details
    Browse the repository at this point in the history
  9. eventmetrics: Initialize custom collectors for docs

    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 <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    5e05253 View commit details
    Browse the repository at this point in the history
  10. policystatemetrics: Initialize custom collectors for docs

    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 <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    b5b495d View commit details
    Browse the repository at this point in the history
  11. ci: Check generated metrics docs

    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    4408052 View commit details
    Browse the repository at this point in the history
  12. docs: Add autogenerated metrics reference page

    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    a1f6c84 View commit details
    Browse the repository at this point in the history
  13. Makefile: Document metrics-docs and lint-metrics-md targets

    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    aaac4a6 View commit details
    Browse the repository at this point in the history
  14. docs: Improve metrics reference title and frontmatter

    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    a241c1c View commit details
    Browse the repository at this point in the history
  15. docs: Document how metrics reference is generated

    Use a Hugo shortcode so that the comment isn't rendered into the final HTML.
    
    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    4288a63 View commit details
    Browse the repository at this point in the history
  16. docs: Don't mention github.com/isovalent/metricstool in metrics docs

    It looks a bit odd as it's not rendered as a link, especially in the TOC.
    
    Signed-off-by: Anna Kapuscinska <[email protected]>
    lambdanis committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    b509234 View commit details
    Browse the repository at this point in the history