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

Support for buffer_timekeys metric #89

Closed
stevenjm opened this issue Mar 29, 2019 · 4 comments
Closed

Support for buffer_timekeys metric #89

stevenjm opened this issue Mar 29, 2019 · 4 comments

Comments

@stevenjm
Copy link
Contributor

Hi,

I've recently had a buffer_timekeys metric added to fluentd, and I'd like to add support for this to the prometheus plugin.

However, this metric takes the form of a list and I'm not sure how best to represent this as a Prometheus metric. I can see a few options:

  1. Add one gauge metric per list item, and delete these every time we refresh the list index. This seems like a hack.
  2. Imitate a histogram by calculating a set of quantiles from the list data. In implementation, this would also be a set of gauge metrics, but recalculated and updated periodically.
  3. As a special case of the above, only provide the newest and oldest timekeys. This is probably sufficient for most monitoring requirements, but ignores most of the source data.

All of these are straightforward to implement, and I'm willing to raise a PR with an implementation. I'm just interested in first finding out what you think the best approach is.

@kazegusuri
Copy link
Collaborator

I'm 100% not sure about the feature. I guess each buffer chunks have created time and the buffer instance have a list of the time.
What use case do you consider to send those information to prometheus?
I think the oldest chunk's created time is only useful. So it's better to have option 3.

3\. As a special case of the above, only provide the newest and oldest timekeys. This is probably sufficient for most monitoring requirements, but ignores most of the source data.

@stevenjm
Copy link
Contributor Author

stevenjm commented May 24, 2019

The timekey of a chunk is not its creation time, but it represents a time range for the log events it can contain. See https://docs.fluentd.org/configuration/buffer-section#time.

I can see a use case for both the oldest and newest chunks. Monitoring the oldest one gives insight into delays within fluentd itself, while monitoring the newest can give insight into delays upstream of fluentd -- that is, if the newest message fluentd has is 5 minutes old, then whatever is sending logs to fluentd is delayed.

I'm fine with only exposing these two metrics if you think that's best. I'll work on a PR for that if nobody else has any other views.

stevenjm added a commit to usabilla/fluent-plugin-prometheus that referenced this issue May 29, 2019
A metric listing all timekeys in each buffer was added to fluentd
in <fluent/fluentd#2343>. This exports the
oldest and newest values in that list as Prometheus metrics. See
discussion in
<fluent#89> for
context and rationale.
stevenjm added a commit to usabilla/fluent-plugin-prometheus that referenced this issue May 29, 2019
A metric listing all timekeys in each buffer was added to fluentd
in <fluent/fluentd#2343>. This exports the
oldest and newest values in that list as Prometheus metrics. See
discussion in
<fluent#89> for
context and rationale.

Signed-off-by: Steven McDonald <steven.mcdonald@usabilla.com>
@stevenjm
Copy link
Contributor Author

I've raised #97 as a proposed implementation.

stevenjm added a commit to usabilla/fluent-plugin-prometheus that referenced this issue Aug 7, 2019
A metric listing all timekeys in each buffer was added to fluentd
in <fluent/fluentd#2343>. This exports the
oldest and newest values in that list as Prometheus metrics. See
discussion in
<fluent#89> for
context and rationale.

Signed-off-by: Steven McDonald <steven.mcdonald@usabilla.com>
@stevenjm
Copy link
Contributor Author

Implemented by #97.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants