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

Add file count metric to filestats receiver #24651

Closed
cxhiggins opened this issue Jul 27, 2023 · 6 comments · Fixed by #30191
Closed

Add file count metric to filestats receiver #24651

cxhiggins opened this issue Jul 27, 2023 · 6 comments · Fixed by #30191
Assignees
Labels
enhancement New feature or request receiver/filestats

Comments

@cxhiggins
Copy link

Component(s)

receiver/filestats

Is your feature request related to a problem? Please describe.

I use OpenTelemetry in a deployment which saves all coredumps to a specific folder, and want to export a metric describing the number of cores dumped. This would allow us to enable alerting when processes crash.

Describe the solution you'd like

Ideally the filestats receiver would implement a file.count metric, or something similar, which tracks the number of files which match the specified include parameter.

Unit Metric Type Value Type
1 Gauge Int

Describe alternatives you've considered

I tried using hostmetricsreceiver with a root_path set to our coredump directory, but unfortunately all instances of this receiver must share the same root_path and our other use of the receiver took priority.

Additional context

No response

@cxhiggins cxhiggins added enhancement New feature or request needs triage New item requiring triage labels Jul 27, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme
Copy link
Contributor

atoulme commented Jul 29, 2023

That's a cool enhancement. Would you like to contribute it?

@atoulme atoulme removed the needs triage New item requiring triage label Jul 29, 2023
@atoulme atoulme changed the title File count receiver Add file count metric to filestats receiver Jul 29, 2023
@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Sep 28, 2023
@atoulme
Copy link
Contributor

atoulme commented Sep 28, 2023

Rethinking this - you can get this information by counting the number of MTS coming from the receiver. I think that gets you what you need. The hostmetrics receiver is also no longer setting env vars, so you can use multiple receivers with different root paths. With that, I think I'll close this issue.

@atoulme atoulme closed this as completed Sep 28, 2023
@stef-philipsen-tfs
Copy link

Is it possible to re-open this issue? I think this feature would still be useful.

I want to monitor the amount of files that are currently in a directory.

I'm currently using the Datadog agent for this, which is reporting the number of files in the configured folder. This is reported as one metric/one value.

If I would report it via OpenTelemetry in the way described above, this would mean that I would get as many metrics as there are files, which could get expensive depending on the number of files in the directory.

The low cardinality version of the metric would suffice in my use case, since I don't need to know which files are in the directory.

@atoulme atoulme reopened this Dec 22, 2023
@atoulme
Copy link
Contributor

atoulme commented Dec 22, 2023

OK that’s a valid use. Reopening

@github-actions github-actions bot removed the Stale label Dec 23, 2023
@atoulme atoulme self-assigned this Dec 23, 2023
dmitryax added a commit that referenced this issue Jan 9, 2024
**Description:**
Add a file.count metric to filestatsreceiver that reports the number of
files matched by the receiver

**Link to tracking Issue:**
Fixes #24651

---------

Co-authored-by: Dmitrii Anoshin <[email protected]>
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this issue Jan 10, 2024
**Description:**
Add a file.count metric to filestatsreceiver that reports the number of
files matched by the receiver

**Link to tracking Issue:**
Fixes open-telemetry#24651

---------

Co-authored-by: Dmitrii Anoshin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request receiver/filestats
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants