question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Monitoring Construct in Stack in Pipeline Stage

See original GitHub issue

Version

1.7.0

Steps and/or minimal code example to reproduce

My issue is that the monitoring construct runs within a stage and doesn’t deploy any resources.

My steps were:

  1. CDK App has a stack CdkPipeline
  2. CdkPipeline has a stage CdkPipelineStage
  3. CdkPipelineStage includes all stacks
  4. Add monitoring stack in CdkPipelineStage
export interface Props extends StackProps {
  constructToMonitor: ConstructType;
}
export class MonitoringStack extends Stack {
  constructor(parent: Construct, name: string, props: Props) {
    super(parent, name, props);

    const { constructToMonitor } = props;

    const monitoring = new MonitoringFacade(this, 'monFacade', {
      alarmFactoryDefaults: {
        actionsEnabled: true,
        alarmNamePrefix: 'alarm'
      },
      metricFactoryDefaults: {}
    });

    monitoring.monitorScope(constructToMonitor);
    monitoring.monitorBilling();
    monitoring.monitorLambdaFunction({
      lambdaFunction: constructToMonitor.sqsLambdaDlq.consumerLambda
    });
  }
}
  1. Nothing gets deployed except for CDK Metadata

The same thing happens if I am adding the monitoring construct within an existent stack with other services.

Is it necessary that I pass the App like in the example or is it also possible when I pass a construct?

Expected behavior

Find all resources within my construct and create alarms, dashboards, etc.

Actual behavior

Nothing will be deployed.

Other details

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:24 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
wernermorgensterncommented, May 31, 2022

I think when creating new MonitoringFacade, for the dashboardFactory, the sample code used new DefaultDashboardFactory(this, 'MonitoringDashboards', {

The documentation doesn’t show that part at all.

0reactions
JannikWempecommented, Jun 25, 2022

I was able to deploy it now. I put a question in under the discussions for a small improvement which could be done.

@wernermorgenstern could explain how you integrated cdk-monitoring-constructs with CDK pipelines?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Monitoring pipelines - AWS CodePipeline
EventBridge event bus events — You can monitor CodePipeline events in EventBridge, which detects changes in your pipeline, stage, or action execution status....
Read more >
Use Cloud Monitoring for Dataflow pipelines
Cloud Monitoring provides powerful logging and diagnostics. Dataflow integration with Monitoring lets you access Dataflow job metrics such as Job Status, ...
Read more >
the given stage construct should contain at least one stack
We receive an error "The given Stage construct ('foo/bar') should contain at least one Stack" when migrating our code to the modern pipelines....
Read more >
AWS CodePipeline (CI / CD) Tutorial with CDK - YouTube
In this tutorial, I show you how to setup a CI / CD pipeline using CodePipeline, CDK and TypeScript. We set up two...
Read more >
(pipelines): add a way to add steps that aren't attached to ...
We receive an error "The given Stage construct ('foo/bar') should contain at least one Stack" when migrating our code to the modern ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found