0

i've created successfully a custom metric by SDK but i'm not able to remove it I can't find the option from the web console to remove it (from SDK as well, i cant find a method to remove/cancel it)

//the code is not important, i've pasted it just to show it works

IAmazonCloudWatch client = new AmazonCloudWatchClient(RegionEndpoint.EUWest1);

List<MetricDatum> data = new List<MetricDatum>();

 data.Add(new MetricDatum()
 {
      MetricName = "PagingFilePctUsage",
      Timestamp = DateTime.Now,
      Unit = StandardUnit.Percent,
      Value = percentPageFile.NextValue()
 });

 data.Add(new MetricDatum()
 {
      MetricName = "PagingFilePctUsagePeak",
      Timestamp = DateTime.Now,
      Unit = StandardUnit.Percent,
      Value = peakPageFile.NextValue()
 });


 client.PutMetricData(new PutMetricDataRequest()
 {
      MetricData = data,
      Namespace = "mycompany/myresources"
 });

it created a metric named "mycompany/myresources" but i can't remove it

pinale
  • 2,060
  • 6
  • 38
  • 72

1 Answers1

0

Amazon CloudWatch retains metrics for 15 months.

From Amazon CloudWatch FAQs - Amazon Web Services (AWS):

CloudWatch retains metric data as follows:

  • Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution custom metrics.
  • Data points with a period of 60 seconds (1 minute) are available for 15 days
  • Data points with a period of 300 seconds (5 minute) are available for 63 days
  • Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months)

So, just pretend that your old metrics don't exist. Most graphs and alarms only look back 24 hours, so old metrics typically won't be noticed, aside from appearing as a name in the list of metrics.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • 1
    ok and what about costs? 1) i suppose, if i create only a "namespace" to collect metrics without sending data, nothing is charged, is it correct? 2) if i send metrics only for 1 day they charged me data for that day 3)MORE IMPORTANT: is it charged the space to store that metrics for 15 months as well even if i sent data only for 1 day? – pinale Apr 23 '20 at 10:20
  • 2
    I think the Namespace only appears if there are metrics within that Namespace. The cost for Custom Metrics is only charged when it is sent, which would be 30c for the first 10,000 metrics in a month. No charge for "storage" of metrics. – John Rotenstein Apr 23 '20 at 10:33