ark::aws::CloudwatchClient
Defined in header “ark/aws/cloudwatch_client.hh”.
A wrapper around AWS CloudWatch client for post metrics.
Typedefs
- using PutMetricsCallback = std::function< void(const MetricDataOutcome &outcome)>
Optional completion callback for put_metrics_async. Invoked once the operation completes.
Methods
-
CloudwatchClient()
Constructor. Initializes a new client against the specified bucket. -
CloudwatchClient(const core::Url & endpoint)
Constructor. Initializes a new client against the given URL. This is typically used for testing only. -
CloudwatchClient(const AwsTemporaryCredentials & credentials, const core::Url & endpoint)
Constructor. Initializes a new client along with a credential provider. This is helpful when you want to control exactly how the AWScredentials are obtained for the client. -
void put_metrics(const MetricsRequest & request)
Post a metric request synchronously. -
void put_metrics_async(const MetricsRequest & request, PutMetricsCallback cb)
Post a metric request asynchronously.By default, any error that occurs, whether from validation of the request or from the actual post, will be logged. No exceptions are thrown from this method. Callers can choose to pass an optional callback to react to any errors or be notified upon a successful post.