apache-skywalking-apm-10.1.0使用

打印 上一主题 下一主题

主题 819|帖子 819|积分 2457

apache-skywalking-apm-10.1.0使用
本文重要介绍怎样使用apache-skywalking-apm-10.1.0,同时配合elasticsearch-8.17.0-windows-x86_64来作为存储 es长期化数据使用。
步骤如下:
一、下载elasticsearch-8.17.0-windows-x86_64

1、下载ES(elasticsearch 简称 ES 下载链接:https://www.elastic.co/downloads/elasticsearch)
ES 下载链接:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.17.0-windows-x86_64.zip)),必要在修改ES配置,进入ES解压以后的文件下的config目录,找到elasticsearch.yml,打开后修改自己必要的配置,可以参考ES elasticsearch-8.17.0-windows-x86_64使用 - 龙骑科技 - 博客园
二、下载skywalking

下载地址:https://skywalking.apache.org/downloads/,之后再解压,如下:

下载之后解压

三、安装jdk21

elasticsearch-8.17.0自带的jdk23版本过高,skywalking-v10.1.0无法使用。必要skywalking-v10.1.0最高支持jdk21,所以必要下载对应版本的jdk,即下载jdk21,下载地址:Archived OpenJDK GA Releases,java情况配置参考:自学[vue+SpringCloud]-002-配置本机java情况_springcloud vue搭建-CSDN博客
可以从 Oracle 的 JDK 下载页面 或者使用 AdoptOpenJDK 等其他泉源下载和安装。假如是安装包,则安装完成后,你可以使用以下命令 java -version,在命令提示符中确认 JDK 是否安装乐成,
假如绿色版本的https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_windows-x64_bin.zip,只必要解压道指定目录即可,
本文采取的是绿色版本的,https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_windows-x64_bin.zip下载的。
1、配置 JAVA_HOME 情况变量
1.1 设置 JAVA_HOME
        打开系统属性:
       右键点击桌面的“此电脑”图标,选择“属性”。
       在打开的窗口左侧,点击“高级系统设置”。
1.2 打开情况变量设置:
      在“系统属性”窗口中,点击“高级”选项卡下的“情况变量”按钮。
      添加 JAVA_HOME:
     在情况变量窗口中,在“系统变量”下点击“新建”按钮。
      在“变量名”中输入 JAVA_HOME,在“变量值”中输入 JDK 的安装路径,比方 C:\Program Files\Java\jdk-17。本文采取绿色版本,解压目录为D:\soft\java\openjdk-21.0.2_windows-x64_bin\jdk-21.0.2

2、 配置 PATH 变量
编辑 PATH 变量:
在“系统变量”下找到 Path,选择并点击“编辑”按钮。
在“编辑情况变量”窗口中,点击“新建”,然后添加 %JAVA_HOME%\bin。

3、 验证配置
配置完成后,打开新的命令提示符窗口,运行以下命令验证:
  1. echo %JAVA_HOME%
  2. 它应该输出你设置的 JDK 路径。你还可以运行 java -version 和 javac -version 以确保 Java 和 Java 编译器的版本正确。
复制代码


多 JDK 版本切换(可选)

假如你有多个 JDK 版本安装并必要切换,可以通过修改 JAVA_HOME 变量的值来实现。你可以手动更改,或者编写一个批处理脚本来快速切换。
比方,创建一个批处理文件 switchJDK.bat,内容如下:
  1. @echo off
  2. setlocal
  3. set JDK8="C:\Program Files\Java\jdk1.8.0_271"
  4. set JDK11="C:\Program Files\Java\jdk-11.0.9"
  5. set JDK17="C:\Program Files\Java\jdk-17"
  6. if "%1"=="8" (
  7.     set JAVA_HOME=%JDK8%
  8. ) else if "%1"=="11" (
  9.     set JAVA_HOME=%JDK11%
  10. ) else if "%1"=="17" (
  11.     set JAVA_HOME=%JDK17%
  12. ) else (
  13.     echo Invalid JDK version
  14.     exit /b 1
  15. )
  16. setx JAVA_HOME "%JAVA_HOME%"
  17. echo JAVA_HOME set to %JAVA_HOME%
  18. endlocal
复制代码
使用此脚本切换 JDK 版本时,只需在命令提示符中运行:
  1. switchJDK 8  // 切换到 JDK 8
  2. switchJDK 11 // 切换到 JDK 11
  3. switchJDK 17 // 切换到 JDK 17
复制代码


这样可以方便地在不同版本的 JDK 之间切换。
四、修改配置apache-skywalking-apm-10.1.0

