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

Support for Gauge metrics #976

Open
mgoshorn opened this issue Nov 15, 2021 · 5 comments
Open

Support for Gauge metrics #976

mgoshorn opened this issue Nov 15, 2021 · 5 comments

Comments

@mgoshorn
Copy link

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

When working with custom metrics, it seems there is only support for timeslice metrics. This works well for metrics that should naturally be summed when looking at a timeslice (eg. requests during a period), but poorly for data that we would not naturally want summed (eg. reporting current total number of active websocket connections). Based on the documentation for Metric data structure, it seems like a Gauge metric would best fit the second case. As far as I can tell, there does not seem to be a way to report custom gauge metrics through the NodeJS agent. If this isn't the case, then I would be very happy to hear about the proper way to track this kind of data.

Feature Description

Use NodeJS agent to record and report custom metrics of the type Gauge (or of any type listed in documentation).

Describe Alternatives

Alternative would be a custom integration with the Metrics API, however this seems a bit clumsy when the agent is already configured to talk with NR.

Additional context

N/A

Priority

Please help us better understand this feature request by choosing a priority from the following options:
[Nice to Have, Really Want, Must Have, Blocker]

Really Want

@michaelgoin
Copy link
Member

michaelgoin commented Nov 15, 2021

Hi @mgoshorn,

Thank you for the feature-request!

You are right that Guage metrics are not supported by the the agent (or any New Relic agent), currently. The only way to get Guage metrics is via the Metrics API. The newer metric dimensional types in the API are not currently integrated into the primary agents.

To work with current functionality, you can leverage the count field on timeslice metrics. The incrementMetric(name, value) API only increments the metric count. If you do not pass a value, it increments by 1. If you pass a value, it will increment the metric's count by that value. This requires you to remember/understand you'll retrieve these metrics as counts but can at least simulate what you want in a Guage. https://docs.newrelic.com/docs/apm/agents/nodejs-agent/api-guides/nodejs-agent-api/#increment_metric

@mgoshorn
Copy link
Author

Thank you for the recommendation, @michaelgoin.

Will this work for data that isn't strictly incrementing? In the case described above, I expect our currently connected user count to also decrement when users disconnect from the service.

@michaelgoin
Copy link
Member

@mgoshorn For the count, it does a simple addition so I believe using a negative value would result in decrementing. I have not tried this myself, though. It may be worth noting as well that these are sent up once a minute, so via this approach they will be capturing the current active count on that interval.

@kmudduluru
Copy link
Contributor

We are exploring Dimensional metrics support as part of this feature - https://new-relic.atlassian.net/browse/NR-191666

@workato-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Triage Needed: Unprioritized Features
Development

No branches or pull requests

4 participants