【Centos】Centos 7.6 Skywalking 9.2.0,自监控

1  前言

今儿试试 Skywalking 自监控。

2  安装步骤

2.1  下载 open-telemetry

地址:https://hub.nuaa.cf/open-telemetry/opentelemetry-collector-releases/releases/,我下载的是 0.89.0 版本的哈:

2.2  安装 open-telemetry

rpm -ivh otelcol_0.89.0_linux_amd64.rpm

2.3  新增配置

创建自己的配置文件otel-collection-config.yaml (/etc/otelcol/):

receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: "skywalking-so11y" 
          scrape_interval: 10s
          static_configs:
            - targets: ["0.0.0.0:1234"]
              labels:
                host_name: vmlinux
                service: self-observability
processors:
  batch:

exporters:
  otlp:
    endpoint: "your IP:11800" # The OAP Server address
    tls:
      insecure: true
  logging:
    loglevel: debug
service:
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: [batch]
      exporters: [otlp, logging]

2.4  修改 OpenTelemetry Collector启动参数

修改启动加载的配置文件 /etc/otelcol/otelcol.conf 指向刚刚我们新建的 otel-collection-config.yaml:

OTELCOL_OPTIONS="--config=/etc/otelcol/otel-collection-config.yaml"

2.5  修改 oapService 配置,开启监控

 修改配置文件/usr/local/skywalking/config/application.yaml:

# line 452
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:""}

2.6  重启 oapService

2.7  重启 OpenTelemetry Collector

systemctl restart otelcol

我发现 otelcol 这个玩意,让我这 2C2G 的有点不堪重负啊,IO 飙的不行了啊:

3  小结

暂时先这样,等我后续升级个机器配置。。。

 
posted @ 2024-01-22 09:01  酷酷-  阅读(123)  评论(0编辑  收藏  举报