Obtain a Meter from the global MeterProvider with a versioned instrumentation scope name
Create a Counter for monotonically increasing values (requests, errors) using meter.createCounter, then call counter.add(1, attributes) on each event
Use meter.createUpDownCounter for values that can rise and fall (queue depth, active connections) and call add with positive or negative deltas
Create a Histogram for latency or payload size using meter.createHistogram with explicit bucket boundaries tuned to the expected distribution
Set the export interval on the PeriodicExportingMetricReader and choose the correct temporality (cumulative vs delta) for the backend
Known gotchas
Using cumulative temporality with a short export interval sends ever-growing counter values; the backend must compute rate-of-change, whereas delta temporality sends differences directly
High-cardinality attribute combinations on metrics explode the number of time series; enforce an attribute allowlist using Views
Histogram bucket boundaries default to a generic set; recording latencies in milliseconds against microsecond boundaries produces all observations in a single bucket
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp