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 totalsize metric in MongoDB collstats metricset #42003

Open
ishleenk17 opened this issue Dec 12, 2024 · 9 comments · May be fixed by #42171
Open

Add totalsize metric in MongoDB collstats metricset #42003

ishleenk17 opened this issue Dec 12, 2024 · 9 comments · May be fixed by #42171
Assignees
Labels
Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team

Comments

@ishleenk17
Copy link
Contributor

Describe the enhancement:

Add the totalsize metric to mongodb collstats.
This is an important metric to report the total size of the collection.

Once this is added to the beats module, we should add the same to Integrations datastream as well.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 12, 2024
@lalit-satapathy lalit-satapathy added the Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team label Dec 23, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 23, 2024
@ishleenk17
Copy link
Contributor Author

We should revisit all the collstats metrics as I think we should add couple other important metrics as well.
The list of the metrics available .

@stefans-elastic
Copy link
Contributor

This confuses me a bit: it looks like collstats module doesn't actually return collstats data. It return results of top command: https://github.com/elastic/beats/blob/main/metricbeat/module/mongodb/collstats/collstats.go#L79
Also if we are going to fetch collstats metrics I think we need to call collstats command on each collection (which is likely going to degrade performance of the module). Are we ok with this?

@ishleenk17
Copy link
Contributor Author

That's right, this is what I noticed as well while checking the beats code. That we are returning just the usage metrics for the collections from the top command. Listed here as well. We are not having any other metrics. Hence I pointed out we might want to revisit the complete collstats module.

Also if we are going to fetch collstats metrics I think we need to call collstats command on each collection (which is likely going to degrade performance of the module)

I think we don't have any way other than using the collstats command, is that right ?

@stefans-elastic
Copy link
Contributor

I think we don't have any way other than using the collstats command, is that right ?

That's my understanding (I haven't found any other way)

@stefans-elastic
Copy link
Contributor

@ishleenk17 I've come up with a "PoC" (kinda): eb7bbcb

If this solution makes sense I will proceed and expand it with other collStats fields

@ishleenk17
Copy link
Contributor Author

This looks fine. Thanks Stefan.
Let's come up with the most relevant list of metrics that we would like to include for collstats.

@stefans-elastic
Copy link
Contributor

I suggest:

Please let me know what do you think.

P.S. I've updated the PoC a bit (introduced WaitGroup's). I think it sould make the performance better.

@stefans-elastic stefans-elastic linked a pull request Dec 27, 2024 that will close this issue
6 tasks
@ishleenk17
Copy link
Contributor Author

The list looks good. Lets also add below two to these

max
nindexes

@stefans-elastic
Copy link
Contributor

@ishleenk17 done and PR is ready for review - #42171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants