1.准备:
实验版本:skywalking 9.1.0
官网:https://skywalking.apache.org/docs/main/v9.1.0/en/setup/backend/prometheus-metrics/
2.开启prometheus遥测数据
修改skywalking application.yml配置,修改${SW_TELEMETRY:prometheus}
telemetry: selector: ${SW_TELEMETRY:prometheus} none: prometheus: host: ${SW_TELEMETRY_PROMETHEUS_HOST:0.0.0.0} port: ${SW_TELEMETRY_PROMETHEUS_PORT:1234} sslEnabled: ${SW_TELEMETRY_PROMETHEUS_SSL_ENABLED:false} sslKeyPath: ${SW_TELEMETRY_PROMETHEUS_SSL_KEY_PATH:""} sslCertChainPath: ${SW_TELEMETRY_PROMETHEUS_SSL_CERT_CHAIN_PATH:""}
3.开启Prometheus Fetcher
修改application.yml:selector: ${SW_PROMETHEUS_FETCHER:default}
prometheus-fetcher: selector: ${SW_PROMETHEUS_FETCHER:default} default: enabledRules: ${SW_PROMETHEUS_FETCHER_ENABLED_RULES:"self"} maxConvertWorker: ${SW_PROMETHEUS_FETCHER_NUM_CONVERT_WORKER:-1}
4.重启skywalking,发现多了1234端口,并测试验证
备注:
采集规则配置:/config/fetcher-prom-rules/self.yaml