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匹配
.........
相关推荐
是做服装的同学3 分钟前
如何通过服装管理ERP软件实现生产流程的高效优化?
大数据·经验分享·其他
源代码•宸1 小时前
大厂技术岗面试之一面(准备自我介绍、反问)
经验分享·后端·算法·面试·职场和发展·golang·反问
Bruce_Liuxiaowei10 小时前
基于HTA的Meterpreter反向Shell攻击实验
网络·windows·经验分享·网络安全·渗透测试
中屹指纹浏览器13 小时前
双GAN网络驱动的动态指纹生成技术深度解析——原理、实现与抗检测优化
经验分享·笔记
芯有所享14 小时前
【芯片工艺选择的艺术:如何在前端设计阶段平衡PPA与成本】
经验分享
思陌Ai算法定制15 小时前
Radiology | 基于深度学习的CT骨质疏松机会性筛查:跨设备标准化与大规模人群基准值
经验分享
芯片智造17 小时前
探索半导体3D动画中的科技感:企业视觉识别系统的创新之路
经验分享·半导体·3d动画·芯片制造·芯片动画·半导体动画
灏瀚星空17 小时前
基于 Python 与 GitHub,打造个人专属本地化思维导图工具全流程方案(上)
开发语言·人工智能·经验分享·笔记·python·个人开发·visual studio
三流架构师18 小时前
线性代数资源合集
经验分享
纵有疾風起19 小时前
【Linux 系统开发】基础开发工具详解:自动化构建、版本控制与调试器开发实战
linux·服务器·开发语言·c++·经验分享·开源·bash