如何使用proc_name标记gunicorn指标?

问题描述 投票:1回答:1

我正在将多个应用程序中的gunicorn指标从同一主机推送到datadog但是我找不到使用tag或proc_name对statsd指标进行分组的方法。

Datadog gunicorn整合

https://app.datadoghq.com/account/settings#integrations/gunicorn

使用app:proc_name标记自动更新Datadog代理检查。我可以使用它来分组和选择特定服务的数据。

https://github.com/DataDog/dd-agent/blob/5.2.x/checks.d/gunicorn.py#L53

但是对于statsd指标,我看不到如何分配标记或proc_name。这不是自动完成的,我也没有看到指定标签的方法。

https://github.com/benoitc/gunicorn/blob/19.6.0/gunicorn/instrument/statsd.py#L90

Datadog配置:

cat /etc/dd-agent/datadog.conf 

[Main]

dd_url: https://app.datadoghq.com
api_key: <KEY>

bind_host: 0.0.0.0
log_level: INFO
statsd_metric_namespace: my_namespace
tags: role:[service, test]

Gunicorn配置:

# cat /etc/dd-agent/conf.d/gunicorn.yaml

init_config:
instances:
-   proc_name: service
-   proc_name: another_service

关于如何实现这一点的任何想法?

使用笔记本的示例:

在这个例子中,我可以在'from'或'avg by'下拉列表中选择app:service

Timeseries - `gunicorn.workers` - from `app:service`

对于具有my_namespace前缀的度量标准,我无法引用相同的应用程序名称。只有主机和环境相关的标签可用。

Timeseries - `my_namespace.gunicorn.workers` - from "Not available"
Timeseries - `my_namespace.gunicorn.requests` - from "Not available"
gunicorn datadog
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.