-
Notifications
You must be signed in to change notification settings - Fork 5.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
Add MongoDB uptime_ms #6669
Add MongoDB uptime_ms #6669
Conversation
plugins/inputs/mongodb/mongostat.go
Outdated
@@ -659,6 +661,8 @@ func NewStatLine(oldMongo, newMongo MongoStatus, key string, all bool, sampleSec | |||
Faults: -1, | |||
} | |||
|
|||
returnVal.UptimeMillis = newStat.UptimeMillis |
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.
Looks good, but can you update the field to be in nanoseconds and rename the field to uptime_ns
to match up with flushes_total_time_ns
? See line 742
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 get it why it's better to name things consistently, but I have doubts:
- It may be misleading to have
_ns
suffix on something that has millisecond resolution. - It's clearer for user when metric name matches with MongoDB's command output.
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.
These are good points but I'd still like to make this change for consistency. We are trying to do this across the board for all duration and time values and nanosecond precision gives us the most flexibility and is consistend with our timestamp format.
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.
Replaced uptime_ms
with uptime_ns
.
MongoDB doc: serverstatus.uptimeMillis