-
Notifications
You must be signed in to change notification settings - Fork 89
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
Fix issue #1627 - stats usage #1629
Conversation
CHANGES_NEXT_RELEASE
Outdated
@@ -1,3 +1,5 @@ | |||
- Add: openmetrics-compatible `/metrics` endpoint in nortbound API | |||
- Deprecate: push-based stats |
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.
Maybe we should go beyond deprecation and remove the functionality (given that nobody is using it and, moreover, it probably doesn't work).
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'm good with both, @AlvaroVega what do you think?
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'm agree on remove previous functionality.
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
Take care of lint:
|
fixed. |
(currentConfig.deviceRegistry && currentConfig.deviceRegistry.type === 'mongodb') || | ||
(currentConfig.stats && currentConfig.stats.persistence === true) | ||
) { | ||
if (currentConfig.deviceRegistry && currentConfig.deviceRegistry.type === 'mongodb') { |
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.
https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/admin.md#stats section in documentation should be removed? Or it is still used?
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 has been removed, no longer used.
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.
Ok. I missed that... NTC
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
@@ -67,7 +68,8 @@ function init() { | |||
* @param {String} token User token to identify against the PEP Proxies (optional). | |||
*/ | |||
function sendUpdateValue(entityName, attributes, typeInformation, token, callback) { | |||
entityHandler.sendUpdateValue(entityName, attributes, typeInformation, token, callback); | |||
const newCallback = statsRegistry.withStats('updateEntityRequestsOk', 'updateEntityRequestsError', callback); |
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.
only here and raise/release alarm are feeding statsRegistry at this moment. It should be added also for create/delete groups/devices and so on ?
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 only added metrics for things I want to alert on our monitoring systems. Currently, I want to create alerts:
- If the number of failed updates increases much above average,
- If the number of successful updates falls much below average,
- if the number of alarms RAISE is higher than the number of alarms RELEASE.
So I only added metrics for those three use cases. It might be better to add metrics on demand, when some use case requires them.
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.
LGTM
Passing the ball to @AlvaroVega for extra review and LGTM before merging
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.
LGTM
Fixes issue #1627 - comment #1627 (comment)
config.stats
section./metrics
path of the northbound API./metrics
endpoint.The
/metrics
path is a convention for any openmetrics exporter.