DataDog / datadog-agent

Main repository for Datadog Agent
https://docs.datadoghq.com/
Apache License 2.0
2.81k stars 1.19k forks source link

[dogstatsd] dogstatsd daemon embedded into a lambda #3063

Open srizzling opened 5 years ago

srizzling commented 5 years ago

This is a potential solution to a problem we are likely going to face soonish, and looking at idea how we could potentially have a scaable solution for pushing metrics to statsd.

We want the ability to have lambdas push metrics using the statsd protocol to lambda. (We know there is a way with logging it to CloudWatch). We really enjoy the interface that a dogstatsd client exposes client.increament.. we don't want to rebuild the functionality, and and instead of send to daemon, but to just send to log.

We have a potential solution to create an EC2 instance, attach an LB, and allow our lambdas to send metrics to this directly. While this approach seems ok, I don't want to provision a new instance for something that as basic as just running a simple daemon to ship metrics to DataDog.

Another potential solution, I'm eyeing up. Is the fact that I could write a serverless function.. (AWS Lambda), that wraps the daemon, that is hooked to an ALB. The ALB is known endpoint that metrics can be forwarded to. Would this potentially work?

Some problems I probably need to think about is how the event is handled in the lambda, perhaps? Is it something thats been explored? Failed?

srizzling commented 5 years ago

The other potential idea, is using the new layering feature within AWS, and wrap the lambda with a special statsd runtime...