修改collector收集器 配置文件D:\Temp\1\apache-skywalking-apm-bin\config
1、修改application.yml
  1. # Licensed to the Apache Software Foundation (ASF) under one or more
  2. # contributor license agreements.  See the NOTICE file distributed with
  3. # this work for additional information regarding copyright ownership.
  4. # The ASF licenses this file to You under the Apache License, Version 2.0
  5. # (the "License"); you may not use this file except in compliance with
  6. # the License.  You may obtain a copy of the License at
  7. #
  8. #     http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. cluster:
  16.   selector: ${SW_CLUSTER:standalone}
  17.   standalone:
  18.   # Please check your ZooKeeper is 3.5+, However, it is also compatible with ZooKeeper 3.4.x. Replace the ZooKeeper 3.5+
  19.   # library the oap-libs folder with your ZooKeeper 3.4.x library.
  20.   zookeeper:
  21.     namespace: ${SW_NAMESPACE:""}
  22.     hostPort: ${SW_CLUSTER_ZK_HOST_PORT:localhost:2181}
  23.     # Retry Policy
  24.     baseSleepTimeMs: ${SW_CLUSTER_ZK_SLEEP_TIME:1000} # initial amount of time to wait between retries
  25.     maxRetries: ${SW_CLUSTER_ZK_MAX_RETRIES:3} # max number of times to retry
  26.     # Enable ACL
  27.     enableACL: ${SW_ZK_ENABLE_ACL:false} # disable ACL in default
  28.     schema: ${SW_ZK_SCHEMA:digest} # only support digest schema
  29.     expression: ${SW_ZK_EXPRESSION:skywalking:skywalking}
  30.     internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
  31.     internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
  32.   kubernetes:
  33.     namespace: ${SW_CLUSTER_K8S_NAMESPACE:default}
  34.     labelSelector: ${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
  35.     uidEnvName: ${SW_CLUSTER_K8S_UID:SKYWALKING_COLLECTOR_UID}
  36.   consul:
  37.     serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
  38.     # Consul cluster nodes, example: 10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500
  39.     hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:localhost:8500}
  40.     aclToken: ${SW_CLUSTER_CONSUL_ACLTOKEN:""}
  41.     internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
  42.     internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
  43.   etcd:
  44.     # etcd cluster nodes, example: 10.0.0.1:2379,10.0.0.2:2379,10.0.0.3:2379
  45.     endpoints: ${SW_CLUSTER_ETCD_ENDPOINTS:localhost:2379}
  46.     namespace: ${SW_CLUSTER_ETCD_NAMESPACE:/skywalking}
  47.     serviceName: ${SW_CLUSTER_ETCD_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
  48.     authentication: ${SW_CLUSTER_ETCD_AUTHENTICATION:false}
  49.     user: ${SW_CLUSTER_ETCD_USER:}
  50.     password: ${SW_CLUSTER_ETCD_PASSWORD:}
  51.     internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
  52.     internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
  53.   nacos:
  54.     serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
  55.     hostPort: ${SW_CLUSTER_NACOS_HOST_PORT:localhost:8848}
  56.     # Nacos Naming namespace
  57.     namespace: ${SW_CLUSTER_NACOS_NAMESPACE:"public"}
  58.     contextPath: ${SW_CLUSTER_NACOS_CONTEXT_PATH:""}
  59.     # Nacos auth username
  60.     username: ${SW_CLUSTER_NACOS_USERNAME:""}
  61.     password: ${SW_CLUSTER_NACOS_PASSWORD:""}
  62.     # Nacos auth accessKey
  63.     accessKey: ${SW_CLUSTER_NACOS_ACCESSKEY:""}
  64.     secretKey: ${SW_CLUSTER_NACOS_SECRETKEY:""}
  65.     internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
  66.     internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
  67. core:
  68.   selector: ${SW_CORE:default}
  69.   default:
  70.     # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
  71.     # Receiver: Receive agent data, Level 1 aggregate
  72.     # Aggregator: Level 2 aggregate
  73.     role: ${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
  74.     restHost: ${SW_CORE_REST_HOST:0.0.0.0}
  75.     restPort: ${SW_CORE_REST_PORT:12800}
  76.     restContextPath: ${SW_CORE_REST_CONTEXT_PATH:/}
  77.     restMaxThreads: ${SW_CORE_REST_MAX_THREADS:200}
  78.     restIdleTimeOut: ${SW_CORE_REST_IDLE_TIMEOUT:30000}
  79.     restAcceptQueueSize: ${SW_CORE_REST_QUEUE_SIZE:0}
  80.     httpMaxRequestHeaderSize: ${SW_CORE_HTTP_MAX_REQUEST_HEADER_SIZE:8192}
  81.     gRPCHost: ${SW_CORE_GRPC_HOST:0.0.0.0}
  82.     gRPCPort: ${SW_CORE_GRPC_PORT:11800}
  83.     maxConcurrentCallsPerConnection: ${SW_CORE_GRPC_MAX_CONCURRENT_CALL:0}
  84.     maxMessageSize: ${SW_CORE_GRPC_MAX_MESSAGE_SIZE:52428800} #50MB
  85.     gRPCThreadPoolSize: ${SW_CORE_GRPC_THREAD_POOL_SIZE:-1}
  86.     gRPCSslEnabled: ${SW_CORE_GRPC_SSL_ENABLED:false}
  87.     gRPCSslKeyPath: ${SW_CORE_GRPC_SSL_KEY_PATH:""}
  88.     gRPCSslCertChainPath: ${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
  89.     gRPCSslTrustedCAPath: ${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
  90.     downsampling:
  91.       - Hour
  92.       - Day
  93.     # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
  94.     enableDataKeeperExecutor: ${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
  95.     dataKeeperExecutePeriod: ${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
  96.     recordDataTTL: ${SW_CORE_RECORD_DATA_TTL:3} # Unit is day
  97.     metricsDataTTL: ${SW_CORE_METRICS_DATA_TTL:7} # Unit is day
  98.     # The period of L1 aggregation flush to L2 aggregation. Unit is ms.
  99.     l1FlushPeriod: ${SW_CORE_L1_AGGREGATION_FLUSH_PERIOD:500}
  100.     # The threshold of session time. Unit is ms. Default value is 70s.
  101.     storageSessionTimeout: ${SW_CORE_STORAGE_SESSION_TIMEOUT:70000}
  102.     # The period of doing data persistence. Unit is second.Default value is 25s
  103.     persistentPeriod: ${SW_CORE_PERSISTENT_PERIOD:25}
  104.     topNReportPeriod: ${SW_CORE_TOPN_REPORT_PERIOD:10} # top_n record worker report cycle, unit is minute
  105.     # Extra model column are the column defined by in the codes, These columns of model are not required logically in aggregation or further query,
  106.     # and it will cause more load for memory, network of OAP and storage.
  107.     # But, being activated, user could see the name in the storage entities, which make users easier to use 3rd party tool, such as Kibana->ES, to query the data by themselves.
  108.     activeExtraModelColumns: ${SW_CORE_ACTIVE_EXTRA_MODEL_COLUMNS:false}
  109.     # The max length of service + instance names should be less than 200
  110.     serviceNameMaxLength: ${SW_SERVICE_NAME_MAX_LENGTH:70}
  111.     # The period(in seconds) of refreshing the service cache. Default value is 10s.
  112.     serviceCacheRefreshInterval: ${SW_SERVICE_CACHE_REFRESH_INTERVAL:10}
  113.     instanceNameMaxLength: ${SW_INSTANCE_NAME_MAX_LENGTH:70}
  114.     # The max length of service + endpoint names should be less than 240
  115.     endpointNameMaxLength: ${SW_ENDPOINT_NAME_MAX_LENGTH:150}
  116.     # Define the set of span tag keys, which should be searchable through the GraphQL.
  117.     # The max length of key=value should be less than 256 or will be dropped.
  118.     searchableTracesTags: ${SW_SEARCHABLE_TAG_KEYS:http.method,http.status_code,rpc.status_code,db.type,db.instance,mq.queue,mq.topic,mq.broker}
  119.     # Define the set of log tag keys, which should be searchable through the GraphQL.
  120.     # The max length of key=value should be less than 256 or will be dropped.
  121.     searchableLogsTags: ${SW_SEARCHABLE_LOGS_TAG_KEYS:level,http.status_code}
  122.     # Define the set of alarm tag keys, which should be searchable through the GraphQL.
  123.     # The max length of key=value should be less than 256 or will be dropped.
  124.     searchableAlarmTags: ${SW_SEARCHABLE_ALARM_TAG_KEYS:level}
  125.     # The max size of tags keys for autocomplete select.
  126.     autocompleteTagKeysQueryMaxSize: ${SW_AUTOCOMPLETE_TAG_KEYS_QUERY_MAX_SIZE:100}
  127.     # The max size of tags values for autocomplete select.
  128.     autocompleteTagValuesQueryMaxSize: ${SW_AUTOCOMPLETE_TAG_VALUES_QUERY_MAX_SIZE:100}
  129.     # The number of threads used to prepare metrics data to the storage.
  130.     prepareThreads: ${SW_CORE_PREPARE_THREADS:2}
  131.     # Turn it on then automatically grouping endpoint by the given OpenAPI definitions.
  132.     enableEndpointNameGroupingByOpenapi: ${SW_CORE_ENABLE_ENDPOINT_NAME_GROUPING_BY_OPENAPI:true}
  133.     # The period of HTTP URI pattern recognition. Unit is second.
  134.     syncPeriodHttpUriRecognitionPattern: ${SW_CORE_SYNC_PERIOD_HTTP_URI_RECOGNITION_PATTERN:10}
  135.     # The training period of HTTP URI pattern recognition. Unit is second.
  136.     trainingPeriodHttpUriRecognitionPattern: ${SW_CORE_TRAINING_PERIOD_HTTP_URI_RECOGNITION_PATTERN:60}
  137.     # The max number of HTTP URIs per service for further URI pattern recognition.
  138.     maxHttpUrisNumberPerService: ${SW_CORE_MAX_HTTP_URIS_NUMBER_PER_SVR:3000}
  139.     # If disable the hierarchy, the service and instance hierarchy relation will not be built. And the query of hierarchy will return empty result.
  140.     # All the hierarchy relations are defined in the `hierarchy-definition.yml`.
  141.     # Notice: some of the configurations only available for kubernetes environments.
  142.     enableHierarchy: ${SW_CORE_ENABLE_HIERARCHY:true}
  143. storage:
  144.   selector: ${SW_STORAGE:elasticsearch}
  145.   elasticsearch:
  146.     namespace: ${SW_NAMESPACE:"linjie"}
  147.     clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
  148.     protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
  149.     connectTimeout: ${SW_STORAGE_ES_CONNECT_TIMEOUT:3000}
  150.     socketTimeout: ${SW_STORAGE_ES_SOCKET_TIMEOUT:30000}
  151.     responseTimeout: ${SW_STORAGE_ES_RESPONSE_TIMEOUT:15000}
  152.     numHttpClientThread: ${SW_STORAGE_ES_NUM_HTTP_CLIENT_THREAD:0}
  153.     user: ${SW_ES_USER:""}
  154.     password: ${SW_ES_PASSWORD:""}
  155.     trustStorePath: ${SW_STORAGE_ES_SSL_JKS_PATH:""}
  156.     trustStorePass: ${SW_STORAGE_ES_SSL_JKS_PASS:""}
  157.     secretsManagementFile: ${SW_ES_SECRETS_MANAGEMENT_FILE:""} # Secrets management file in the properties format includes the username, password, which are managed by 3rd party tool.
  158.     dayStep: ${SW_STORAGE_DAY_STEP:1} # Represent the number of days in the one minute/hour/day index.
  159.     indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:1} # Shard number of new indexes
  160.     indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:1} # Replicas number of new indexes
  161.     # Specify the settings for each index individually.
  162.     # If configured, this setting has the highest priority and overrides the generic settings.
  163.     specificIndexSettings: ${SW_STORAGE_ES_SPECIFIC_INDEX_SETTINGS:""}
  164.     # Super data set has been defined in the codes, such as trace segments.The following 3 config would be improve es performance when storage super size data in es.
  165.     superDatasetDayStep: ${SW_STORAGE_ES_SUPER_DATASET_DAY_STEP:-1} # Represent the number of days in the super size dataset record index, the default value is the same as dayStep when the value is less than 0
  166.     superDatasetIndexShardsFactor: ${SW_STORAGE_ES_SUPER_DATASET_INDEX_SHARDS_FACTOR:5} #  This factor provides more shards for the super data set, shards number = indexShardsNumber * superDatasetIndexShardsFactor. Also, this factor effects Zipkin traces.
  167.     superDatasetIndexReplicasNumber: ${SW_STORAGE_ES_SUPER_DATASET_INDEX_REPLICAS_NUMBER:0} # Represent the replicas number in the super size dataset record index, the default value is 0.
  168.     indexTemplateOrder: ${SW_STORAGE_ES_INDEX_TEMPLATE_ORDER:0} # the order of index template
  169.     bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:5000} # Execute the async bulk record data every ${SW_STORAGE_ES_BULK_ACTIONS} requests
  170.     batchOfBytes: ${SW_STORAGE_ES_BATCH_OF_BYTES:10485760} # A threshold to control the max body size of ElasticSearch Bulk flush.
  171.     # flush the bulk every 5 seconds whatever the number of requests
  172.     flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:5}
  173.     concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requests
  174.     resultWindowMaxSize: ${SW_STORAGE_ES_QUERY_MAX_WINDOW_SIZE:10000}
  175.     metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:10000}
  176.     scrollingBatchSize: ${SW_STORAGE_ES_SCROLLING_BATCH_SIZE:5000}
  177.     segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200}
  178.     profileTaskQueryMaxSize: ${SW_STORAGE_ES_QUERY_PROFILE_TASK_SIZE:200}
  179.     profileDataQueryBatchSize: ${SW_STORAGE_ES_QUERY_PROFILE_DATA_BATCH_SIZE:100}
  180.     oapAnalyzer: ${SW_STORAGE_ES_OAP_ANALYZER:"{"analyzer":{"oap_analyzer":{"type":"stop"}}}"} # the oap analyzer.
  181.     oapLogAnalyzer: ${SW_STORAGE_ES_OAP_LOG_ANALYZER:"{"analyzer":{"oap_log_analyzer":{"type":"standard"}}}"} # the oap log analyzer. It could be customized by the ES analyzer configuration to support more language log formats, such as Chinese log, Japanese log and etc.
  182.     advanced: ${SW_STORAGE_ES_ADVANCED:""}
  183.     # Enable shard metrics and records indices into multi-physical indices, one index template per metric/meter aggregation function or record.
  184.     logicSharding: ${SW_STORAGE_ES_LOGIC_SHARDING:false}
  185.     # Custom routing can reduce the impact of searches. Instead of having to fan out a search request to all the shards in an index, the request can be sent to just the shard that matches the specific routing value (or values).
  186.     enableCustomRouting: ${SW_STORAGE_ES_ENABLE_CUSTOM_ROUTING:false}
  187.   h2:
  188.     properties:
  189.       jdbcUrl: ${SW_STORAGE_H2_URL:jdbc:h2:mem:skywalking-oap-db;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=FALSE}
  190.       dataSource.user: ${SW_STORAGE_H2_USER:sa}
  191.     metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000}
  192.     maxSizeOfBatchSql: ${SW_STORAGE_MAX_SIZE_OF_BATCH_SQL:100}
  193.     asyncBatchPersistentPoolSize: ${SW_STORAGE_ASYNC_BATCH_PERSISTENT_POOL_SIZE:1}
  194.   mysql:
  195.     properties:
  196.       jdbcUrl: ${SW_JDBC_URL:"jdbc:mysql://localhost:3306/swtest?rewriteBatchedStatements=true&allowMultiQueries=true"}
  197.       dataSource.user: ${SW_DATA_SOURCE_USER:root}
  198.       dataSource.password: ${SW_DATA_SOURCE_PASSWORD:root@1234}
  199.       dataSource.cachePrepStmts: ${SW_DATA_SOURCE_CACHE_PREP_STMTS:true}
  200.       dataSource.prepStmtCacheSize: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE:250}
  201.       dataSource.prepStmtCacheSqlLimit: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT:2048}
  202.       dataSource.useServerPrepStmts: ${SW_DATA_SOURCE_USE_SERVER_PREP_STMTS:true}
  203.     metadataQueryMaxSize: ${SW_STORAGE_MYSQL_QUERY_MAX_SIZE:5000}
  204.     maxSizeOfBatchSql: ${SW_STORAGE_MAX_SIZE_OF_BATCH_SQL:2000}
  205.     asyncBatchPersistentPoolSize: ${SW_STORAGE_ASYNC_BATCH_PERSISTENT_POOL_SIZE:4}
  206.   postgresql:
  207.     properties:
  208.       jdbcUrl: ${SW_JDBC_URL:"jdbc:postgresql://localhost:5432/skywalking"}
  209.       dataSource.user: ${SW_DATA_SOURCE_USER:postgres}
  210.       dataSource.password: ${SW_DATA_SOURCE_PASSWORD:123456}
  211.       dataSource.cachePrepStmts: ${SW_DATA_SOURCE_CACHE_PREP_STMTS:true}
  212.       dataSource.prepStmtCacheSize: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE:250}
  213.       dataSource.prepStmtCacheSqlLimit: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT:2048}
  214.       dataSource.useServerPrepStmts: ${SW_DATA_SOURCE_USE_SERVER_PREP_STMTS:true}
  215.     metadataQueryMaxSize: ${SW_STORAGE_MYSQL_QUERY_MAX_SIZE:5000}
  216.     maxSizeOfBatchSql: ${SW_STORAGE_MAX_SIZE_OF_BATCH_SQL:2000}
  217.     asyncBatchPersistentPoolSize: ${SW_STORAGE_ASYNC_BATCH_PERSISTENT_POOL_SIZE:4}
  218.   banyandb:
  219.     # Targets is the list of BanyanDB servers, separated by commas.
  220.     # Each target is a BanyanDB server in the format of `host:port`
  221.     # The host is the IP address or domain name of the BanyanDB server, and the port is the port number of the BanyanDB server.
  222.     targets: ${SW_STORAGE_BANYANDB_TARGETS:localhost:17912}
  223.     # The max number of records in a bulk write request.
  224.     # Bigger value can improve the write performance, but also increase the OAP and BanyanDB Server memory usage.
  225.     maxBulkSize: ${SW_STORAGE_BANYANDB_MAX_BULK_SIZE:10000}
  226.     # The minimum seconds between two bulk flushes.
  227.     # If the data in a bulk is less than maxBulkSize, the data will be flushed after this period.
  228.     # If the data in a bulk is more than maxBulkSize, the data will be flushed immediately.
  229.     # Bigger value can reduce the write pressure on BanyanDB Server, but also increase the latency of the data.
  230.     flushInterval: ${SW_STORAGE_BANYANDB_FLUSH_INTERVAL:15}
  231.     # The timeout seconds of a bulk flush.
  232.     flushTimeout: ${SW_STORAGE_BANYANDB_FLUSH_TIMEOUT:10}
  233.     # The shard number of `measure` groups that store the metrics data.
  234.     metricsShardsNumber: ${SW_STORAGE_BANYANDB_METRICS_SHARDS_NUMBER:1}
  235.     # The shard number of `stream` groups that store the trace, log and profile data.
  236.     recordShardsNumber: ${SW_STORAGE_BANYANDB_RECORD_SHARDS_NUMBER:1}
  237.     # The multiplier of the number of shards of the super dataset.
  238.     # Super dataset is a special dataset that stores the trace or log data that is too large to be stored in the normal dataset.
  239.     # If the normal dataset has `n` shards, the super dataset will have `n * superDatasetShardsFactor` shards.
  240.     # For example, supposing `recordShardsNumber` is 3, and `superDatasetShardsFactor` is 2,
  241.     # `segment-default` is a normal dataset that has 3 shards, and `segment-minute` is a super dataset that has 6 shards.
  242.     superDatasetShardsFactor: ${SW_STORAGE_BANYANDB_SUPERDATASET_SHARDS_FACTOR:2}
  243.     # The number of threads that write data to BanyanDB concurrently.
  244.     # Bigger value can improve the write performance, but also increase the OAP and BanyanDB Server CPU usage.
  245.     concurrentWriteThreads: ${SW_STORAGE_BANYANDB_CONCURRENT_WRITE_THREADS:15}
  246.     # The max number of profile task query in a request.
  247.     profileTaskQueryMaxSize: ${SW_STORAGE_BANYANDB_PROFILE_TASK_QUERY_MAX_SIZE:200}
  248.     # Data is stored in BanyanDB in segments. A segment is a time range of data.
  249.     # The segment interval is the time range of a segment.
  250.     # The value should be less or equal to data TTL relevant settings.
  251.     segmentIntervalDays: ${SW_STORAGE_BANYANDB_SEGMENT_INTERVAL_DAYS:1}
  252.     # The super dataset segment interval is the time range of a segment in the super dataset.
  253.     superDatasetSegmentIntervalDays: ${SW_STORAGE_BANYANDB_SUPER_DATASET_SEGMENT_INTERVAL_DAYS:1}
  254.     # Specific groups settings.
  255.     # For example, {"group1": {"blockIntervalHours": 4, "segmentIntervalDays": 1}}
  256.     # Please refer to https://github.com/apache/skywalking-banyandb/blob/${BANYANDB_RELEASE}/docs/interacting/bydbctl/schema/group.md#create-operation
  257.     # for group setting details.
  258.     specificGroupSettings: ${SW_STORAGE_BANYANDB_SPECIFIC_GROUP_SETTINGS:""}
  259.     # If the BanyanDB server is configured with TLS, config the TLS cert file path and open tls connection.
  260.     sslTrustCAPath: ${SW_STORAGE_BANYANDB_SSL_TRUST_CA_PATH:""}
  261. agent-analyzer:
  262.   selector: ${SW_AGENT_ANALYZER:default}
  263.   default:
  264.     # The default sampling rate and the default trace latency time configured by the 'traceSamplingPolicySettingsFile' file.
  265.     traceSamplingPolicySettingsFile: ${SW_TRACE_SAMPLING_POLICY_SETTINGS_FILE:trace-sampling-policy-settings.yml}
  266.     slowDBAccessThreshold: ${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100} # The slow database access thresholds. Unit ms.
  267.     forceSampleErrorSegment: ${SW_FORCE_SAMPLE_ERROR_SEGMENT:true} # When sampling mechanism active, this config can open(true) force save some error segment. true is default.
  268.     segmentStatusAnalysisStrategy: ${SW_SEGMENT_STATUS_ANALYSIS_STRATEGY:FROM_SPAN_STATUS} # Determine the final segment status from the status of spans. Available values are `FROM_SPAN_STATUS` , `FROM_ENTRY_SPAN` and `FROM_FIRST_SPAN`. `FROM_SPAN_STATUS` represents the segment status would be error if any span is in error status. `FROM_ENTRY_SPAN` means the segment status would be determined by the status of entry spans only. `FROM_FIRST_SPAN` means the segment status would be determined by the status of the first span only.
  269.     # Nginx and Envoy agents can't get the real remote address.
  270.     # Exit spans with the component in the list would not generate the client-side instance relation metrics.
  271.     noUpstreamRealAddressAgents: ${SW_NO_UPSTREAM_REAL_ADDRESS:6000,9000}
  272.     meterAnalyzerActiveFiles: ${SW_METER_ANALYZER_ACTIVE_FILES:datasource,threadpool,satellite,go-runtime,python-runtime,continuous-profiling,java-agent} # Which files could be meter analyzed, files split by ","
  273.     slowCacheReadThreshold: ${SW_SLOW_CACHE_SLOW_READ_THRESHOLD:default:20,redis:10} # The slow cache read operation thresholds. Unit ms.
  274.     slowCacheWriteThreshold: ${SW_SLOW_CACHE_SLOW_WRITE_THRESHOLD:default:20,redis:10} # The slow cache write operation thresholds. Unit ms.
  275. log-analyzer:
  276.   selector: ${SW_LOG_ANALYZER:default}
  277.   default:
  278.     lalFiles: ${SW_LOG_LAL_FILES:envoy-als,mesh-dp,mysql-slowsql,pgsql-slowsql,redis-slowsql,k8s-service,nginx,default}
  279.     malFiles: ${SW_LOG_MAL_FILES:"nginx"}
  280. event-analyzer:
  281.   selector: ${SW_EVENT_ANALYZER:default}
  282.   default:
  283. receiver-sharing-server:
  284.   selector: ${SW_RECEIVER_SHARING_SERVER:default}
  285.   default:
  286.     # For HTTP server
  287.     restHost: ${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
  288.     restPort: ${SW_RECEIVER_SHARING_REST_PORT:0}
  289.     restContextPath: ${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
  290.     restMaxThreads: ${SW_RECEIVER_SHARING_REST_MAX_THREADS:200}
  291.     restIdleTimeOut: ${SW_RECEIVER_SHARING_REST_IDLE_TIMEOUT:30000}
  292.     restAcceptQueueSize: ${SW_RECEIVER_SHARING_REST_QUEUE_SIZE:0}
  293.     httpMaxRequestHeaderSize: ${SW_RECEIVER_SHARING_HTTP_MAX_REQUEST_HEADER_SIZE:8192}
  294.     # For gRPC server
  295.     gRPCHost: ${SW_RECEIVER_GRPC_HOST:0.0.0.0}
  296.     gRPCPort: ${SW_RECEIVER_GRPC_PORT:0}
  297.     maxConcurrentCallsPerConnection: ${SW_RECEIVER_GRPC_MAX_CONCURRENT_CALL:0}
  298.     maxMessageSize: ${SW_RECEIVER_GRPC_MAX_MESSAGE_SIZE:52428800} #50MB
  299.     gRPCThreadPoolSize: ${SW_RECEIVER_GRPC_THREAD_POOL_SIZE:0}
  300.     gRPCSslEnabled: ${SW_RECEIVER_GRPC_SSL_ENABLED:false}
  301.     gRPCSslKeyPath: ${SW_RECEIVER_GRPC_SSL_KEY_PATH:""}
  302.     gRPCSslCertChainPath: ${SW_RECEIVER_GRPC_SSL_CERT_CHAIN_PATH:""}
  303.     gRPCSslTrustedCAsPath: ${SW_RECEIVER_GRPC_SSL_TRUSTED_CAS_PATH:""}
  304.     authentication: ${SW_AUTHENTICATION:""}
  305. receiver-register:
  306.   selector: ${SW_RECEIVER_REGISTER:default}
  307.   default:
  308. receiver-trace:
  309.   selector: ${SW_RECEIVER_TRACE:default}
  310.   default:
  311. receiver-jvm:
  312.   selector: ${SW_RECEIVER_JVM:default}
  313.   default:
  314. receiver-clr:
  315.   selector: ${SW_RECEIVER_CLR:default}
  316.   default:
  317. receiver-profile:
  318.   selector: ${SW_RECEIVER_PROFILE:default}
  319.   default:
  320. receiver-zabbix:
  321.   selector: ${SW_RECEIVER_ZABBIX:-}
  322.   default:
  323.     port: ${SW_RECEIVER_ZABBIX_PORT:10051}
  324.     host: ${SW_RECEIVER_ZABBIX_HOST:0.0.0.0}
  325.     activeFiles: ${SW_RECEIVER_ZABBIX_ACTIVE_FILES:agent}
  326. service-mesh:
  327.   selector: ${SW_SERVICE_MESH:default}
  328.   default:
  329. envoy-metric:
  330.   selector: ${SW_ENVOY_METRIC:default}
  331.   default:
  332.     acceptMetricsService: ${SW_ENVOY_METRIC_SERVICE:true}
  333.     alsHTTPAnalysis: ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:""}
  334.     alsTCPAnalysis: ${SW_ENVOY_METRIC_ALS_TCP_ANALYSIS:""}
  335.     # `k8sServiceNameRule` allows you to customize the service name in ALS via Kubernetes metadata,
  336.     # the available variables are `pod`, `service`, f.e., you can use `${service.metadata.name}-${pod.metadata.labels.version}`
  337.     # to append the version number to the service name.
  338.     # Be careful, when using environment variables to pass this configuration, use single quotes(`''`) to avoid it being evaluated by the shell.
  339.     k8sServiceNameRule: ${K8S_SERVICE_NAME_RULE:"${pod.metadata.labels.(service.istio.io/canonical-name)}.${pod.metadata.namespace}"}
  340.     istioServiceNameRule: ${ISTIO_SERVICE_NAME_RULE:"${serviceEntry.metadata.name}.${serviceEntry.metadata.namespace}"}
  341.     # When looking up service informations from the Istio ServiceEntries, some
  342.     # of the ServiceEntries might be created in several namespaces automatically
  343.     # by some components, and OAP will randomly pick one of them to build the
  344.     # service name, users can use this config to exclude ServiceEntries that
  345.     # they don't want to be used. Comma separated.
  346.     istioServiceEntryIgnoredNamespaces: ${SW_ISTIO_SERVICE_ENTRY_IGNORED_NAMESPACES:""}
  347.     gRPCHost: ${SW_ALS_GRPC_HOST:0.0.0.0}
  348.     gRPCPort: ${SW_ALS_GRPC_PORT:0}
  349.     maxConcurrentCallsPerConnection: ${SW_ALS_GRPC_MAX_CONCURRENT_CALL:0}
  350.     maxMessageSize: ${SW_ALS_GRPC_MAX_MESSAGE_SIZE:0}
  351.     gRPCThreadPoolSize: ${SW_ALS_GRPC_THREAD_POOL_SIZE:0}
  352.     gRPCSslEnabled: ${SW_ALS_GRPC_SSL_ENABLED:false}
  353.     gRPCSslKeyPath: ${SW_ALS_GRPC_SSL_KEY_PATH:""}
  354.     gRPCSslCertChainPath: ${SW_ALS_GRPC_SSL_CERT_CHAIN_PATH:""}
  355.     gRPCSslTrustedCAsPath: ${SW_ALS_GRPC_SSL_TRUSTED_CAS_PATH:""}
  356. kafka-fetcher:
  357.   selector: ${SW_KAFKA_FETCHER:-}
  358.   default:
  359.     bootstrapServers: ${SW_KAFKA_FETCHER_SERVERS:localhost:9092}
  360.     namespace: ${SW_NAMESPACE:""}
  361.     partitions: ${SW_KAFKA_FETCHER_PARTITIONS:3}
  362.     replicationFactor: ${SW_KAFKA_FETCHER_PARTITIONS_FACTOR:2}
  363.     enableNativeProtoLog: ${SW_KAFKA_FETCHER_ENABLE_NATIVE_PROTO_LOG:true}
  364.     enableNativeJsonLog: ${SW_KAFKA_FETCHER_ENABLE_NATIVE_JSON_LOG:true}
  365.     consumers: ${SW_KAFKA_FETCHER_CONSUMERS:1}
  366.     kafkaHandlerThreadPoolSize: ${SW_KAFKA_HANDLER_THREAD_POOL_SIZE:-1}
  367.     kafkaHandlerThreadPoolQueueSize: ${SW_KAFKA_HANDLER_THREAD_POOL_QUEUE_SIZE:-1}
  368. cilium-fetcher:
  369.   selector: ${SW_CILIUM_FETCHER:-}
  370.   default:
  371.     peerHost: ${SW_CILIUM_FETCHER_PEER_HOST:hubble-peer.kube-system.svc.cluster.local}
  372.     peerPort: ${SW_CILIUM_FETCHER_PEER_PORT:80}
  373.     fetchFailureRetrySecond: ${SW_CILIUM_FETCHER_FETCH_FAILURE_RETRY_SECOND:10}
  374.     sslConnection: ${SW_CILIUM_FETCHER_SSL_CONNECTION:false}
  375.     sslPrivateKeyFile: ${SW_CILIUM_FETCHER_PRIVATE_KEY_FILE_PATH:}
  376.     sslCertChainFile: ${SW_CILIUM_FETCHER_CERT_CHAIN_FILE_PATH:}
  377.     sslCaFile: ${SW_CILIUM_FETCHER_CA_FILE_PATH:}
  378.     convertClientAsServerTraffic: ${SW_CILIUM_FETCHER_CONVERT_CLIENT_AS_SERVER_TRAFFIC:true}
  379. receiver-meter:
  380.   selector: ${SW_RECEIVER_METER:default}
  381.   default:
  382. receiver-otel:
  383.   selector: ${SW_OTEL_RECEIVER:default}
  384.   default:
  385.     enabledHandlers: ${SW_OTEL_RECEIVER_ENABLED_HANDLERS:"otlp-metrics,otlp-logs"}
  386.     enabledOtelMetricsRules: ${SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:"apisix,nginx/*,k8s/*,istio-controlplane,vm,mysql/*,postgresql/*,oap,aws-eks/*,windows,aws-s3/*,aws-dynamodb/*,aws-gateway/*,redis/*,elasticsearch/*,rabbitmq/*,mongodb/*,kafka/*,pulsar/*,bookkeeper/*,rocketmq/*,clickhouse/*,activemq/*"}
  387. receiver-zipkin:
  388.   selector: ${SW_RECEIVER_ZIPKIN:-}
  389.   default:
  390.     # Defines a set of span tag keys which are searchable.
  391.     # The max length of key=value should be less than 256 or will be dropped.
  392.     searchableTracesTags: ${SW_ZIPKIN_SEARCHABLE_TAG_KEYS:http.method}
  393.     # The sample rate precision is 1/10000, should be between 0 and 10000
  394.     sampleRate: ${SW_ZIPKIN_SAMPLE_RATE:10000}
  395.     ## The below configs are for OAP collect zipkin trace from HTTP
  396.     enableHttpCollector: ${SW_ZIPKIN_HTTP_COLLECTOR_ENABLED:true}
  397.     restHost: ${SW_RECEIVER_ZIPKIN_REST_HOST:0.0.0.0}
  398.     restPort: ${SW_RECEIVER_ZIPKIN_REST_PORT:9411}
  399.     restContextPath: ${SW_RECEIVER_ZIPKIN_REST_CONTEXT_PATH:/}
  400.     restMaxThreads: ${SW_RECEIVER_ZIPKIN_REST_MAX_THREADS:200}
  401.     restIdleTimeOut: ${SW_RECEIVER_ZIPKIN_REST_IDLE_TIMEOUT:30000}
  402.     restAcceptQueueSize: ${SW_RECEIVER_ZIPKIN_REST_QUEUE_SIZE:0}
  403.     ## The below configs are for OAP collect zipkin trace from kafka
  404.     enableKafkaCollector: ${SW_ZIPKIN_KAFKA_COLLECTOR_ENABLED:false}
  405.     kafkaBootstrapServers: ${SW_ZIPKIN_KAFKA_SERVERS:localhost:9092}
  406.     kafkaGroupId: ${SW_ZIPKIN_KAFKA_GROUP_ID:zipkin}
  407.     kafkaTopic: ${SW_ZIPKIN_KAFKA_TOPIC:zipkin}
  408.     # Kafka consumer config, JSON format as Properties. If it contains the same key with above, would override.
  409.     kafkaConsumerConfig: ${SW_ZIPKIN_KAFKA_CONSUMER_CONFIG:"{"auto.offset.reset":"earliest","enable.auto.commit":true}"}
  410.     # The Count of the topic consumers
  411.     kafkaConsumers: ${SW_ZIPKIN_KAFKA_CONSUMERS:1}
  412.     kafkaHandlerThreadPoolSize: ${SW_ZIPKIN_KAFKA_HANDLER_THREAD_POOL_SIZE:-1}
  413.     kafkaHandlerThreadPoolQueueSize: ${SW_ZIPKIN_KAFKA_HANDLER_THREAD_POOL_QUEUE_SIZE:-1}
  414. receiver-browser:
  415.   selector: ${SW_RECEIVER_BROWSER:default}
  416.   default:
  417.     # The sample rate precision is 1/10000. 10000 means 100% sample in default.
  418.     sampleRate: ${SW_RECEIVER_BROWSER_SAMPLE_RATE:10000}
  419. receiver-log:
  420.   selector: ${SW_RECEIVER_LOG:default}
  421.   default:
  422. query:
  423.   selector: ${SW_QUERY:graphql}
  424.   graphql:
  425.     # Enable the log testing API to test the LAL.
  426.     # NOTE: This API evaluates untrusted code on the OAP server.
  427.     # A malicious script can do significant damage (steal keys and secrets, remove files and directories, install malware, etc).
  428.     # As such, please enable this API only when you completely trust your users.
  429.     enableLogTestTool: ${SW_QUERY_GRAPHQL_ENABLE_LOG_TEST_TOOL:false}
  430.     # Maximum complexity allowed for the GraphQL query that can be used to
  431.     # abort a query if the total number of data fields queried exceeds the defined threshold.
  432.     maxQueryComplexity: ${SW_QUERY_MAX_QUERY_COMPLEXITY:3000}
  433.     # Allow user add, disable and update UI template
  434.     enableUpdateUITemplate: ${SW_ENABLE_UPDATE_UI_TEMPLATE:false}
  435.     # "On demand log" allows users to fetch Pod containers' log in real time,
  436.     # because this might expose secrets in the logs (if any), users need
  437.     # to enable this manually, and add permissions to OAP cluster role.
  438.     enableOnDemandPodLog: ${SW_ENABLE_ON_DEMAND_POD_LOG:false}
  439. # This module is for Zipkin query API and support zipkin-lens UI
  440. query-zipkin:
  441.   selector: ${SW_QUERY_ZIPKIN:-}
  442.   default:
  443.     # For HTTP server
  444.     restHost: ${SW_QUERY_ZIPKIN_REST_HOST:0.0.0.0}
  445.     restPort: ${SW_QUERY_ZIPKIN_REST_PORT:9412}
  446.     restContextPath: ${SW_QUERY_ZIPKIN_REST_CONTEXT_PATH:/zipkin}
  447.     restMaxThreads: ${SW_QUERY_ZIPKIN_REST_MAX_THREADS:200}
  448.     restIdleTimeOut: ${SW_QUERY_ZIPKIN_REST_IDLE_TIMEOUT:30000}
  449.     restAcceptQueueSize: ${SW_QUERY_ZIPKIN_REST_QUEUE_SIZE:0}
  450.     # Default look back for traces and autocompleteTags, 1 day in millis
  451.     lookback: ${SW_QUERY_ZIPKIN_LOOKBACK:86400000}
  452.     # The Cache-Control max-age (seconds) for serviceNames, remoteServiceNames and spanNames
  453.     namesMaxAge: ${SW_QUERY_ZIPKIN_NAMES_MAX_AGE:300}
  454.     ## The below config are OAP support for zipkin-lens UI
  455.     # Default traces query max size
  456.     uiQueryLimit: ${SW_QUERY_ZIPKIN_UI_QUERY_LIMIT:10}
  457.     # Default look back on the UI for search traces, 15 minutes in millis
  458.     uiDefaultLookback: ${SW_QUERY_ZIPKIN_UI_DEFAULT_LOOKBACK:900000}
  459. #This module is for PromQL API.
  460. promql:
  461.   selector: ${SW_PROMQL:default}
  462.   default:
  463.     # For HTTP server
  464.     restHost: ${SW_PROMQL_REST_HOST:0.0.0.0}
  465.     restPort: ${SW_PROMQL_REST_PORT:9090}
  466.     restContextPath: ${SW_PROMQL_REST_CONTEXT_PATH:/}
  467.     restMaxThreads: ${SW_PROMQL_REST_MAX_THREADS:200}
  468.     restIdleTimeOut: ${SW_PROMQL_REST_IDLE_TIMEOUT:30000}
  469.     restAcceptQueueSize: ${SW_PROMQL_REST_QUEUE_SIZE:0}
  470.     # The below config is for the API buildInfo, set the value to mock the build info.
  471.     buildInfoVersion: ${SW_PROMQL_BUILD_INFO_VERSION:"2.45.0"}
  472.     buildInfoRevision: ${SW_PROMQL_BUILD_INFO_REVISION:""}
  473.     buildInfoBranch: ${SW_PROMQL_BUILD_INFO_BRANCH:""}
  474.     buildInfoBuildUser: ${SW_PROMQL_BUILD_INFO_BUILD_USER:""}
  475.     buildInfoBuildDate: ${SW_PROMQL_BUILD_INFO_BUILD_DATE:""}
  476.     buildInfoGoVersion: ${SW_PROMQL_BUILD_INFO_GO_VERSION:""}
  477. #This module is for LogQL API.
  478. logql:
  479.   selector: ${SW_LOGQL:default}
  480.   default:
  481.     # For HTTP server
  482.     restHost: ${SW_LOGQL_REST_HOST:0.0.0.0}
  483.     restPort: ${SW_LOGQL_REST_PORT:3100}
  484.     restContextPath: ${SW_LOGQL_REST_CONTEXT_PATH:/}
  485.     restMaxThreads: ${SW_LOGQL_REST_MAX_THREADS:200}
  486.     restIdleTimeOut: ${SW_LOGQL_REST_IDLE_TIMEOUT:30000}
  487.     restAcceptQueueSize: ${SW_LOGQL_REST_QUEUE_SIZE:0}
  488. alarm:
  489.   selector: ${SW_ALARM:default}
  490.   default:
  491. telemetry:
  492.   selector: ${SW_TELEMETRY:none}
  493.   none:
  494.   prometheus:
  495.     host: ${SW_TELEMETRY_PROMETHEUS_HOST:0.0.0.0}
  496.     port: ${SW_TELEMETRY_PROMETHEUS_PORT:1234}
  497.     sslEnabled: ${SW_TELEMETRY_PROMETHEUS_SSL_ENABLED:false}
  498.     sslKeyPath: ${SW_TELEMETRY_PROMETHEUS_SSL_KEY_PATH:""}
  499.     sslCertChainPath: ${SW_TELEMETRY_PROMETHEUS_SSL_CERT_CHAIN_PATH:""}
  500. configuration:
  501.   selector: ${SW_CONFIGURATION:none}
  502.   none:
  503.   grpc:
  504.     host: ${SW_DCS_SERVER_HOST:""}
  505.     port: ${SW_DCS_SERVER_PORT:80}
  506.     clusterName: ${SW_DCS_CLUSTER_NAME:SkyWalking}
  507.     period: ${SW_DCS_PERIOD:20}
  508.     maxInboundMessageSize: ${SW_DCS_MAX_INBOUND_MESSAGE_SIZE:4194304}
  509.   apollo:
  510.     apolloMeta: ${SW_CONFIG_APOLLO:http://localhost:8080}
  511.     apolloCluster: ${SW_CONFIG_APOLLO_CLUSTER:default}
  512.     apolloEnv: ${SW_CONFIG_APOLLO_ENV:""}
  513.     appId: ${SW_CONFIG_APOLLO_APP_ID:skywalking}
  514.   zookeeper:
  515.     period: ${SW_CONFIG_ZK_PERIOD:60} # Unit seconds, sync period. Default fetch every 60 seconds.
  516.     namespace: ${SW_CONFIG_ZK_NAMESPACE:/default}
  517.     hostPort: ${SW_CONFIG_ZK_HOST_PORT:localhost:2181}
  518.     # Retry Policy
  519.     baseSleepTimeMs: ${SW_CONFIG_ZK_BASE_SLEEP_TIME_MS:1000} # initial amount of time to wait between retries
  520.     maxRetries: ${SW_CONFIG_ZK_MAX_RETRIES:3} # max number of times to retry
  521.   etcd:
  522.     period: ${SW_CONFIG_ETCD_PERIOD:60} # Unit seconds, sync period. Default fetch every 60 seconds.
  523.     endpoints: ${SW_CONFIG_ETCD_ENDPOINTS:http://localhost:2379}
  524.     namespace: ${SW_CONFIG_ETCD_NAMESPACE:/skywalking}
  525.     authentication: ${SW_CONFIG_ETCD_AUTHENTICATION:false}
  526.     user: ${SW_CONFIG_ETCD_USER:}
  527.     password: ${SW_CONFIG_ETCD_password:}
  528.   consul:
  529.     # Consul host and ports, separated by comma, e.g. 1.2.3.4:8500,2.3.4.5:8500
  530.     hostAndPorts: ${SW_CONFIG_CONSUL_HOST_AND_PORTS:1.2.3.4:8500}
  531.     # Sync period in seconds. Defaults to 60 seconds.
  532.     period: ${SW_CONFIG_CONSUL_PERIOD:60}
  533.     # Consul aclToken
  534.     aclToken: ${SW_CONFIG_CONSUL_ACL_TOKEN:""}
  535.   k8s-configmap:
  536.     period: ${SW_CONFIG_CONFIGMAP_PERIOD:60}
  537.     namespace: ${SW_CLUSTER_K8S_NAMESPACE:default}
  538.     labelSelector: ${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
  539.   nacos:
  540.     # Nacos Server Host
  541.     serverAddr: ${SW_CONFIG_NACOS_SERVER_ADDR:127.0.0.1}
  542.     # Nacos Server Port
  543.     port: ${SW_CONFIG_NACOS_SERVER_PORT:8848}
  544.     # Nacos Configuration Group
  545.     group: ${SW_CONFIG_NACOS_SERVER_GROUP:skywalking}
  546.     # Nacos Configuration namespace
  547.     namespace: ${SW_CONFIG_NACOS_SERVER_NAMESPACE:}
  548.     # Unit seconds, sync period. Default fetch every 60 seconds.
  549.     period: ${SW_CONFIG_NACOS_PERIOD:60}
  550.     # Nacos auth username
  551.     username: ${SW_CONFIG_NACOS_USERNAME:""}
  552.     password: ${SW_CONFIG_NACOS_PASSWORD:""}
  553.     # Nacos auth accessKey
  554.     accessKey: ${SW_CONFIG_NACOS_ACCESSKEY:""}
  555.     secretKey: ${SW_CONFIG_NACOS_SECRETKEY:""}
  556. exporter:
  557.   selector: ${SW_EXPORTER:-}
  558.   default:
  559.     # gRPC exporter
  560.     enableGRPCMetrics: ${SW_EXPORTER_ENABLE_GRPC_METRICS:false}
  561.     gRPCTargetHost: ${SW_EXPORTER_GRPC_HOST:127.0.0.1}
  562.     gRPCTargetPort: ${SW_EXPORTER_GRPC_PORT:9870}
  563.     # Kafka exporter
  564.     enableKafkaTrace: ${SW_EXPORTER_ENABLE_KAFKA_TRACE:false}
  565.     enableKafkaLog: ${SW_EXPORTER_ENABLE_KAFKA_LOG:false}
  566.     kafkaBootstrapServers: ${SW_EXPORTER_KAFKA_SERVERS:localhost:9092}
  567.     # Kafka producer config, JSON format as Properties.
  568.     kafkaProducerConfig: ${SW_EXPORTER_KAFKA_PRODUCER_CONFIG:""}
  569.     kafkaTopicTrace: ${SW_EXPORTER_KAFKA_TOPIC_TRACE:skywalking-export-trace}
  570.     kafkaTopicLog: ${SW_EXPORTER_KAFKA_TOPIC_LOG:skywalking-export-log}
  571.     exportErrorStatusTraceOnly: ${SW_EXPORTER_KAFKA_TRACE_FILTER_ERROR:false}
  572. health-checker:
  573.   selector: ${SW_HEALTH_CHECKER:-}
  574.   default:
  575.     checkIntervalSeconds: ${SW_HEALTH_CHECKER_INTERVAL_SECONDS:5}
  576. debugging-query:
  577.   selector: ${SW_DEBUGGING_QUERY:default}
  578.   default:
  579.     # Include the list of keywords to filter configurations including secrets. Separate keywords by a comma.
  580.     keywords4MaskingSecretsOfConfig: ${SW_DEBUGGING_QUERY_KEYWORDS_FOR_MASKING_SECRETS:user,password,token,accessKey,secretKey,authentication}
  581. configuration-discovery:
  582.   selector: ${SW_CONFIGURATION_DISCOVERY:default}
  583.   default:
  584.     disableMessageDigest: ${SW_DISABLE_MESSAGE_DIGEST:false}
  585. receiver-event:
  586.   selector: ${SW_RECEIVER_EVENT:default}
  587.   default:
  588. receiver-ebpf:
  589.   selector: ${SW_RECEIVER_EBPF:default}
  590.   default:
  591.     # The continuous profiling policy cache time, Unit is second.
  592.     continuousPolicyCacheTimeout: ${SW_CONTINUOUS_POLICY_CACHE_TIMEOUT:60}
  593.     gRPCHost: ${SW_EBPF_GRPC_HOST:0.0.0.0}
  594.     gRPCPort: ${SW_EBPF_GRPC_PORT:0}
  595.     maxConcurrentCallsPerConnection: ${SW_EBPF_GRPC_MAX_CONCURRENT_CALL:0}
  596.     maxMessageSize: ${SW_EBPF_ALS_GRPC_MAX_MESSAGE_SIZE:0}
  597.     gRPCThreadPoolSize: ${SW_EBPF_GRPC_THREAD_POOL_SIZE:0}
  598.     gRPCSslEnabled: ${SW_EBPF_GRPC_SSL_ENABLED:false}
  599.     gRPCSslKeyPath: ${SW_EBPF_GRPC_SSL_KEY_PATH:""}
  600.     gRPCSslCertChainPath: ${SW_EBPF_GRPC_SSL_CERT_CHAIN_PATH:""}
  601.     gRPCSslTrustedCAsPath: ${SW_EBPF_GRPC_SSL_TRUSTED_CAS_PATH:""}
  602. receiver-telegraf:
  603.   selector: ${SW_RECEIVER_TELEGRAF:default}
  604.   default:
  605.     activeFiles: ${SW_RECEIVER_TELEGRAF_ACTIVE_FILES:vm}
  606. aws-firehose:
  607.   selector: ${SW_RECEIVER_AWS_FIREHOSE:default}
  608.   default:
  609.     host: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_HOST:0.0.0.0}
  610.     port: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_PORT:12801}
  611.     contextPath: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_CONTEXT_PATH:/}
  612.     maxThreads: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_MAX_THREADS:200}
  613.     idleTimeOut: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_IDLE_TIME_OUT:30000}
  614.     acceptQueueSize: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_ACCEPT_QUEUE_SIZE:0}
  615.     maxRequestHeaderSize: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_MAX_REQUEST_HEADER_SIZE:8192}
  616.     firehoseAccessKey: ${SW_RECEIVER_AWS_FIREHOSE_ACCESS_KEY:}
  617.     enableTLS: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_ENABLE_TLS:false}
  618.     tlsKeyPath: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_TLS_KEY_PATH:}
  619.     tlsCertChainPath: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_TLS_CERT_CHAIN_PATH:}
  620. ai-pipeline:
  621.   selector: ${SW_AI_PIPELINE:default}
  622.   default:
  623.     uriRecognitionServerAddr: ${SW_AI_PIPELINE_URI_RECOGNITION_SERVER_ADDR:}
  624.     uriRecognitionServerPort: ${SW_AI_PIPELINE_URI_RECOGNITION_SERVER_PORT:17128}
