https://pulumi.com logo
Title
e

echoing-orange-22253

11/22/2022, 1:29 AM
šŸ‘‹ hey, I am using pulumi (TS) w/ AWS and was hoping to also use it to configure some datadog alerts/monitors etc. Are there any sample projects you might recommend on github or elsewhere?
l

little-cartoon-10569

11/22/2022, 1:42 AM
It's just a simple lambda. The instructions are on the Datadog website.
e

echoing-orange-22253

11/22/2022, 1:43 AM
A simple lambda? I am hoping to write code to create a bunch of monitors in datadog?
l

little-cartoon-10569

11/22/2022, 1:44 AM
The Datadog monitors are usually oneliners. It's the AWS integration with Datadog that's the lambda.
e

echoing-orange-22253

11/22/2022, 1:45 AM
Yea, I am not really concerned w/ AWS - my application is emitting datadog metrics to datadog i.e. myApplication.someRoute.POST w/ results OK, latency 150ms
I would like to write a monitor that listens to these metrics and alerts if say the avg latency goes > 500 ms
or error rate is >1% or something
l

little-cartoon-10569

11/22/2022, 1:46 AM
e

echoing-orange-22253

11/22/2022, 1:47 AM
ok, was hoping there might be a sample app somewhere to look at but 🤷
āžœ  datadog  pulumi new datadog
error: template 'datadog' not found
āžœ  datadog
I guess this is not the most common use case just yet
In the past I built this stuff w/ terraform, it was somewhat painful
l

little-cartoon-10569

11/22/2022, 1:49 AM
No, I don't think there's a template. I can't see any example code, except the trivial one used in the Pulumi integration test suite: https://github.com/pulumi/pulumi-datadog/tree/master/examples/user
e

echoing-orange-22253

11/22/2022, 1:49 AM
cool. thanks
l

little-cartoon-10569

11/22/2022, 1:50 AM
But you could look up Terraform examples. It's a bridged provider, so there's a 1:1 mapping from tf code to Pulumi code.
FWIW I use it for one of my clients and it's so vanilla that I've not had to look for examples. The Monitor class maps exactly to the fields they give me for creating monitors, so I guess they're exactly the same as what they're using in the Datadog UI?
e

echoing-orange-22253

11/22/2022, 1:53 AM
I would guess so, thanks