Abp-VNext用户权限管理系列文章08---skywalking集成与部署

一、集成

1、引入nuget包

SkyAPM.Agent.AspNetCore

2、增加环境变量

ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=SkyAPM.Agent.AspNetCore

3、增加配置文件

复制代码
"SkyWalking": {
    "ServiceName": "order", //服务名
    "Namespace": "",
    "HeaderVersions": [
      "sw8"
    ],
    "Sampling": {
      "SamplePer3Secs": -1,
      "Percentage": -1.0,
      "LogSqlParameterValue": false  
    },
    "Logging": {
      "Level": "Information",
      "FilePath": "logs/skyapm-{Date}.log"
    },
    "Transport": {
      "Interval": 3000,
      "ProtocolVersion": "v8",
      "QueueSize": 30000,
      "BatchSize": 3000,
      "gRPC": {
        "Servers": "10.6.14.30:11800", //指向SkywalkingOAP的地址
        "Timeout": 100000,
        "ConnectTimeout": 100000,
        "ReportTimeout": 600000
      }
    }
  }
复制代码

 

二、部署

1、部署要准备的文件

 切到该文件所在的文件夹,执行命令:docker-compose up

复制代码
version: '2.3'
services:
  elasticsearch:
    image: 10.6.14.30:8845/rancher/elasticsearch:7.10.1
    container_name: spd-elasticsearch
    extra_hosts:
      - "gateway.docker.internal:host-gateway"
    ports:
      - 9300:9300
      - 9200:9200
    restart: always
    environment:
      - TZ=Asia/Shanghai
      - "ES_JAVA_OPTS=-Xms64m -Xmx512m"
      - "discovery.type=single-node"
    volumes:
      - /home/skywalking/elasticsearch/data:/usr/share/elasticsearch/data
      - /home/skywalking/elasticsearch/plugins:/usr/share/elasticsearch/plugins
    networks:
      - skywalking-network
  skywalking-oap:
    image: 10.6.14.30:8845/rancher/skywalking-oap-server:9.6.0
    container_name: skywalking-oap
    security_opt:
      - seccomp:unconfined
    extra_hosts:
      - "gateway.docker.internal:host-gateway"
    environment:
      - TZ=Asia/Shanghai
      - SW_ES_USER=
      - SW_ES_PASSWORD=
      - SW_STORAGE=elasticsearch
      - SW_STORAGE_ES_CLUSTER_NODES=10.6.14.45:9200
    ports:
      - 11800:11800
      - 12800:12800
    volumes:
      - /etc/localtime:/etc/localtime:ro
    restart: always
    networks:
      - skywalking-network
  skywalking-ui: 
    image: 10.6.14.30:8845/rancher/skywalking-ui:9.6.0
    container_name: skywalking-ui
    security_opt:
      - seccomp:unconfined
    extra_hosts:
      - "gateway.docker.internal:host-gateway"
    ports:
      - 8070:8080
    environment:
      - TZ=Asia/Shanghai
      - SW_OAP_ADDRESS=http://10.6.14.45:12800
    restart: always
    networks:
      - skywalking-network
  opentelemetry: 
    image: 10.6.14.30:8845/rancher/opentelemetry-collector:0.86.0
    container_name: opentelemetry
    extra_hosts:
      - "gateway.docker.internal:host-gateway"
    ports:
      - 55678:55678
    command: [ "--config=/etc/otel-collector-config.yaml" ]
    volumes:
      - /home/skywalking/otel-collector-config.yaml:/etc/otel-collector-config.yaml
    restart: always
    networks:
      - skywalking-network
  mysqld-exporter: 
    image: 10.6.14.30:8845/rancher/mysqld-exporter:v0.14.0
    container_name: mysqld-exporter
    extra_hosts:
      - "gateway.docker.internal:host-gateway"
    ports:
      - 9104:9104
    environment:
      - TZ=Asia/Shanghai
      - DATA_SOURCE_NAME=root:JZTeya0!@(10.6.14.45:3306)/
    restart: always
    networks:
      - skywalking-network
networks:
  skywalking-network:
    external: false
复制代码

 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: ['gateway.docker.internal:9100']
  prometheus/2:
    config:
     scrape_configs:
       - job_name: 'mysql-monitoring'
         scrape_interval: 5s
         static_configs:
           - targets: ['gateway.docker.internal:9104']
             labels:
               host_name: showcase

processors:
  batch:
  batch/2:

exporters:
  otlp:
    endpoint: gateway.docker.internal: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
  otlp/2:
    endpoint: gateway.docker.internal:11800
    tls:
      insecure: true
    #insecure: true

service:
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: [batch]
      exporters: [otlp]
    metrics/2:
      receivers: [prometheus/2]
      processors: [batch/2]
      exporters: [otlp/2]
复制代码

 

2、部署成功后的服务

 skywalking-ui

spd-elasticsearch

skywalking-oap

3、部署成功后的界面

 

三、使用

 

posted @   爱生活,爱代码  阅读(44)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2023-11-22 ABP-VNext 用户权限管理系统实战02---用户权限表的创建与迁移
2023-11-22 ABP-VNext 用户权限管理系统实战05----扩展授权类型(单点登录)
2018-11-22 jqgrid 加载时第一页面只显示多少条数据
点击右上角即可分享
微信分享提示