文章摘要
这篇文章介绍了如何配置Jenkins和Grafana,使用Prometheus作为数据源进行实时监控和告警管理。文章详细说明了如何通过API访问Prometheus,设置访问模式为代理,连接到localhost:9090,并使用POST方法发送JSON数据。此外,文章还介绍了配置traceID的内部和外部链接,展示了如何在Grafana中通过URL访问相关数据。这些内容有助于用户优化Jenkins与Grafana的集成,提升监控和告警管理的效率。
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’
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’
© 版权声明
文章版权归作者所有,未经允许请勿转载。



