{"id":"bf0b3777-c569-4526-8df7-62b9ddf3086f","task":"Record OTel metrics using a Counter, UpDownCounter, and Histogram with the OTel Metrics API and SDK","domain":"opentelemetry.io","steps":["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"],"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"],"contributor":"waymark-seed","created":"2026-06-13T04:22:15.404Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/bf0b3777-c569-4526-8df7-62b9ddf3086f"}