Skywalking运维之路(exporter状态监控)

Skywalking对主机,数据库等系统状态提供了全面的监控,这里来演示下如何进行接入,仅做参考!

1. 监控主机状态

1.1 部署Prometheus node-exporter

bash 复制代码
# 请自行部署

1.2 安装OpenTelemetry Collector

1.2.1 创建文件夹

bash 复制代码
root@ubuntu2204test99:~# mkdir -p OpenTelemetryCollector/config

1.2.2 编写docker-compose

bash 复制代码
root@ubuntu2204test99:~/OpenTelemetryCollector# cat docker-compose.yml
services:
  otel-collector:
    image: otel/opentelemetry-collector-contrib:0.50.0
    command: [ "--config=/etc/otel-collector-config.yaml" ]
    volumes:
      #- ./config/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
      - ./config/otel-collector-config.yaml:/etc/otel-collector-config.yaml
    ports:
      #- 1888:1888 # pprof extension
      #- 28888:8888 # Prometheus metrics exposed by the Collector
      #- 28889:8889 # Prometheus exporter metrics
      #- 13133:13133 # health_check extension
      #- 4317:4317 # OTLP gRPC receiver
      #- 4318:4318 # OTLP http receiver
      - 55678:55678 # zpages extension

1.2.3 修改配置文件

bash 复制代码
root@ubuntu2204test99:~# cat OpenTelemetryCollector/config/otel-collector-config.yaml
receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: "vm-monitoring" # make sure to use this in the vm.yaml to filter only VM metrics
          scrape_interval: 10s
          static_configs:
            - targets: ["192.168.1.98:9100"]

processors:
  batch:

exporters:
  otlp:
    endpoint: "192.168.1.99:11800" # The OAP Server address
    # The config format of OTEL version prior to 0.34.0, eg. 0.29.0, should be:
    # insecure: true
    tls:
      insecure: true
    #insecure: true
  # Exports data to the console
  logging:
    loglevel: debug

service:
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: [batch]
      exporters: [otlp, logging]

2. 监控mysql状态

2.1 部署mysql-exporter

bash 复制代码
# 请自行部署

2.2 修改OpenTelemetry配置

bash 复制代码
root@ubuntu2204test99:~# cat OpenTelemetryCollector/config/otel-collector-config.yaml
receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: "vm-monitoring" # make sure to use this in the vm.yaml to filter only VM metrics
          scrape_interval: 10s
          static_configs:
            - targets: ["192.168.1.98:9100"]
        # 监控Mysql示例
        - job_name: "My-DB-Serv" #注意这个名称
          scrape_interval: 5s
          static_configs:
           - targets: ["192.168.1.43:9105"]
             labels:  #标签会影响在Skywalking中显示的名字
               #host_name: root[root]
               host_name: My-DB[192.168.1.43]

processors:
  batch:

exporters:
  otlp:
    endpoint: "192.168.1.99:11800" # The OAP Server address
    # The config format of OTEL version prior to 0.34.0, eg. 0.29.0, should be:
    # insecure: true
    tls:
      insecure: true
    #insecure: true
  # Exports data to the console
  logging:
    loglevel: debug

service:
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: [batch]
      exporters: [otlp, logging]

2.3 修改Skywalking中mysql的相关配置

bash 复制代码
root@ubuntu2204test99:~/skywailking# vi skywalking-oap/config/otel-rules/mysql/mysql-instance.yaml
#filter: "{ tags -> tags.job_name == 'mysql-monitoring' }" # The OpenTelemetry job name
filter: "{ tags -> tags.job_name == 'HK-DB-Serv' }" # 要和otlp配置的job_name匹配
.........
root@ubuntu2204test99:~/skywailking# vi skywalking-oap/config/otel-rules/mysql/mysql-service.yaml
#filter: "{ tags -> tags.job_name == 'mysql-monitoring' }" # The OpenTelemetry job name
filter: "{ tags -> tags.job_name == 'HK-DB-Serv' }" # 要和otlp配置的job_name匹配
.........
相关推荐
weixin_537217061 天前
花艺资源合集
经验分享
宏集科技工业物联网1 天前
工业HMI选型指南(下):边缘计算、一体化架构与Web化趋势
经验分享·边缘计算·工业自动化·hmi·工控屏·工业触摸屏
LaughingZhu1 天前
Product Hunt 每日热榜 | 2025-12-26
人工智能·经验分享·深度学习·神经网络·产品运营
海边夕阳20061 天前
【每天一个AI小知识】:什么是图神经网络?
人工智能·经验分享·深度学习·神经网络·机器学习
芯有所享1 天前
【芯片设计中的内存管理单元(MMU):虚拟与物理世界的“地址翻译官”】
经验分享
美洽技术1 天前
AI客服vs人工客服:80%成本降低的完整对比分析
经验分享
十二测试录1 天前
Android和iOS测试区别
android·经验分享·ios·职场发展·ab测试
Nwiliuyw1 天前
Isaac Gym的WARNING: Forcing cpu pipeline. GPU pipeline disabled无法启用问题可能是个幌子骗了你
人工智能·经验分享·学习
水力魔方2 天前
武理排水管网模拟分析系统应用专题1:开发环境设置(Windows操作系统)
windows·经验分享·swmm
TM1Club2 天前
Zoey的TM1聊天室|#3 合并报表提速:业财一体如何实现关联方对账自动化
大数据·开发语言·人工智能·经验分享·数据分析·自动化·数据库系统