netra-custom-metrics
Installation
SKILL.md
Netra Custom Metrics
Use this skill to instrument business and operational KPIs alongside Netra traces.
When To Use
- You need request, latency, token, and cost metrics.
- You need queue depth or in-flight gauges.
- You want periodic metrics export via OTLP/HTTP JSON.
Procedure
- Initialize Netra with
enable_metrics=True. - Get a meter via
Netra.get_meter("service-name"). - Define instruments: counter, histogram, up-down counter, observable counter.
- Record values with low-cardinality attributes.
- Call
Netra.shutdown()on process exit to flush final export.
Python Pattern
from netra import Netra