You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/30 19:16:48 UTC
[GitHub] [airflow] kimyen opened a new issue #17920: Support statsd mappings for DataDog
kimyen opened a new issue #17920:
URL: https://github.com/apache/airflow/issues/17920
### Official Helm Chart version
1.1.0 (latest released)
### Apache Airflow version
2.0.2
### Kubernetes Version
1.19.11
### Helm Chart configuration
```
statsd:
enabled: true
nodeSelector:
github.com/poolname: airflow
extraMappings:
- match: "airflow.*_start"
name: "airflow.job.start"
tags:
job_name: "$1"
```
### Docker Image customisations
None
### What happened
In `airflow-statsd` configmap in K8s, I see:
```
- match: airflow.*_start
name: airflow.job.start
tags:
job_name:
```
The substitution issue is reported here: https://github.com/apache/airflow/issues/17919
Prometheus' configmap parser will complain about the dots `.` in `name`. This metric name is a valid DataDog metric name. This extra config is from the DataDog - Airflow integration example: https://docs.datadoghq.com/integrations/airflow/?tab=host
### What you expected to happen
Provide guidance on an image to be used for statsd component that supports DataDog, or use an image that doesn't requires Prometheus rules for statsd mappings.
### How to reproduce
See the values above
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kimyen commented on issue #17920: Support statsd mappings for DataDog
Posted by GitBox <gi...@apache.org>.
kimyen commented on issue #17920:
URL: https://github.com/apache/airflow/issues/17920#issuecomment-909729347
@jedcunningham , thank you for responding to me. There is definitely a gap in my knowledge here about what is needed to export data to datadog. I have some follow-up questions:
- With the config above, `statsd_host: localhost` means that there is a dogstatsd agent running in the same pod as the scheduler and each worker? We have DAGs that emits metric to datadog, and we set env for which hostIP to use to reach the datadog agent.
- If there is **not** a dogstatsd agent running in the same pod as the scheduler and each worker pod, then we need one datadog agent running somewhere that we can set `DOGSTATSD_HOST`, `DD_AGENT_HOST` and `AIRFLOW__SCHEDULER__STATSD_HOST`. We used to use the datadog helm chart with Airflow here: https://github.com/DataDog/helm-charts/tree/main/charts/datadog, but this creates a datadog agent pod for each Airflow pod. We prefer to have a single pod for dogstatsd agent.
- With the config above, how do I specify statsd mappings? With using the datadog helm chart, the mapping would go in `datadog-values.yaml`. Our mappings are to group many Airflow metrics into a generic metric, and turn the variables on the metric name to tags since large number of metric names increase datadog bill. For example, this one reduces 300+ (number of DAGs we have) metrics down to 1:
```
- match: 'airflow\.dag_processing\.last_duration\.(.*)'
match_type: "regex"
name: "airflow.dag_processing.last_duration"
tags:
dag_file: "$1"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on issue #17920: Support statsd mappings for DataDog
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on issue #17920:
URL: https://github.com/apache/airflow/issues/17920#issuecomment-909459233
You don't need to run the statsd-exporter when integrating with DataDog, to the best of my knowledge you can export directly to DogStatsD? Try something like this instead:
```
statsd:
enabled: false
config:
metrics:
statsd_on: true
statsd_host: localhost
statsd_port: 8125
statsd_datadog_enabled: true
```
Is there some benefit to using the exporter I'm not aware of (granted, I'm not a DataDog user)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kimyen closed issue #17920: Support statsd mappings for DataDog
Posted by GitBox <gi...@apache.org>.
kimyen closed issue #17920:
URL: https://github.com/apache/airflow/issues/17920
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] jedcunningham commented on issue #17920: Support statsd mappings for DataDog
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on issue #17920:
URL: https://github.com/apache/airflow/issues/17920#issuecomment-909459233
You don't need to run the statsd-exporter when integrating with DataDog, to the best of my knowledge you can export directly to DogStatsD? Try something like this instead:
```
statsd:
enabled: false
config:
metrics:
statsd_on: true
statsd_host: localhost
statsd_port: 8125
statsd_datadog_enabled: true
```
Is there some benefit to using the exporter I'm not aware of (granted, I'm not a DataDog user)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kimyen commented on issue #17920: Support statsd mappings for DataDog
Posted by GitBox <gi...@apache.org>.
kimyen commented on issue #17920:
URL: https://github.com/apache/airflow/issues/17920#issuecomment-909729347
@jedcunningham , thank you for responding to me. There is definitely a gap in my knowledge here about what is needed to export data to datadog. I have some follow-up questions:
- With the config above, `statsd_host: localhost` means that there is a dogstatsd agent running in the same pod as the scheduler and each worker? We have DAGs that emits metric to datadog, and we set env for which hostIP to use to reach the datadog agent.
- If there is **not** a dogstatsd agent running in the same pod as the scheduler and each worker pod, then we need one datadog agent running somewhere that we can set `DOGSTATSD_HOST`, `DD_AGENT_HOST` and `AIRFLOW__SCHEDULER__STATSD_HOST`. We used to use the datadog helm chart with Airflow here: https://github.com/DataDog/helm-charts/tree/main/charts/datadog, but this creates a datadog agent pod for each Airflow pod. We prefer to have a single pod for dogstatsd agent.
- With the config above, how do I specify statsd mappings? With using the datadog helm chart, the mapping would go in `datadog-values.yaml`. Our mappings are to group many Airflow metrics into a generic metric, and turn the variables on the metric name to tags since large number of metric names increase datadog bill. For example, this one reduces 300+ (number of DAGs we have) metrics down to 1:
```
- match: 'airflow\.dag_processing\.last_duration\.(.*)'
match_type: "regex"
name: "airflow.dag_processing.last_duration"
tags:
dag_file: "$1"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kimyen commented on issue #17920: Support statsd mappings for DataDog
Posted by GitBox <gi...@apache.org>.
kimyen commented on issue #17920:
URL: https://github.com/apache/airflow/issues/17920#issuecomment-910516799
Per my comments above, I thought that the `statsd` component in the official Helm chart v1.1.0 is what I want. When I started to try to patch the `statsd` K8s template in 1.1.0 to match the datadog agent pod (ref. in the datadog helm linked above), I realized that:
- The K8s template is going to be very different. The datadog agent pod will be running multiple containers with different images, commands, and config.
- The datadog helm chart runs on all the host in the cluster and collect other metrics about the host (CPU/ memory). While I didn't like having so many datadog agent pod, I found work arounds and now understand why they are there.
I guess I will stick with the datadog helm chart.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org