Skip to content
Snippets Groups Projects
Unverified Commit c54b3ba1 authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Add cloudwatch metrics (cloudwatch) & example (#554)

* Add cloudwatch metrics (cloudwatch)

* remove unused dependencies
parent 082d05f0
Branches
Tags
No related merge requests found
......@@ -80,6 +80,7 @@ val tier1Services = setOf(
"sqs",
"ssm",
"sts",
"cloudwatch",
"ecr",
"eks"
)
......
[package]
name = "cloudwatch-code-examples"
version = "0.1.0"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Russell Cohen <rcoh@amazon.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
cloudwatch = { package = "aws-sdk-cloudwatch", path = "../../build/aws-sdk/cloudwatch" }
tokio = { version = "1", features = ["full"] }
tracing-subscriber = { version = "0.2", features = ["fmt"] }
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use cloudwatch::Client;
#[tokio::main]
async fn main() -> Result<(), cloudwatch::Error> {
tracing_subscriber::fmt::init();
let client = Client::from_env();
let rsp = client.list_metrics().send().await?;
let metrics = rsp.metrics.unwrap_or_default();
println!("found {} metric(s)", metrics.len());
for metric in metrics {
println!("metric: {:?}", metric);
}
Ok(())
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment