How do I go about logging and getting metrics for ...
# help
a
How do I go about logging and getting metrics for a sst Api and its Functions. SEED gives me some info but I would like to be able to get these metrics via CloudWatch as well. Has anyone attempted anything similar or knows how I could attempt this myself?
t
I use datadog for this. But am curious how to do it within AWS
a
I see in the cdk docs that it exposes httpApi.metrics function and related functions. I’m going to try that. I’ll try to create a custom cloudwatch dashboard per API construct. Let’s see how that goes.
s
on the topic of metrics and logging, I've recently been thinking of how to create dashboards+alarms using IaC when the stack is deployed
I haven't tried just yet, but it seems like a very cool idea to automate the creation of dashboards in Cloudwatch, just like the rest of the infrastructure
At this point, anything that gets set up in my Cloudwatch dashboard is manually set by me. Which means I have very few dashboards 🙂
a
@aws-cdk/aws-cloudwatch
is what you’d use. Yes, I’m attempting the same. Should be doable, I just need to see a good number of examples to train my brain as to guage what can be done. 😅
s
Definitely! Step 1) how do I do this in the console? Step 2) do it in CDK
Actually, it's more like Step 1) how do I do this in the console? Step 2...N) UGH, WTF, why doesn't this work?!?! Step N+1) do it in CDK
a
Haha, I’d love to know how to do it in the console, that’d probably help me with the CDK implementation too.
Though sometimes the console is just plain stupid too, there are things which are plain simple with the CDK which the console sucks at.