Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

feat(stochastic): log out metrics for all handlers in LambdaRuntime. #88

Merged
merged 16 commits into from
Jul 15, 2021

Conversation

sam-goodwin
Copy link
Contributor

@sam-goodwin sam-goodwin commented Jul 6, 2021

Adds metrics and dashboards for #83
Closes #60
Closes #89
Closes #101

This change instruments our Command and Policy handlers to capture granular metrics such as the timing and success/fail rate of handling an event in a particular policy. We leverage the domain graph model to automatically track these granular merics and add them to a CloudWatch dashboard. The dashboards are a separate CDK stack than the BoundedContext to separate concerns. Not sure if this is a premature optimization.

  • Log out default metrics for all handlers
  • Configure CloudWatch Dashboards displaying each metric
  • Devise a strategy for making the MetricsLogger available throughout the framework

Example dashboard:
image

See how the Policy dashboard has a metric for each event the Policy handles. We have similar metrics for the Command, tracking which Events were emitted by it.

@sam-goodwin sam-goodwin requested a review from davehimself July 6, 2021 05:09
@sam-goodwin sam-goodwin self-assigned this Jul 6, 2021
@sam-goodwin sam-goodwin added the aws-serverless Related to serverless applications on AWS label Jul 6, 2021
Copy link
Owner

@ryan-mars ryan-mars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@sam-goodwin sam-goodwin marked this pull request as ready for review July 13, 2021 08:57
@sam-goodwin
Copy link
Contributor Author

Ugh, the build is failing because of that annoying CDK version bug but it isn't happening locally... Will fix tomorrow. Should we try CDK 2.0? I worry about this for stochastic users.

@sam-goodwin
Copy link
Contributor Author

I also consolidated our jest configurations into one

@ryan-mars
Copy link
Owner

ryan-mars commented Jul 13, 2021

Ugh, the build is failing because of that annoying CDK version bug but it isn't happening locally... Will fix tomorrow. Should we try CDK 2.0? I worry about this for stochastic users.

find . -name package-lock.json -not -path "*/node_modules/*" | xargs rm then npm install and commit the new package lock files usually solves this for me.

I have no problem with moving to CDK 2.0 now.

@sam-goodwin sam-goodwin modified the milestone: 1.0 Jul 15, 2021
@sam-goodwin
Copy link
Contributor Author

I have no problem with moving to CDK 2.0 now.

https://github.com/stochastic/stochastic/issues/102

@sam-goodwin sam-goodwin merged commit 83703ee into master Jul 15, 2021
@sam-goodwin sam-goodwin deleted the samgood-metrics branch July 15, 2021 18:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws-serverless Related to serverless applications on AWS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change LogLevel enum to be ordered Global jest config Ops Monitoring and Logging
2 participants