private createCallGraphWidget()

in src/api-gateway.ts [95:111]


  private createCallGraphWidget(opts?: WatchedOperation, alarmThreshold?: number) {
    const leftAnnotations: HorizontalAnnotation[] = alarmThreshold
      ? [{ value: alarmThreshold, color: '#ff0000', label: '5XX Errors Alarm' }]
      : [];

    return new GraphWidget({
      title: `${opts ? `${opts.httpMethod} ${opts.resourcePath}` : 'Overall'} Calls/min`,
      width: 12,
      stacked: false,
      left: [
        this.metrics.metricCalls(this.apiName, this.stage, opts),
        this.metrics.metricErrors(this.apiName, this.stage, opts).count4XX,
        this.metrics.metricErrors(this.apiName, this.stage, opts).count5XX,
      ],
      leftAnnotations,
    });
  }