复制代码
2、log4j2.xml修改
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.   ~ Licensed to the Apache Software Foundation (ASF) under one or more
  4.   ~ contributor license agreements.  See the NOTICE file distributed with
  5.   ~ this work for additional information regarding copyright ownership.
  6.   ~ The ASF licenses this file to You under the Apache License, Version 2.0
  7.   ~ (the "License"); you may not use this file except in compliance with
  8.   ~ the License.  You may obtain a copy of the License at
  9.   ~
  10.   ~     http://www.apache.org/licenses/LICENSE-2.0
  11.   ~
  12.   ~ Unless required by applicable law or agreed to in writing, software
  13.   ~ distributed under the License is distributed on an "AS IS" BASIS,
  14.   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15.   ~ See the License for the specific language governing permissions and
  16.   ~ limitations under the License.
  17.   ~
  18.   -->
  19. <Configuration status="info">
  20.     <Properties>
  21.         <Property name="log-path">${sys:oap.logDir}</Property>
  22.     </Properties>
  23.     <Appenders>
  24.         <RollingFile name="RollingFile" fileName="${log-path}/skywalking-oap-server.log"
  25.                      filePattern="${log-path}/skywalking-oap-server-%d{yyyy-MM-dd}-%i.log">
  26.             <PatternLayout>
  27.                 <pattern>%d - %c - %L [%t] %-5p %x - %m%n</pattern>
  28.             </PatternLayout>
  29.             <Policies>
  30.                 <SizeBasedTriggeringPolicy size="102400KB"/>
  31.             </Policies>
  32.             <DefaultRolloverStrategy max="30"/>
  33.         </RollingFile>
  34.         <Console name="Console" target="SYSTEM_OUT">
  35.             <PatternLayout>
  36.                 <pattern>%m%n</pattern>
  37.             </PatternLayout>
  38.             <MarkerFilter marker="Console" onMatch="ACCEPT" onMismatch="DENY"/>
  39.         </Console>
  40.     </Appenders>
  41.     <Loggers>
  42.         <logger name="org.apache.zookeeper" level="INFO"/>
  43.         <logger name="io.grpc.netty" level="INFO"/>
  44.         <Logger name="org.apache.skywalking.oap.server.library.server.grpc.GRPCServer" level="INFO" additivity="false">
  45.             <AppenderRef ref="Console"/>
  46.         </Logger>
  47.         <Root level="info">
  48.             <AppenderRef ref="RollingFile"/>
  49.             <AppenderRef ref="Console"/>
  50.         </Root>
  51.     </Loggers>
  52. </Configuration>
