Traefik开启监控,日志,追踪需要的参数

监控

官方文档地址:https://doc.traefik.io/traefik/observability/metrics/overview/

可以使用多种监控软件,比如Datadog,InfluxDB,Prometheus,StatsD
在这里使用Prometheus

--api.debug=true
--metrics.prometheus=true
--metrics.prometheus.addEntryPointsLabels=true
--metrics.prometheus.addrouterslabels=true
--metrics.prometheus.addServicesLabels=true
--entryPoints.metrics.address=:8082
--metrics.prometheus.entryPoint=metrics
--metrics.prometheus.manualrouting=true

日志

官方文档地址:https://doc.traefik.io/traefik/observability/access-logs/

--accesslog=true
--accesslog.format=json # text
--log.filePath=/path/to/traefik.log #可以创建数据卷把这个路径给挂载出去
--log.level=DEBUG # DEBUG, PANIC, FATAL, ERROR, WARN, INFO
--accesslog.fields.defaultmode=keep
--accesslog.fields.names.ClientUsername=drop
--accesslog.fields.headers.defaultmode=keep
--accesslog.fields.headers.names.User-Agent=redact
--accesslog.fields.headers.names.Authorization=drop
--accesslog.fields.headers.names.Content-Type=keep

追踪

官方文档地址:https://doc.traefik.io/traefik/observability/tracing/elastic/

Traefik支持六个跟踪后端:Jaeger,Zipkin,Datadog,Instana,Haystack,Elastic

在这里是作为Elastic APM Agent来进行处理的,所以配置的是Elastic APM server相关参数

--tracing=true
--tracing.serviceName=traefik
--tracing.spanNameLimit=150
--tracing.elastic=true
--tracing.elastic.serverurl="http://apm:8200"
--tracing.elastic.secrettoken="mytoken"
--tracing.elastic.serviceenvironment="production"

posted @   哈喽哈喽111111  阅读(1970)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2020-12-31 解决centos系统突然间网络不通的问题:Global IPv6 forwarding is disabled in configuration, but not currently disabled in kernel
点击右上角即可分享
微信分享提示