Syntax
NewRelic.Api.Agent.NewRelic.IncrementCounter(string $metric_name)
Increment the counter for a custom metric by 1.
Requirements
Compatible with all agent versions.
Compatible with all app types.
Description
Increment the counter for a custom metric by 1. To view these custom metrics, use the query builder to search metrics and create customizable charts. See also RecordMetric()
and RecordResponseTimeMetric()
.
Important
When creating a custom metric, start the name with Custom/
(for example, Custom/MyMetric
).
Parameters
Parameter | Description |
---|---|
string | Required. The name of the metric to increment. |
Examples
NewRelic.Api.Agent.NewRelic.IncrementCounter("ExampleMetric");
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's and and documentation.