Syntax
newrelic.agent.record_custom_metrics(metrics, application=None)
Records a set of custom metrics.
Description
This call records a set of custom metrics. To record a single custom metric, see record_custom_metric
.
The passed metrics can be any iterable object that yields (name, value)
tuples. For example:
def metrics(): yield 'Custom/Value-1', 1 yield 'Custom/Value-2', 2 yield 'Custom/Value-3', 3newrelic.agent.record_custom_metrics(metrics())
There are no restrictions on setting the name, but it's recommended you use a Custom/
prefix. The custom metric value can be a numeric, or can be a dictionary corresponding to an already-aggregated data sample. For more about the name
and value
rules, see record_custom_metric
.
Parameters
Parameter | Description |
---|---|
iterable object | Required. Set of metric values, which can be in the form of any iterable object that yields |
string | Optional. If the application is the default value of |
Return values
None.
Examples
Recording custom metrics
def metrics(): yield 'Custom/Value-1', 1 yield 'Custom/Value-2', 2 yield 'Custom/Value-3', 3newrelic.agent.record_custom_metrics(metrics())
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicのデータセキュリティとライセンスドキュメント をご確認ください。