• English日本語한국어
  • Log inStart now

IncrementCounter (.NET agent API)

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). For more on naming, see Collect custom metrics.

Parameters

Parameter

Description

$metric_name

string

Required. The name of the metric to increment.

Examples

NewRelic.Api.Agent.NewRelic.IncrementCounter("Custom/ExampleMetric");
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.