ks888 / LambStatus

[Maintenance mode] Serverless Status Page System
https://lambstatus.github.io
Apache License 2.0
1.3k stars 119 forks source link

Custom metrics with no dimensions do not save/display properly #135

Open mcheshier1 opened 5 years ago

mcheshier1 commented 5 years ago

I'm on the latest version. (.64)

To reproduce:

  1. Create a custom metric with no dimensions.
  2. Select the custom metric from the drop-down list. It should look like metric - [].
  3. Click edit.
  4. Return to the selection screen. The DDL that should be populated is not.
  5. Add a dimension to the metric.
  6. Repeat the process. Metric saves as expected.
ks888 commented 5 years ago

Thank you for your report, but I can't reproduce the issue.

Maybe I misunderstand some steps. Here are the steps I tried:

  1. Open the metrics page (https://xxxx.cloudfront.net/metrics).
  2. Click '+ Add' button.
  3. Enter the Title (like 'Metric 1').
  4. Click 'Add' button. Now the new metric is created.
  5. Click 'Pencil' icon to edit the metric.
  6. Choose namespace and dimensions.
  7. Click 'Edit' button. Now the metric is updated.
  8. Click 'Pencil' icon again.

After these steps, it looks like the new namespace and dimensions are saved correctly.

mcheshier1 commented 5 years ago

Hi ks888, did you point it at a metric with no dimensions? It should look like - []. Also the metric should show up under 'Metrics with no dimensions' in a custom namespace in Cloudwatch.

jkrenge commented 5 years ago

@mcheshier1 Running into the same issue here, did you find a workaround? Does it make sense to add a dimension?

jkrenge commented 5 years ago

If anyone stumbles upon this: An easy fix is to reuse your existing namespace and metric name for the dimension, then you'll be able to add them to LambStatus. In Node I'm using sth like this:

  var params = {
    MetricData: [
      {
        MetricName: metric,
        Timestamp: new Date(),
        Unit: 'Count',
        Value: value,
        Dimensions: [{
          Name: 'MyMetric',
          Value: metric,
        }],
      },
    ],
    Namespace: 'MyMetric/' + namespace,
  };

  CloudWatch.putMetricData(params, callback);