tremor-rs / tremor-runtime

Main Tremor Project Rust Codebase
https://www.tremor.rs
Apache License 2.0
842 stars 127 forks source link

Add a DataDog Connector for sending metrics via Rest API #1214

Open anuprout opened 2 years ago

anuprout commented 2 years ago

Describe the problem you are trying to solve Support for writing custom metrics to DataDog using REST API.

Describe the solution you'd like Either a separate offramp or a batch operator to send data in batches using the REST offramp.

mfelsche commented 2 years ago

Important info here:

All requests to Datadog’s API must be authenticated. Requests that write data require reporting access and require an API key. Requests that read data require full access and also require an application key.

https://docs.datadoghq.com/api/latest/authentication/

A datadog connector needs to have an api key and an application key configured. As well as a datadog_host config. We could pull this off by adding an auth config on the rest offramp/connector specialized for datadog.

The required format for metrics is:

{
  "series": [
    {
      "host": "test.example.com",
      "interval": 20,
      "metric": "system.load.1",
      "points": [
        [
          1575317847,
          0.5
        ]
      ],
      "tags": [
        "environment:test"
      ],
      "type": "rate"
    }
  ]
}

So each event needs to be wrapped in a json object, which we could either support via the batch operator or a group by select statement.

But i think it is more convenient for users to have a ready-made datadog-metrics connector to just send stuff to.

Licenser commented 2 years ago

we can avoid a datadoc conector by setting this in a script

mfelsche commented 2 years ago

i know, this would solve the immediate pain of not being able to send stuff to datadog. So, in this sense, it is already possible right now. But having users go through all those hoops to send stuff to datadog is really inconvenient.

For the sake of usability, although it would duplicate code we have around here and there, i would suggest to create a datadog connector, instead of providing it the ikea way (bits and pieces to put together on your own).

Licenser commented 2 years ago

I would disagree, I think packaging this up with modular queries instead of extra connectors is in the long term a better usability. having hundreds of different connectors, is not as useful as having a few well polished ones and pluggable pieces in between