复制代码
修改UI配置,D:\Temp\1\apache-skywalking-apm-bin\webapp下面
1、修改application.yml
  1. # Licensed to the Apache Software Foundation (ASF) under one or more
  2. # contributor license agreements.  See the NOTICE file distributed with
  3. # this work for additional information regarding copyright ownership.
  4. # The ASF licenses this file to You under the Apache License, Version 2.0
  5. # (the "License"); you may not use this file except in compliance with
  6. # the License.  You may obtain a copy of the License at
  7. #
  8. #     http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. serverPort: ${SW_SERVER_PORT:-8080}
  16. # Comma seperated list of OAP addresses.
  17. oapServices: ${SW_OAP_ADDRESS:-http://localhost:12800}
  18. zipkinServices: ${SW_ZIPKIN_ADDRESS:-http://localhost:9412}
复制代码
2、log4j2.xml修改
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.   ~ Licensed to the Apache Software Foundation (ASF) under one or more
  4.   ~ contributor license agreements.  See the NOTICE file distributed with
  5.   ~ this work for additional information regarding copyright ownership.
  6.   ~ The ASF licenses this file to You under the Apache License, Version 2.0
  7.   ~ (the "License"); you may not use this file except in compliance with
  8.   ~ the License.  You may obtain a copy of the License at
  9.   ~
  10.   ~     http://www.apache.org/licenses/LICENSE-2.0
  11.   ~
  12.   ~ Unless required by applicable law or agreed to in writing, software
  13.   ~ distributed under the License is distributed on an "AS IS" BASIS,
  14.   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15.   ~ See the License for the specific language governing permissions and
  16.   ~ limitations under the License.
  17.   ~
  18.   -->
  19. <Configuration status="info">
  20.     <Properties>
  21.         <Property name="log-path">${sys:webapp.logDir}</Property>
  22.     </Properties>
  23.     <Appenders>
  24.         <RollingFile name="RollingFile" fileName="${log-path}/skywalking-webapp.log"
  25.                      filePattern="${log-path}/skywalking-webapp-%d{yyyy-MM-dd}-%i.log">
  26.             <PatternLayout>
  27.                 <pattern>%d - %c - %L [%t] %-5p %x - %m%n</pattern>
  28.             </PatternLayout>
  29.             <Policies>
  30.                 <SizeBasedTriggeringPolicy size="102400KB"/>
  31.             </Policies>
  32.             <DefaultRolloverStrategy max="30"/>
  33.         </RollingFile>
  34.         <Console name="Console" target="SYSTEM_OUT">
  35.             <PatternLayout>
  36.                 <pattern>%m%n</pattern>
  37.             </PatternLayout>
  38.             <MarkerFilter marker="Console" onMatch="ACCEPT" onMismatch="DENY"/>
  39.         </Console>
  40.     </Appenders>
  41.     <Loggers>
  42.         <logger name="org.apache.zookeeper" level="INFO"/>
  43.         <logger name="io.grpc.netty" level="INFO"/>
  44.         <Logger name="org.apache.skywalking.oap.server.webapp.ApplicationStartUp" level="INFO" additivity="false">
  45.             <AppenderRef ref="Console"/>
  46.         </Logger>
  47.         <Root level="info">
  48.             <AppenderRef ref="RollingFile"/>
  49.             <AppenderRef ref="Console"/>
  50.         </Root>
  51.     </Loggers>
  52. </Configuration>
复制代码
注意
skywalking服务必须放在无空格的文件夹,比如:Program Files这个文件是绝对不能放的,否则服务运行的时间只会一闪而过,连log日记都不会生成)。
默认监听 11800(gRPC)与 12800(HTTP) 端口。
上面解压后的文件内容包罗 collector 与UI 2部分,
collector:负责收集日记等信息,此部分配置文件在config文件夹下 application.yml 及日记配置 log4j2.xml
UI:用于数据展示 ,此部分配置文件在 webapp 文件夹下 application.yml 及日记配置 log4j2.xml
五、启动

1、先启动D:\Temp\1\elasticsearch-8.17.0-windows-x86_64\bin下的elasticsearch,双击或者右键管理员权限运行elasticsearch.bat即可
2、先启动D:\Temp\1\apache-skywalking-apm-bin\bin下的skywalking,双击或者右键管理员权限运行startup.bat即可
  1. 切到 D:\Temp\1\apache-skywalking-apm-bin\bin,双击或者右键管理员权限运行startup.bat
复制代码


假如出错,
elasticsearch出错,查看D:\Temp\1\elasticsearch-8.17.0-windows-x86_64\logs,
skywalking出错,查看D:\Temp\1\apache-skywalking-apm-bin\logs日记。

参考链接:
skywalking-v10.0.1安装:https://blog.csdn.net/smdai/article/details/142479469
java 情况变量配置 参考原文链接:https://blog.csdn.net/smdai/article/details/140670008



免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

梦见你的名字

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表