Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
refactor!(libsinsp): coherent metrics interface
metrics_collector
class + text-based Prometheus exposition format support #1652refactor!(libsinsp): coherent metrics interface
metrics_collector
class + text-based Prometheus exposition format support #1652Changes from 1 commit
09f01ea
9522254
535d592
3fc1828
172d958
68f0554
40ebff3
8000c0c
94b1d22
99c6ebb
44b1b3c
289c63b
24d01f4
a5e9b50
bcb3368
a2b4e1c
b5a4831
f034066
9c482ff
dbfcfad
33a34ca
2c3092e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 start to think that an helper method to fill stats would be a good addition (perhaps even in a followup PR), like:
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 see that there is the
new_metric
method, perhaps we could use it in other places too, outside of metrics_collector?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.
Tracking it here #1463 (comment)
The
new_metric
method is a template in CPP. In addition for the scap stats for example we have inner loops where we only update the value, e.g. seelibs/userspace/libscap/engine/bpf/scap_bpf.c
Line 1738 in 5dc692e
Let's think more about it? I believe the real dilemma of
metrics
is that one part is in C while the other part is in CPP, so it's difficult to find a shared approach that would follow best practices either way. I'll repeat this in my next response below. That's also why I use the arrays approach with the metrics names as that's how we do it in scap / C. I am still not sure, how a really great metrics framework that spans scap and sinsp + pending falco rules counts metrics category should look like frankly.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.
Yep, you are right, i thought about this thing later on. I am not sure how (and if we can) to proceed, i agree to "save the idea" for later; let's see if anyone comes with a good solution.