Cxovrika
Cxovrika

Reputation: 185

Airflow Datadog hook conn_id format

I want to use a DatadogHook in one of my Airflow DAGs. As documentation says, I need to pass a datadog_conn_id upon hook initialization, and the parameter description says:

datadog_conn_id – The connection to datadog, containing metadata for api keys.
datadog_conn_id – str

The problem is that I couldn't figure out what the format of datadog_conn_id should be. It's not exactly specified in the documentation. After digging in some of Airflow source code, I found out that it expects to find api_key and app_key from the given datadog_conn_id, but not sure how does it extract them from the given string, what's the expected format.

So, is there any well known format that is meant here that I don't know? I don't believe that documentation is just missing such an important information.

Note: I do have both API and APP keys ready, just not sure about the format in which I should provide them to the hook.

Upvotes: 3

Views: 919

Answers (1)

Elad Kalif
Elad Kalif

Reputation: 15979

You need to define them as Json in the extra feild.

{"app_key": "appkey", "api_key": "apikey"}

A good source for this information would be to look on the hook unit tests.

Upvotes: 1

Related Questions