Grafana?系列之统一展示Prometheus数据源(grafana 中文)不要告诉别人

随心笔谈2年前发布 admin
192 0 0

文章摘要

这篇文章介绍了如何配置一个使用Prometheus作为数据源的API设置。核心内容是通过配置`datasources`、`access`、`url`和`jsonData`字段,实现了对Prometheus服务的访问,并展示了如何通过`exemplarTraceIdDestinations`和`externalLink`字段实现日志数据的可视化与Grafana的集成。文章重点突出了配置管理Alerts的流程,以及如何通过指定的字段确保数据源的正确连接和日志访问。

apiVersion: 1
datasources:
– name: Prometheus
type: prometheus
# Access mode – proxy (server in the UI) or direct (browser in the UI).
access: proxy
url: http://localhost:9090
jsonData:
httpMethod: POST
manageAlerts: true
prometheusType: Prometheus
prometheusVersion: 2.37.0
cacheLevel: ‘High’
exemplarTraceIdDestinations:
# Field with internal link pointing to data source in Grafana.
# datasourceUid value can be anything, but it should be unique across all defined data source uids.
– datasourceUid: my_jaeger_uid
name: traceID
# Field with external link.
– name: traceID
url: ‘http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Jaeger%22,%7B%22query%22:%22$${__value.raw}%22%7D%5D’

© 版权声明

相关文章