awslabs / aws-sdk-kotlin

Multiplatform AWS SDK for Kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CloudWatch MetricsProvider implementation

aajtodd opened this issue · comments

Describe the feature

Currently only an OpenTelemetry based provider is available for TelemetryProvider/MetricsProvider. It would be useful to expose a "native" CW based MetricsProvider that exports directly to cloudwatch without needing to configure OTeL.

Is your Feature Request related to a problem?

Some customers may not want to depend on OTeL and desire a fully integrated AWS solution. OpenTelemetry also does client side aggregation of Histogram instruments which may not be desirable for some use cases. Java v2 enables finer resolution with detailed metrics.

Proposed Solution

There isn't currently any other TelemetryProvider other than OTeL. We would probably want to implement a generic SDK provider that can be adapted to work for CW and potentially other metric systems. There is a lot that goes into collecting, aggregating, and exporting that it should be mostly re-usable. Look to Java V2 SDK and OTeL for inspiration here:

e.g.

TelemetryProvider.build {
     metricsExporters += CloudwatchMetricsExporter(...)
     meterReader = PeriodicMeterReader(interval = 5.seconds)
}

Describe alternative solutions or features you've considered

We may be able to write our own metric exporter for OpenTelemetry, it's unclear at what level we have access to the actual data recorded from a MetricExporter. This of course still goes through OTeL but may be less involved to implement if the exporter has access to fine grained data (since OTeL is handling the metrics collection and plumbing, etc). It wouldn't require setting up an OTeL collector either, metrics would be exported directly from the application process.

Acknowledge

  • I may be able to implement this feature request

AWS Kotlin SDK version used

N/A

Platform (JVM/JS/Native)

N/A

Operating System and version

N/A