kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml URL: https://github.com/apache/skywalking/pull/4514#discussion_r392650757
########## File path: dist-material/application.yml ########## @@ -83,180 +85,230 @@ core: # and it will cause more load for memory, network of OAP and storage. # 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. activeExtraModelColumns: ${SW_CORE_ACTIVE_EXTRA_MODEL_COLUMNS:false} + storage: -# elasticsearch: -# nameSpace: ${SW_NAMESPACE:""} -# clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200} -# protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"} -# trustStorePath: ${SW_SW_STORAGE_ES_SSL_JKS_PATH:"../es_keystore.jks"} -# trustStorePass: ${SW_SW_STORAGE_ES_SSL_JKS_PASS:""} -# enablePackedDownsampling: ${SW_STORAGE_ENABLE_PACKED_DOWNSAMPLING:true} # Hour and Day metrics will be merged into minute index. -# dayStep: ${SW_STORAGE_DAY_STEP:1} # Represent the number of days in the one minute/hour/day index. -# user: ${SW_ES_USER:""} -# password: ${SW_ES_PASSWORD:""} -# secretsManagementFile: ${SW_ES_SECRETS_MANAGEMENT_FILE:""} # Secrets management file in the properties format includes the username, password, which are managed by 3rd party tool. -# indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:2} -# indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:0} -# # Those data TTL settings will override the same settings in core module. -# recordDataTTL: ${SW_STORAGE_ES_RECORD_DATA_TTL:7} # Unit is day -# otherMetricsDataTTL: ${SW_STORAGE_ES_OTHER_METRIC_DATA_TTL:45} # Unit is day -# monthMetricsDataTTL: ${SW_STORAGE_ES_MONTH_METRIC_DATA_TTL:18} # Unit is month -# # Batch process setting, refer to https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.5/java-docs-bulk-processor.html -# bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:1000} # Execute the bulk every 1000 requests -# flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:10} # flush the bulk every 10 seconds whatever the number of requests -# concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requests -# resultWindowMaxSize: ${SW_STORAGE_ES_QUERY_MAX_WINDOW_SIZE:10000} -# metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:5000} -# segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200} -# profileTaskQueryMaxSize: ${SW_STORAGE_ES_QUERY_PROFILE_TASK_SIZE:200} -# elasticsearch7: -# nameSpace: ${SW_NAMESPACE:""} -# clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200} -# protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"} -# trustStorePath: ${SW_SW_STORAGE_ES_SSL_JKS_PATH:"../es_keystore.jks"} -# trustStorePass: ${SW_SW_STORAGE_ES_SSL_JKS_PASS:""} -# enablePackedDownsampling: ${SW_STORAGE_ENABLE_PACKED_DOWNSAMPLING:true} # Hour and Day metrics will be merged into minute index. -# dayStep: ${SW_STORAGE_DAY_STEP:1} # Represent the number of days in the one minute/hour/day index. -# user: ${SW_ES_USER:""} -# password: ${SW_ES_PASSWORD:""} -# secretsManagementFile: ${SW_ES_SECRETS_MANAGEMENT_FILE:""} # Secrets management file in the properties format includes the username, password, which are managed by 3rd party tool. -# indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:2} -# indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:0} -# # Those data TTL settings will override the same settings in core module. -# recordDataTTL: ${SW_STORAGE_ES_RECORD_DATA_TTL:7} # Unit is day -# otherMetricsDataTTL: ${SW_STORAGE_ES_OTHER_METRIC_DATA_TTL:45} # Unit is day -# monthMetricsDataTTL: ${SW_STORAGE_ES_MONTH_METRIC_DATA_TTL:18} # Unit is month -# # Batch process setting, refer to https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.5/java-docs-bulk-processor.html -# bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:1000} # Execute the bulk every 1000 requests -# flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:10} # flush the bulk every 10 seconds whatever the number of requests -# concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requests -# resultWindowMaxSize: ${SW_STORAGE_ES_QUERY_MAX_WINDOW_SIZE:10000} -# metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:5000} -# segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200} -# profileTaskQueryMaxSize: ${SW_STORAGE_ES_QUERY_PROFILE_TASK_SIZE:200} + selector: ${SW_STORAGE:h2} + elasticsearch: + nameSpace: ${SW_NAMESPACE:""} + clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200} + protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"} + trustStorePath: ${SW_SW_STORAGE_ES_SSL_JKS_PATH:"../es_keystore.jks"} + trustStorePass: ${SW_SW_STORAGE_ES_SSL_JKS_PASS:""} + user: ${SW_ES_USER:""} + password: ${SW_ES_PASSWORD:""} + secretsManagementFile: ${SW_ES_SECRETS_MANAGEMENT_FILE:""} # Secrets management file in the properties format includes the username, password, which are managed by 3rd party tool. + enablePackedDownsampling: ${SW_STORAGE_ENABLE_PACKED_DOWNSAMPLING:true} # Hour and Day metrics will be merged into minute index. + dayStep: ${SW_STORAGE_DAY_STEP:1} # Represent the number of days in the one minute/hour/day index. + indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:2} + indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:0} + # Those data TTL settings will override the same settings in core module. + recordDataTTL: ${SW_STORAGE_ES_RECORD_DATA_TTL:7} # Unit is day + otherMetricsDataTTL: ${SW_STORAGE_ES_OTHER_METRIC_DATA_TTL:45} # Unit is day + monthMetricsDataTTL: ${SW_STORAGE_ES_MONTH_METRIC_DATA_TTL:18} # Unit is month + # Batch process setting, refer to https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.5/java-docs-bulk-processor.html + bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:1000} # Execute the bulk every 1000 requests + flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:10} # flush the bulk every 10 seconds whatever the number of requests + concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requests + resultWindowMaxSize: ${SW_STORAGE_ES_QUERY_MAX_WINDOW_SIZE:10000} + metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:5000} + segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200} + profileTaskQueryMaxSize: ${SW_STORAGE_ES_QUERY_PROFILE_TASK_SIZE:200} + advanced: ${SW_STORAGE_ES_ADVANCED:""} + elasticsearch7: + nameSpace: ${SW_NAMESPACE:""} + clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200} + protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"} + trustStorePath: ${SW_SW_STORAGE_ES_SSL_JKS_PATH:"../es_keystore.jks"} + trustStorePass: ${SW_SW_STORAGE_ES_SSL_JKS_PASS:""} + enablePackedDownsampling: ${SW_STORAGE_ENABLE_PACKED_DOWNSAMPLING:true} # Hour and Day metrics will be merged into minute index. + dayStep: ${SW_STORAGE_DAY_STEP:1} # Represent the number of days in the one minute/hour/day index. + user: ${SW_ES_USER:""} + password: ${SW_ES_PASSWORD:""} + secretsManagementFile: ${SW_ES_SECRETS_MANAGEMENT_FILE:""} # Secrets management file in the properties format includes the username, password, which are managed by 3rd party tool. + indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:2} + indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:0} + # Those data TTL settings will override the same settings in core module. + recordDataTTL: ${SW_STORAGE_ES_RECORD_DATA_TTL:7} # Unit is day + otherMetricsDataTTL: ${SW_STORAGE_ES_OTHER_METRIC_DATA_TTL:45} # Unit is day + monthMetricsDataTTL: ${SW_STORAGE_ES_MONTH_METRIC_DATA_TTL:18} # Unit is month + # Batch process setting, refer to https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.5/java-docs-bulk-processor.html + bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:1000} # Execute the bulk every 1000 requests + flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:10} # flush the bulk every 10 seconds whatever the number of requests + concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requests + resultWindowMaxSize: ${SW_STORAGE_ES_QUERY_MAX_WINDOW_SIZE:10000} + metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:5000} + segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200} + profileTaskQueryMaxSize: ${SW_STORAGE_ES_QUERY_PROFILE_TASK_SIZE:200} + advanced: ${SW_STORAGE_ES_ADVANCED:""} h2: driver: ${SW_STORAGE_H2_DRIVER:org.h2.jdbcx.JdbcDataSource} url: ${SW_STORAGE_H2_URL:jdbc:h2:mem:skywalking-oap-db} user: ${SW_STORAGE_H2_USER:sa} metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000} -# mysql: -# properties: -# jdbcUrl: ${SW_JDBC_URL:"jdbc:mysql://localhost:3306/swtest"} -# dataSource.user: ${SW_DATA_SOURCE_USER:root} -# dataSource.password: ${SW_DATA_SOURCE_PASSWORD:root@1234} -# dataSource.cachePrepStmts: ${SW_DATA_SOURCE_CACHE_PREP_STMTS:true} -# dataSource.prepStmtCacheSize: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE:250} -# dataSource.prepStmtCacheSqlLimit: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT:2048} -# dataSource.useServerPrepStmts: ${SW_DATA_SOURCE_USE_SERVER_PREP_STMTS:true} -# metadataQueryMaxSize: ${SW_STORAGE_MYSQL_QUERY_MAX_SIZE:5000} -# influx: -# # Metadata storage provider configuration -# metabaseType: ${SW_STORAGE_METABASE_TYPE:H2} # There are 2 options as Metabase provider, H2 or MySQL. -# h2Props: -# dataSourceClassName: ${SW_STORAGE_METABASE_DRIVER:org.h2.jdbcx.JdbcDataSource} -# dataSource.url: ${SW_STORAGE_METABASE_URL:jdbc:h2:mem:skywalking-oap-db} -# dataSource.user: ${SW_STORAGE_METABASE_USER:sa} -# dataSource.password: ${SW_STORAGE_METABASE_PASSWORD:} -# mysqlProps: -# jdbcUrl: ${SW_STORAGE_METABASE_URL:"jdbc:mysql://localhost:3306/swtest"} -# dataSource.user: ${SW_STORAGE_METABASE_USER:root} -# dataSource.password: ${SW_STORAGE_METABASE_PASSWORD:root@1234} -# dataSource.cachePrepStmts: ${SW_STORAGE_METABASE_CACHE_PREP_STMTS:true} -# dataSource.prepStmtCacheSize: ${SW_STORAGE_METABASE_PREP_STMT_CACHE_SQL_SIZE:250} -# dataSource.prepStmtCacheSqlLimit: ${SW_STORAGE_METABASE_PREP_STMT_CACHE_SQL_LIMIT:2048} -# dataSource.useServerPrepStmts: ${SW_STORAGE_METABASE_USE_SERVER_PREP_STMTS:true} -# metadataQueryMaxSize: ${SW_STORAGE_METABASE_QUERY_MAX_SIZE:5000} -# # InfluxDB configuration -# url: ${SW_STORAGE_INFLUXDB_URL:http://localhost:8086} -# user: ${SW_STORAGE_INFLUXDB_USER:root} -# password: ${SW_STORAGE_INFLUXDB_PASSWORD:} -# database: ${SW_STORAGE_INFLUXDB_DATABASE:skywalking} -# actions: ${SW_STORAGE_INFLUXDB_ACTIONS:1000} # the number of actions to collect -# duration: ${SW_STORAGE_INFLUXDB_DURATION:1000} # the time to wait at most (milliseconds) -# fetchTaskLogMaxSize: ${SW_STORAGE_INFLUXDB_FETCH_TASK_LOG_MAX_SIZE:5000} # the max number of fetch task log in a request + mysql: + properties: + jdbcUrl: ${SW_JDBC_URL:"jdbc:mysql://localhost:3306/swtest"} + dataSource.user: ${SW_DATA_SOURCE_USER:root} + dataSource.password: ${SW_DATA_SOURCE_PASSWORD:root@1234} + dataSource.cachePrepStmts: ${SW_DATA_SOURCE_CACHE_PREP_STMTS:true} + dataSource.prepStmtCacheSize: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE:250} + dataSource.prepStmtCacheSqlLimit: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT:2048} + dataSource.useServerPrepStmts: ${SW_DATA_SOURCE_USE_SERVER_PREP_STMTS:true} + metadataQueryMaxSize: ${SW_STORAGE_MYSQL_QUERY_MAX_SIZE:5000} + influxdb: + # Metadata storage provider configuration + metabaseType: ${SW_STORAGE_METABASE_TYPE:H2} # There are 2 options as Metabase provider, H2 or MySQL. + h2Props: + dataSourceClassName: ${SW_STORAGE_METABASE_DRIVER:org.h2.jdbcx.JdbcDataSource} + dataSource.url: ${SW_STORAGE_METABASE_URL:jdbc:h2:mem:skywalking-oap-db} + dataSource.user: ${SW_STORAGE_METABASE_USER:sa} + dataSource.password: ${SW_STORAGE_METABASE_PASSWORD:} + mysqlProps: + jdbcUrl: ${SW_STORAGE_METABASE_URL:"jdbc:mysql://localhost:3306/swtest"} + dataSource.user: ${SW_STORAGE_METABASE_USER:root} + dataSource.password: ${SW_STORAGE_METABASE_PASSWORD:root@1234} + dataSource.cachePrepStmts: ${SW_STORAGE_METABASE_CACHE_PREP_STMTS:true} + dataSource.prepStmtCacheSize: ${SW_STORAGE_METABASE_PREP_STMT_CACHE_SQL_SIZE:250} + dataSource.prepStmtCacheSqlLimit: ${SW_STORAGE_METABASE_PREP_STMT_CACHE_SQL_LIMIT:2048} + dataSource.useServerPrepStmts: ${SW_STORAGE_METABASE_USE_SERVER_PREP_STMTS:true} + metadataQueryMaxSize: ${SW_STORAGE_METABASE_QUERY_MAX_SIZE:5000} + # InfluxDB configuration + url: ${SW_STORAGE_INFLUXDB_URL:http://localhost:8086} + user: ${SW_STORAGE_INFLUXDB_USER:root} + password: ${SW_STORAGE_INFLUXDB_PASSWORD:} + database: ${SW_STORAGE_INFLUXDB_DATABASE:skywalking} + actions: ${SW_STORAGE_INFLUXDB_ACTIONS:1000} # the number of actions to collect + duration: ${SW_STORAGE_INFLUXDB_DURATION:1000} # the time to wait at most (milliseconds) + fetchTaskLogMaxSize: ${SW_STORAGE_INFLUXDB_FETCH_TASK_LOG_MAX_SIZE:5000} # the max number of fetch task log in a request + receiver-sharing-server: + selector: ${SW_RECEIVER_SHARING_SERVER:default} default: + authentication: ${SW_AUTHENTICATION:""} receiver-register: + selector: ${SW_RECEIVER_REGISTER:default} default: + receiver-trace: + selector: ${SW_RECEIVER_TRACE:default} default: bufferPath: ${SW_RECEIVER_BUFFER_PATH:../trace-buffer/} # Path to trace buffer files, suggest to use absolute path bufferOffsetMaxFileSize: ${SW_RECEIVER_BUFFER_OFFSET_MAX_FILE_SIZE:100} # Unit is MB bufferDataMaxFileSize: ${SW_RECEIVER_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB bufferFileCleanWhenRestart: ${SW_RECEIVER_BUFFER_FILE_CLEAN_WHEN_RESTART:false} sampleRate: ${SW_TRACE_SAMPLE_RATE:10000} # The sample rate precision is 1/10000. 10000 means 100% sample in default. slowDBAccessThreshold: ${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100} # The slow database access thresholds. Unit ms. + receiver-jvm: + selector: ${SW_RECEIVER_JVM:default} default: + receiver-clr: + selector: ${SW_RECEIVER_CLR:default} default: + receiver-profile: + selector: ${SW_RECEIVER_PROFILE:default} default: + service-mesh: + selector: ${SW_SERVICE_MESH:default} default: bufferPath: ${SW_SERVICE_MESH_BUFFER_PATH:../mesh-buffer/} # Path to trace buffer files, suggest to use absolute path bufferOffsetMaxFileSize: ${SW_SERVICE_MESH_OFFSET_MAX_FILE_SIZE:100} # Unit is MB bufferDataMaxFileSize: ${SW_SERVICE_MESH_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB bufferFileCleanWhenRestart: ${SW_SERVICE_MESH_BUFFER_FILE_CLEAN_WHEN_RESTART:false} + istio-telemetry: + selector: ${SW_ISTIO_TELEMETRY:default} default: + envoy-metric: + selector: ${SW_ENVOY_METRIC:default} default: -# alsHTTPAnalysis: ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:k8s-mesh} -#receiver_zipkin: -# default: -# host: ${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0} -# port: ${SW_RECEIVER_ZIPKIN_PORT:9411} -# contextPath: ${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/} + alsHTTPAnalysis: ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:none} + +receiver_zipkin: + selector: ${SW_RECEIVER_ZIPKIN:none} Review comment: > If this module is required by other module, what happens? I don't think providing a potential NPE in the runtime is a good idea. > Also, based on this, I could put some tricky parameter value such as any not existing provider name. And we magically accept it and start up successfully. Can I just think of that this problem is not related to this pull request directly and it should be fixed in another pull request? In the old way, if the user just comment out the required module, what would happen? Are they the same problem here? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services