metrics-probe: add new parser which generates stats counters#4318
Merged
Conversation
Contributor
|
No news file has been detected. Please write one, if applicable. |
4132a5a to
ca0884a
Compare
Contributor
|
Build FAILURE |
Collaborator
Author
|
@kira-syslogng retest this please |
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 10, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
ca0884a to
0f3fa59
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 15, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
0f3fa59 to
6721749
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 16, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
6721749 to
024bd1b
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 16, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
024bd1b to
f71a744
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 16, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
f71a744 to
3949620
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 16, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
3949620 to
b4ce059
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 17, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
b4ce059 to
84e20b8
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 20, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
84e20b8 to
ec70003
Compare
MrAnno
reviewed
Feb 20, 2023
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 21, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
ec70003 to
0a10951
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 21, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
0a10951 to
c07e011
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 24, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
c07e011 to
ae08f3a
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 27, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
ae08f3a to
0f4841f
Compare
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 28, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
0f4841f to
7d4aa53
Compare
MrAnno
previously approved these changes
Feb 28, 2023
As single stats clusters always store only one counter, we can always pinpoint that. Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
This can be useful for plugins, which implement (de)initializable Thread Local Storage variables. Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
This kind of parser counts messages passing through, based on the metadata of each message. It creates labeled stats counters based on the fields of the message. Both the key and labels can be set in the config, the values of the labels can be templated. This commit creates the skeleton for this parser, the implementation will be done in the following commits. Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
This will be useful for storing and formatting the label templates set in the config. Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Why do we need to limit the number of labels? We need allocated memory for the formatted labels, so we can create a `StatsClusterKey` from them. We could store a buffer for them in the class, but that would make it stateful, which means we need to lock it in the `process()` function Alternatively we could `malloc()` it in each `process()` call, but it is costly. If the number of labels is limited, we can allocate them on the stack in the `process()` function, which means we save a per message `malloc()` and manage to keep the parser stateless. The downside is that we put a limit on it, but I don't think that having more than 32 labels is sensible. Everything mentioned in this commit message will become cleaner in the next commits, where the labels get used. Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
7d4aa53 to
4b9cb8d
Compare
MrAnno
approved these changes
Feb 28, 2023
Genfood
pushed a commit
to Genfood/syslog-ng
that referenced
this pull request
Jun 14, 2023
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This kind of parser counts messages passing through, based on the metadata of each message. It creates labeled stats counters based on the fields of the message. Both the key and labels can be set in the config, the values of the labels can be templated.
Both the key and labels can be set in the config, the values of the labels can be templated. E.g.:
With this config, it creates counters like these:
The minimal config creates counters with the key
syslogng_classified_events_totaland labelsapp,host,programandsource. E.g.:With this config, it creates counters like these:
Depends on #4325
Signed-off-by: Attila Szakacs szakacs.attila96@gmail.com