Skip to content
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

Define map metrics as custom collectors #1510

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

lambdanis
Copy link
Contributor

@lambdanis lambdanis commented Sep 26, 2023

This PR reimplements two metrics: tetragon_map_in_use_gauge and
tetragon_map_errors_total, so that they are exposed by custom Prometheus
collectors. This means that metric values are read from BPF maps at the scrape
time, without a need for a userland tickers. From the user perspective, the
metrics are more accurate.

Additionally, the errors metric is exposed as a counter instead of a gauge.

Collect tetragon_map_in_use_gauge and tetragon_map_errors_total metrics directly from BPF maps at the scrape time. Expose the tetragon_map_errors_total metrics as a counter instead of a gauge.

@lambdanis lambdanis force-pushed the pr/lambdanis/bpf-metrics branch from 5c8eaa0 to dea9dc2 Compare September 26, 2023 15:18
@lambdanis lambdanis added the release-note/minor This PR introduces a minor user-visible change label Sep 26, 2023
@lambdanis lambdanis force-pushed the pr/lambdanis/bpf-metrics branch from dea9dc2 to 28bba16 Compare September 29, 2023 19:20
@lambdanis lambdanis added the area/metrics Related to prometheus metrics label Sep 29, 2023
@lambdanis lambdanis force-pushed the pr/lambdanis/bpf-metrics branch 2 times, most recently from f6f3b32 to bdd0a0b Compare September 30, 2023 00:33
@lambdanis lambdanis changed the title [WIP] Define map metrics as custom collectors Define map metrics as custom collectors Sep 30, 2023
@lambdanis lambdanis marked this pull request as ready for review September 30, 2023 00:38
@lambdanis lambdanis requested a review from a team as a code owner September 30, 2023 00:38
@lambdanis lambdanis force-pushed the pr/lambdanis/bpf-metrics branch 4 times, most recently from 0968029 to aa045e9 Compare October 2, 2023 20:45
These types are slim helpers intended to be used in custom collectors that read
metrics directly from BPF maps.

Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
This commit reimplements two metrics: tetragon_map_in_use_gauge and
tetragon_map_errors_total, so that they are exposed by custom Prometheus
collectors. This means that metric values are read from BPF maps at the scrape
time, without a need for a userland tickers. From the user perspective, the
metrics are more accurate.

Additionally, the errors metric is exposed as a counter instead of a gauge.

Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
@lambdanis lambdanis force-pushed the pr/lambdanis/bpf-metrics branch from aa045e9 to afdcbb9 Compare October 3, 2023 07:45
Copy link
Contributor

@kevsecurity kevsecurity left a comment

Choose a reason for hiding this comment

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

LGTM

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/metrics Related to prometheus metrics release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants