Skip to content
Permalink
Browse files

fix `up metrics` output, should be stage-specific, not global

  • Loading branch information...
tj committed Mar 1, 2018
1 parent 017f7cf commit fc2f96c86210b424e2edf04a5d0663dbe6291aff
Showing with 3 additions and 2 deletions.
  1. +3 −2 platform/lambda/metrics.go
@@ -62,6 +62,7 @@ func (p *Platform) ShowMetrics(region, stage string, start time.Time) error {
s := session.New(aws.NewConfig().WithRegion(region))
c := cloudwatch.New(s)
var g errgroup.Group
name := p.config.Name

d := time.Now().UTC().Sub(start)

@@ -77,9 +78,9 @@ func (p *Platform) ShowMetrics(region, stage string, start time.Time) error {

switch s.Namespace {
case "AWS/ApiGateway":
m = m.Dimension("ApiName", p.config.Name).Dimension("Stage", stage)
m = m.Dimension("ApiName", name).Dimension("Stage", stage)
case "AWS/Lambda":
m = m.Dimension("FunctionName", p.config.Name)
m = m.Dimension("FunctionName", name).Dimension("Resource", name+":"+stage)
}

res, err := c.GetMetricStatistics(m.Params())

0 comments on commit fc2f96c

Please sign in to comment.
You can’t perform that action at this time.