ryan-mars / stochastic

TypeScript framework for building event-driven services. Easily go from Event Storming → Code.
MIT License
6 stars 1 forks source link

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

Closed sam-goodwin closed 3 years ago

sam-goodwin commented 3 years ago

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.

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 commented 3 years ago

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 commented 3 years ago

I also consolidated our jest configurations into one

ryan-mars commented 3 years ago

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 commented 3 years ago

I have no problem with moving to CDK 2.0 now.

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