-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[receiver/mongodbreceiver] Added new mongodb metrics to achieve parity with Telegraf #37227
[receiver/mongodbreceiver] Added new mongodb metrics to achieve parity with Telegraf #37227
Conversation
7a46972
to
fcd84f3
Compare
cb0771b
to
9c33d36
Compare
actively fixing the build errors and merge conflicts :) |
only failing check is lychee:
not really sure how to fix this, doesn't seem like anything is wrong? this check isn't required to pass to merge this PR. |
receiver/mongodbreceiver/testdata/integration/expected.4_4lpu.yaml
Outdated
Show resolved
Hide resolved
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.
Overall looks good, thank you for your contribution! I think I want to deliberate on some metric naming and potentially consolidate the command rate metrics into a single one.
I also am getting torn between having some version checks for reading from WiredTiger as if my memory recollects it was added to the summaryStats in 4.4
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/15ab1613406a841bfdb4c7a969291807a08d8f7f/receiver/mongodbreceiver/scraper.go#L52
value_type: double | ||
aggregation_temporality: delta | ||
monotonic: false | ||
mongodb.commands_per_sec: |
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.
It feels like that mongodb.commands.rate could better consolidate metrics here and combine via a metric attribute
insert
getmore
delete
update
find
Pretty much the commands in this table I think could be consolidated into a single rate metric with unit {query}/s
: https://www.mongodb.com/docs/manual/reference/command/#query-and-write-operation-commands
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.
yeah this is a good idea, the reason why I didn't go with this approach was because this is to match with telegraf metrics which has specific (naming?) rate metrics like:
queries per sec
inserts per sec
etc
while putting this into consolidate metric where I'm thinking something like mongodb.operation.rate
similar to mongodb.operation.count and while the metric shows up, it'll be under an operation instead of its own metric (if that makes sense? including an screenshot here
and I'm not exactly sure if telegraf will know the difference between:
1. mongodb.operation.rate with operation=query or operation=insert
2. mongodb.queries.rate
just to be safe, I went with mongodb.queries_per_sec (or after your suggestion mongodb.queries.rate).
let me know what you think!
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
7b0d4fc
to
ab9fee4
Compare
4881ac6
to
4b7896b
Compare
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.
Why do we need to calculate the rate in this receiver for already emitted set of metrics? Calculating rate from cumulative seems like something that can easily be done on any metrics backend AFAIK. Even if it's needed to be done in the collector, why not make a generic solution for that?
I believe it must be even possible already by applying:
- Cumulative to delta processor
- Scaling the values deviding them by the collection interval using the scale_metric function in transform processor
@schmikei if you can take a look at this PR again would appreciate it! the failures seems to be from the kafkatopicsobserver, not related to my change 🤔 |
whoops just saw this, we commented at the same time yesterday 😆 the reason I was thinking of calculating the rate in this receiver was because while there are already a set of emitted metrics which I believe to be mongodb.operation.count which stores the total count for specific/all the operations. so was thinking of adding rate metrics to be in line with telegraf metrics oh wow hm, didn't know that there was a cumulativetodeltaprocessor. not too familiar with this, will look into this today! |
taking a look at the readme
not sure if this is a viable solution since this is best for a single collector 🤔 |
bump @schmikei |
@atoulme can you take a look when you're free? thanks! |
I can take a look, but please resolve conflicts first. |
69aec2d
to
ec4795b
Compare
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 think this generally looks good, the only concern I have is around how useful these rate metrics are going to be reported as the collector process if restarted we might get gaps in data depending on the scrape_interval
which is why I think we generally want to avoid adding rate calcs in receivers, but I don't feel like blocking your efforts for too much longer.
I see the value in these metrics and think its a good change, I don't have full approver status here so would love to get someone more familiar with the data model if they have a different perspective on it.
Also open to other comments as well from someone have a different perspective. If people wouldn't want to use these metrics, they can set it to false right? and thanks for taking a look Keith, appreciate it! |
Description
Link to tracking issue
Testing
Screenshot examples:
Documentation