PeriodicMetricReader
Drives collection cycles and hands the results to a MetricExporter.
TelemetryProvider has no lifecycle member and there is no ambient scope to inherit, so the reader owns its own: a SupervisorJob, so one bad cycle cannot silently end collection for the process lifetime, on Dispatchers.Default, which is daemon-backed on the JVM so a forgotten close leaks one coroutine rather than hanging shutdown.
Built by the caller and assigned to AggregatingTelemetryProvider.Builder.metricReader, or created implicitly by that builder's exporter shorthand:
PeriodicMetricReader(interval = 30.seconds) {
exporter = CloudWatchMetricExporter { namespace = "MyApp" }
}Content copied to clipboard