You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/03/15 03:23:46 UTC

[GitHub] [skywalking] kezhenxu94 opened a new pull request #4514: Add selector property in application.yml

kezhenxu94 opened a new pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514
 
 
   
    ### Motivation
       
   Ease the efforts of modifying configurations in automatic workflow and scripts, like Docker and helm chart.
       
   ### Modification
       
   Add a `selector` property into `application.yml` to enable switching configuration simply by environment variables or system properties, and filter the unselected options, leaving only selected one.
       
   ### Result
       
   - We can switch a configuration by environment variables or system property
       
   - Closes #4511
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392648886
 
 

 ##########
 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:
   What does this `none` mean? I don't think we have `none` provider for this receiver.
   
   According to your implementation, https://github.com/apache/skywalking/blob/dae57dc8fddba8916d43351cdde824a116e2d58c/oap-server/server-bootstrap/src/main/java/org/apache/skywalking/oap/server/starter/config/ApplicationConfigLoader.java#L62-L64,
   this seems meaning no provider for module `receiver_zipkin`? 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.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 removed a comment on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
kezhenxu94 removed a comment on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599162828
 
 
   Better to enable this option in this PR when reviewing because there're some spaces changes
   
   <img width="246" alt="image" src="https://user-images.githubusercontent.com/15965696/76694608-da89df00-66af-11ea-8b12-64e042665da8.png">
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392642655
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
 Review comment:
   the same, remove it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392639648
 
 

 ##########
 File path: oap-server/server-bootstrap/src/main/java/org/apache/skywalking/oap/server/starter/config/ApplicationConfigLoader.java
 ##########
 @@ -105,6 +107,19 @@ private void overrideConfigBySystemEnv(ApplicationConfiguration configuration) {
         }
     }
 
+    private void selectConfig(final Map<String, Object> configuration) {
+        if (configuration.size() <= 1) {
+            return;
+        }
+        if (configuration.containsKey("selector")) {
+            final String selector = (String) configuration.get("selector");
+            final String resolvedSelector = PropertyPlaceholderHelper.INSTANCE.replacePlaceholders(
+                selector, System.getProperties()
+            );
+            configuration.entrySet().removeIf(e -> !resolvedSelector.equals(e.getKey()));
 
 Review comment:
   > I think you need to add a check and error for selected provider not found, when you give a value to selector, but no suitable provider definition here.
   
   Yes, thanks for pointing out, just found that and fixed

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392653991
 
 

 ##########
 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:
   @wu-sheng hope I got your point correctly and I try to fix it at the phase when processing the configuration, to ensure that the processed configurations are the same as before, and verify like this, correct me if I made anything wrong still
   
   <img width="1197" alt="image" src="https://user-images.githubusercontent.com/15965696/76698419-a6c5ae00-66dd-11ea-843f-ab26f112f444.png">
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io edited a comment on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599165132
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=h1) Report
   > Merging [#4514](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/2118a76250919b40e68a7a245313f8eb79ec28f7&el=desc) will **increase** coverage by `0.02%`.
   > The diff coverage is `76.47%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4514/graphs/tree.svg?width=650&height=150&src=pr&token=qrILxY5yA8)](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4514      +/-   ##
   ==========================================
   + Coverage   25.50%   25.52%   +0.02%     
   ==========================================
     Files        1244     1244              
     Lines       28919    28931      +12     
     Branches     3958     3962       +4     
   ==========================================
   + Hits         7375     7384       +9     
   - Misses      20865    20866       +1     
   - Partials      679      681       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...storage/plugin/influxdb/InfluxStorageProvider.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlUHJvdmlkZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...server/starter/config/ApplicationConfigLoader.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvc3RhcnRlci9jb25maWcvQXBwbGljYXRpb25Db25maWdMb2FkZXIuamF2YQ==) | `63.73% <78.57%> (+1.71%)` | :arrow_up: |
   | [...erver/library/module/ApplicationConfiguration.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItbGlicmFyeS9saWJyYXJ5LW1vZHVsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2xpYnJhcnkvbW9kdWxlL0FwcGxpY2F0aW9uQ29uZmlndXJhdGlvbi5qYXZh) | `94.44% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=footer). Last update [2118a76...dae57dc](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392638226
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
 Review comment:
   @hanahmily please review these, the original logic operators are `&&`, but according to the error message, I think they should be `||`, if I'm wrong, please correct me

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io edited a comment on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599165132
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=h1) Report
   > Merging [#4514](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/2118a76250919b40e68a7a245313f8eb79ec28f7&el=desc) will **decrease** coverage by `0.00%`.
   > The diff coverage is `76.47%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4514/graphs/tree.svg?width=650&height=150&src=pr&token=qrILxY5yA8)](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4514      +/-   ##
   ==========================================
   - Coverage   25.50%   25.49%   -0.01%     
   ==========================================
     Files        1244     1244              
     Lines       28919    28931      +12     
     Branches     3958     3962       +4     
   ==========================================
   + Hits         7375     7377       +2     
   - Misses      20865    20873       +8     
   - Partials      679      681       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...storage/plugin/influxdb/InfluxStorageProvider.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlUHJvdmlkZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...server/starter/config/ApplicationConfigLoader.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvc3RhcnRlci9jb25maWcvQXBwbGljYXRpb25Db25maWdMb2FkZXIuamF2YQ==) | `63.73% <78.57%> (+1.71%)` | :arrow_up: |
   | [...erver/library/module/ApplicationConfiguration.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItbGlicmFyeS9saWJyYXJ5LW1vZHVsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2xpYnJhcnkvbW9kdWxlL0FwcGxpY2F0aW9uQ29uZmlndXJhdGlvbi5qYXZh) | `94.44% <100.00%> (ø)` | |
   | [...walking/oap/server/core/analysis/Downsampling.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2NvcmUvYW5hbHlzaXMvRG93bnNhbXBsaW5nLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=footer). Last update [2118a76...cb35514](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599187087
 
 
   `backend-setup.md` should be updated too, about new `selector` and the 6.x way still supported.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392670011
 
 

 ##########
 File path: docs/en/setup/backend/backend-setup.md
 ##########
 @@ -14,26 +14,41 @@ End user can switch or assemble the collector features by their own requirements
 
 So, in `application.yml`, there are three levels.
 1. **Level 1**, module name. Meaning this module is active in running mode.
-1. **Level 2**, provider name. Set the provider of the module.
+1. **Level 2**, provider name and provider selector. Available providers are listed here with a selector to indicate which one will actually take effect.
 1. **Level 3**. settings of the provider.
 
 Example:
+
 ```yaml
-core:
-  default:
-    restHost: 0.0.0.0
-    restPort: 12800
-    restContextPath: /
-    gRPCHost: 0.0.0.0
-    gRPCPort: 11800
+storage:
+  selector: mysql # the mysql storage will actually be activated, while the h2 storage takes no effect
+  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}
+  # other configurations
 ```
-1. **core** is the module.
-1. **default** is the default implementor of core module.
-1. `restHost`, `restPort`, ... `gRPCHost` are all setting items of the implementor.
+
+1. **`core`** is the module.
+1. **`selector`** selects one out of the all providers listed below, the unselected ones take no effect as if they were deleted.
+1. **`default`** is the default implementor of core module.
+1. `driver`, `url`, ... `metadataQueryMaxSize` are all setting items of the implementor.
 
 At the same time, modules includes required and optional, the required modules provide the skeleton of backend,
-even modularization supported pluggable, remove those modules are meaningless. We highly recommend you don't try to
-change APIs of those modules, unless you understand SkyWalking project and its codes very well.
+even modularization supported pluggable, removing those modules are meaningless, for optional modules, if there is provider
+called `none`, you can simply set it to the `selector` to disable it, otherwise, please set `-` to the selector.
 
 Review comment:
   `if there is provider called `none`, you can simply set it to the `selector` to disable it, otherwise, please set `-` to the selector`
   ->
   
   Some modules have a provider implementation called none, meaning it only provides a shell with no actual logic, typically such as telemetry.
   
   Set `-` to the selector means this whole module will be excluded in the runtime.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io edited a comment on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599165132
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=h1) Report
   > Merging [#4514](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/2118a76250919b40e68a7a245313f8eb79ec28f7&el=desc) will **decrease** coverage by `0.00%`.
   > The diff coverage is `76.47%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4514/graphs/tree.svg?width=650&height=150&src=pr&token=qrILxY5yA8)](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4514      +/-   ##
   ==========================================
   - Coverage   25.50%   25.49%   -0.01%     
   ==========================================
     Files        1244     1244              
     Lines       28919    28931      +12     
     Branches     3958     3962       +4     
   ==========================================
   + Hits         7375     7377       +2     
   - Misses      20865    20873       +8     
   - Partials      679      681       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...storage/plugin/influxdb/InfluxStorageProvider.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlUHJvdmlkZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...server/starter/config/ApplicationConfigLoader.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvc3RhcnRlci9jb25maWcvQXBwbGljYXRpb25Db25maWdMb2FkZXIuamF2YQ==) | `63.73% <78.57%> (+1.71%)` | :arrow_up: |
   | [...erver/library/module/ApplicationConfiguration.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItbGlicmFyeS9saWJyYXJ5LW1vZHVsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2xpYnJhcnkvbW9kdWxlL0FwcGxpY2F0aW9uQ29uZmlndXJhdGlvbi5qYXZh) | `94.44% <100.00%> (ø)` | |
   | [...walking/oap/server/core/analysis/Downsampling.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2NvcmUvYW5hbHlzaXMvRG93bnNhbXBsaW5nLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=footer). Last update [2118a76...59288c1](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392649027
 
 

 ##########
 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:
   At the module core level, should be strict validation to avoid illegal selector name.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 commented on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599162828
 
 
   Better to enable this option in this PR when reviewing because there're some spaces changes
   
   <img width="246" alt="image" src="https://user-images.githubusercontent.com/15965696/76694608-da89df00-66af-11ea-8b12-64e042665da8.png">
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io edited a comment on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599165132
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=h1) Report
   > Merging [#4514](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/2118a76250919b40e68a7a245313f8eb79ec28f7&el=desc) will **increase** coverage by `0.02%`.
   > The diff coverage is `76.47%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4514/graphs/tree.svg?width=650&height=150&src=pr&token=qrILxY5yA8)](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4514      +/-   ##
   ==========================================
   + Coverage   25.50%   25.52%   +0.02%     
   ==========================================
     Files        1244     1244              
     Lines       28919    28931      +12     
     Branches     3958     3962       +4     
   ==========================================
   + Hits         7375     7384       +9     
   - Misses      20865    20866       +1     
   - Partials      679      681       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...storage/plugin/influxdb/InfluxStorageProvider.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlUHJvdmlkZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...server/starter/config/ApplicationConfigLoader.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvc3RhcnRlci9jb25maWcvQXBwbGljYXRpb25Db25maWdMb2FkZXIuamF2YQ==) | `63.73% <78.57%> (+1.71%)` | :arrow_up: |
   | [...erver/library/module/ApplicationConfiguration.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItbGlicmFyeS9saWJyYXJ5LW1vZHVsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2xpYnJhcnkvbW9kdWxlL0FwcGxpY2F0aW9uQ29uZmlndXJhdGlvbi5qYXZh) | `94.44% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=footer). Last update [2118a76...777c107](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392639250
 
 

 ##########
 File path: oap-server/server-bootstrap/src/main/java/org/apache/skywalking/oap/server/starter/config/ApplicationConfigLoader.java
 ##########
 @@ -105,6 +107,19 @@ private void overrideConfigBySystemEnv(ApplicationConfiguration configuration) {
         }
     }
 
+    private void selectConfig(final Map<String, Object> configuration) {
+        if (configuration.size() <= 1) {
+            return;
+        }
+        if (configuration.containsKey("selector")) {
+            final String selector = (String) configuration.get("selector");
+            final String resolvedSelector = PropertyPlaceholderHelper.INSTANCE.replacePlaceholders(
+                selector, System.getProperties()
+            );
+            configuration.entrySet().removeIf(e -> !resolvedSelector.equals(e.getKey()));
 
 Review comment:
   I think you need to add a check and error for selected provider not found, when you give a value to selector, but no suitable provider definition 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392642659
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: \${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  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:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  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:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
 
 Review comment:
   same as above, remove this line.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392652668
 
 

 ##########
 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:
   Read old `ModuleDefine#prepare`. Once the provider doesn't exist, `throw new ProviderNotFoundException(this.name() + " module no provider exists.");` this shows up.
   
   But because we enable multiple providers in YAML and using the selector, this check wouldn't work, that is why I asked.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392670134
 
 

 ##########
 File path: oap-server/server-bootstrap/src/main/java/org/apache/skywalking/oap/server/starter/config/ApplicationConfigLoader.java
 ##########
 @@ -105,6 +112,48 @@ private void overrideConfigBySystemEnv(ApplicationConfiguration configuration) {
         }
     }
 
+    private void selectConfig(final Map<String, Map<String, Object>> moduleConfiguration) {
+        final Set<String> modulesWithoutProvider = new HashSet<>();
+        for (final Map.Entry<String, Map<String, Object>> entry : moduleConfiguration.entrySet()) {
+            final String moduleName = entry.getKey();
+            final Map<String, Object> providerConfig = entry.getValue();
+            if (!providerConfig.containsKey(SELECTOR)) {
+                continue;
+            }
+            final String selector = (String) providerConfig.get(SELECTOR);
+            final String resolvedSelector = PropertyPlaceholderHelper.INSTANCE.replacePlaceholders(
+                selector, System.getProperties()
+            );
+            providerConfig.entrySet().removeIf(e -> !resolvedSelector.equals(e.getKey()));
+
+            if (!providerConfig.isEmpty()) {
+                continue;
+            }
+
+            if (!DISABLE_SELECTOR.equals(resolvedSelector)) {
+                throw new RuntimeException(
+                    "no provider found for module " + moduleName + ", " +
+                        "if you're sure it's not required module and want to remove it, " +
+                        "set the selector to -"
+                );
+            }
+
+            // now the module can be safely removed
+            modulesWithoutProvider.add(moduleName);
+        }
+
+        moduleConfiguration.entrySet().removeIf(e -> {
+            final String module = e.getKey();
+            final boolean shouldBeRemoved = modulesWithoutProvider.contains(module);
+
+            if (shouldBeRemoved) {
+                logger.info("removing module {} without any provider", module);
 
 Review comment:
   ```suggestion
                   logger.info("Remove module {} without any provider", module);
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392643649
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: \${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  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:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  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:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
 
-    # generate configuration
-    case ${SW_CONFIGURATION} in
-    none) generateConfigurationNone;;
-    apollo) generateConfigurationApollo;;
-    nacos) generateConfigurationNacos;;
-    zookeeper) generateConfigurationZookeeper;;
-    consul) generateConfigurationConsul;;
-    grpc) generateConfigurationGRPC;;
-    esac
+validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
 
-    cat <<EOT >> ${var_application_file}
-envoy-metric:
-  default:
-EOT
-    if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-    alsHTTPAnalysis: \${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:k8s-mesh}
-EOT
-    fi
-
-    if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_zipkin:
-  default:
-    host: \${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
-    port: \${SW_RECEIVER_ZIPKIN_PORT:9411}
-    contextPath: \${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
-EOT
-    fi
+if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
+    export SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS=k8s-mesh
+    echo "Set SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS to ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS}"
+fi
 
-    if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_jaeger:
-  default:
-    gRPCHost: \${SW_RECEIVER_JAEGER_HOST:0.0.0.0}
-    gRPCPort: \${SW_RECEIVER_JAEGER_PORT:14250}
-EOT
-    fi
+if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_ZIPKIN=default
+    echo "Set SW_RECEIVER_ZIPKIN to ${SW_RECEIVER_ZIPKIN}"
+fi
 
-    if [[ "$SW_TELEMETRY" = "so11y" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver-so11y:
-  default:
-EOT
-    fi
+if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_JAEGER=default
+    echo "Set SW_RECEIVER_JAEGER to ${SW_RECEIVER_JAEGER}"
+fi
 
 Review comment:
   Receiver enable seems a little different, @hanahmily. They are separated new module, not provider. We may need another feature to resolve this for docker.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599204487
 
 
   @kezhenxu94 I am sure why, but GitHub request you update branch manually.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io edited a comment on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599165132
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=h1) Report
   > Merging [#4514](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/16de88c1118e240299bfb9c2fb218d73216edc3d?src=pr&el=desc) will **increase** coverage by `0.07%`.
   > The diff coverage is `83.87%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4514/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4514      +/-   ##
   ==========================================
   + Coverage   25.47%   25.55%   +0.07%     
   ==========================================
     Files        1244     1244              
     Lines       28918    28943      +25     
     Branches     3959     3965       +6     
   ==========================================
   + Hits         7368     7395      +27     
   + Misses      20871    20866       -5     
   - Partials      679      682       +3
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...storage/plugin/influxdb/InfluxStorageProvider.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlUHJvdmlkZXIuamF2YQ==) | `0% <0%> (ø)` | :arrow_up: |
   | [...erver/library/module/ApplicationConfiguration.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItbGlicmFyeS9saWJyYXJ5LW1vZHVsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2xpYnJhcnkvbW9kdWxlL0FwcGxpY2F0aW9uQ29uZmlndXJhdGlvbi5qYXZh) | `94.44% <100%> (ø)` | :arrow_up: |
   | [...server/starter/config/ApplicationConfigLoader.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvc3RhcnRlci9jb25maWcvQXBwbGljYXRpb25Db25maWdMb2FkZXIuamF2YQ==) | `67.3% <85.71%> (+5.28%)` | :arrow_up: |
   | [...ache/skywalking/apm/agent/core/jvm/JVMService.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvanZtL0pWTVNlcnZpY2UuamF2YQ==) | `55% <0%> (-1.67%)` | :arrow_down: |
   | [...walking/oap/server/core/analysis/Downsampling.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2NvcmUvYW5hbHlzaXMvRG93bnNhbXBsaW5nLmphdmE=) | `100% <0%> (+100%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=footer). Last update [16de88c...803093d](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io edited a comment on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599165132
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=h1) Report
   > Merging [#4514](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/2118a76250919b40e68a7a245313f8eb79ec28f7&el=desc) will **increase** coverage by `0.05%`.
   > The diff coverage is `83.87%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4514/graphs/tree.svg?width=650&height=150&src=pr&token=qrILxY5yA8)](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4514      +/-   ##
   ==========================================
   + Coverage   25.50%   25.55%   +0.05%     
   ==========================================
     Files        1244     1244              
     Lines       28919    28944      +25     
     Branches     3958     3964       +6     
   ==========================================
   + Hits         7375     7396      +21     
   - Misses      20865    20867       +2     
   - Partials      679      681       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...storage/plugin/influxdb/InfluxStorageProvider.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlUHJvdmlkZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...server/starter/config/ApplicationConfigLoader.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvc3RhcnRlci9jb25maWcvQXBwbGljYXRpb25Db25maWdMb2FkZXIuamF2YQ==) | `67.30% <85.71%> (+5.28%)` | :arrow_up: |
   | [...erver/library/module/ApplicationConfiguration.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItbGlicmFyeS9saWJyYXJ5LW1vZHVsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2xpYnJhcnkvbW9kdWxlL0FwcGxpY2F0aW9uQ29uZmlndXJhdGlvbi5qYXZh) | `94.44% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=footer). Last update [2118a76...d0df2b7](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io commented on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599165132
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=h1) Report
   > Merging [#4514](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/2118a76250919b40e68a7a245313f8eb79ec28f7&el=desc) will **increase** coverage by `0.01%`.
   > The diff coverage is `73.33%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4514/graphs/tree.svg?width=650&height=150&src=pr&token=qrILxY5yA8)](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4514      +/-   ##
   ==========================================
   + Coverage   25.50%   25.51%   +0.01%     
   ==========================================
     Files        1244     1244              
     Lines       28919    28929      +10     
     Branches     3958     3961       +3     
   ==========================================
   + Hits         7375     7382       +7     
   - Misses      20865    20866       +1     
   - Partials      679      681       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...storage/plugin/influxdb/InfluxStorageProvider.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlUHJvdmlkZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...server/starter/config/ApplicationConfigLoader.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvc3RhcnRlci9jb25maWcvQXBwbGljYXRpb25Db25maWdMb2FkZXIuamF2YQ==) | `62.92% <75.00%> (+0.89%)` | :arrow_up: |
   | [...erver/library/module/ApplicationConfiguration.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItbGlicmFyeS9saWJyYXJ5LW1vZHVsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2xpYnJhcnkvbW9kdWxlL0FwcGxpY2F0aW9uQ29uZmlndXJhdGlvbi5qYXZh) | `94.44% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=footer). Last update [2118a76...733b449](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io edited a comment on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599165132
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=h1) Report
   > Merging [#4514](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/2118a76250919b40e68a7a245313f8eb79ec28f7?src=pr&el=desc) will **increase** coverage by `0.02%`.
   > The diff coverage is `76.47%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4514/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #4514      +/-   ##
   ==========================================
   + Coverage    25.5%   25.52%   +0.02%     
   ==========================================
     Files        1244     1244              
     Lines       28919    28931      +12     
     Branches     3958     3962       +4     
   ==========================================
   + Hits         7375     7384       +9     
   - Misses      20865    20866       +1     
   - Partials      679      681       +2
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...storage/plugin/influxdb/InfluxStorageProvider.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItc3RvcmFnZS1wbHVnaW4vc3RvcmFnZS1pbmZsdXhkYi1wbHVnaW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvb2FwL3NlcnZlci9zdG9yYWdlL3BsdWdpbi9pbmZsdXhkYi9JbmZsdXhTdG9yYWdlUHJvdmlkZXIuamF2YQ==) | `0% <0%> (ø)` | :arrow_up: |
   | [...erver/library/module/ApplicationConfiguration.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItbGlicmFyeS9saWJyYXJ5LW1vZHVsZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2xpYnJhcnkvbW9kdWxlL0FwcGxpY2F0aW9uQ29uZmlndXJhdGlvbi5qYXZh) | `94.44% <100%> (ø)` | :arrow_up: |
   | [...server/starter/config/ApplicationConfigLoader.java](https://codecov.io/gh/apache/skywalking/pull/4514/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvc3RhcnRlci9jb25maWcvQXBwbGljYXRpb25Db25maWdMb2FkZXIuamF2YQ==) | `63.73% <78.57%> (+1.71%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=footer). Last update [2118a76...dae57dc](https://codecov.io/gh/apache/skywalking/pull/4514?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392665385
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -18,478 +18,18 @@
 
 set -e
 
-var_application_file="config/application.yml"
-
-generateClusterStandalone() {
-    echo "cluster:" >> ${var_application_file}
-    echo "  standalone:" >> ${var_application_file}
-}
-
-generateClusterZookeeper() {
-    cat <<EOT >> ${var_application_file}
-cluster:
-  zookeeper:
-    nameSpace: \${SW_NAMESPACE:""}
-    hostPort: \${SW_CLUSTER_ZK_HOST_PORT:zookeeper:2181}
-    #Retry Policy
-    baseSleepTimeMs: \${SW_CLUSTER_ZK_SLEEP_TIME:1000} # initial amount of time to wait between retries
-    maxRetries: \${SW_CLUSTER_ZK_MAX_RETRIES:3} # max number of times to retry
-    # Enable ACL
-    enableACL: \${SW_ZK_ENABLE_ACL:false} # disable ACL in default
-    schema: \${SW_ZK_SCHEMA:digest} # only support digest schema
-    expression: \${SW_ZK_EXPRESSION:skywalking:skywalking}
-EOT
-}
-
-generateClusterK8s() {
-    cat <<EOT >> ${var_application_file}
-cluster:
-  kubernetes:
-    watchTimeoutSeconds: \${SW_CLUSTER_K8S_WATCH_TIMEOUT:60}
-    namespace: \${SW_CLUSTER_K8S_NAMESPACE:default}
-    labelSelector: \${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
-    uidEnvName: \${SW_CLUSTER_K8S_UID:SKYWALKING_COLLECTOR_UID}
-EOT
-}
-
-generateClusterConsul() {
-     cat <<EOT >> ${var_application_file}
-cluster:
-  consul:
-    serviceName: \${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
-    # Consul cluster nodes, example: 10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500
-    hostPort: \${SW_CLUSTER_CONSUL_HOST_PORT:consul:8500}
-EOT
-}
-
-generateClusterEtcd() {
-    cat <<EOT >> ${var_application_file}
-cluster:
-  etcd:
-    serviceName: \${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
-    # Etcd cluster nodes, example: 10.0.0.1:2379,10.0.0.2:2379,10.0.0.3:2379
-    hostPort: \${SW_CLUSTER_ETCD_HOST_PORT:etcd:2379}
-EOT
-}
-
-generateClusterNacos() {
-    cat <<EOT >> ${var_application_file}
-cluster:
-  nacos:
-    serviceName: \${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
-    namespace: \${SW_CLUSTER_NACOS_NAMESPACE:""}
-    hostPort: \${SW_CLUSTER_NACOS_HOST_PORT:nacos:8848}
-EOT
-}
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-generateStorageElastisearch() {
-if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
-    cat <<EOT >> ${var_application_file}
-storage:
-  zipkin-elasticsearch:
-EOT
-elif [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
-    cat <<EOT >> ${var_application_file}
-storage:
-  jaeger-elasticsearch:
-EOT
-else
-    cat <<EOT >> ${var_application_file}
-storage:
-  elasticsearch7:
-EOT
+if [[ "$SW_TELEMETRY" = "so11y" ]]; then
+    export SW_RECEIVER_SO11Y=default
+    echo "Set SW_RECEIVER_SO11Y to ${SW_RECEIVER_SO11Y}"
 fi
-cat <<EOT >> ${var_application_file}
-    nameSpace: \${SW_NAMESPACE:""}
-    clusterNodes: \${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
-    protocol: \${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
-    user: \${SW_ES_USER:""}
-    password: \${SW_ES_PASSWORD:""}
-    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:2000} # Execute the bulk every 2000 requests
-    bulkSize: \${SW_STORAGE_ES_BULK_SIZE:20} # flush the bulk every 20mb
-    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}
-EOT
-}
-
-generateStorageH2() {
-    cat <<EOT >> ${var_application_file}
-storage:
-  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}
-EOT
-}
-
-generateStorageMySQL() {
-    cat <<EOT >> ${var_application_file}
-storage:
-  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}
-EOT
-}
-
-generateStorageInfluxDB() {
-    cat <<EOT >> ${var_application_file}
-storage:
-  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
-EOT
-}
-
-generateConfigurationNone() {
-    cat <<EOT >> ${var_application_file}
-configuration:
-  none:
-EOT
-}
-
-generateConfigurationApollo() {
-    cat <<EOT >> ${var_application_file}
-configuration:
-  apollo:
-    apolloMeta: \${SW_CONFIGURATION_APOLLO_META:http://apollo:8080}
-    apolloCluster: \${SW_CONFIGURATION_APOLLO_CLUSTER:default}
-    apolloEnv: \${SW_CONFIGURATION_APOLLO_ENV:""}
-    appId: \${SW_CONFIGURATION_APOLLO_APP_ID:skywalking}
-    period: \${SW_CONFIGURATION_APOLLO_PERIOD:5}
-EOT
-}
-
-generateConfigurationNacos() {
-    cat <<EOT >> ${var_application_file}
-configuration:
-  nacos:
-    # Nacos Server Host
-    serverAddr: \${SW_CONFIGURATION_NACOS_SERVER_ADDR:nacos}
-    # Nacos Server Port
-    port: \${SW_CONFIGURATION_NACOS_PORT:8848}
-    # Nacos Configuration Group
-    group: \${SW_CONFIGURATION_NACOS_GROUP:skywalking}
-    # Nacos Configuration namespace
-    namespace: \${SW_CONFIGURATION_NACOS_NAMESPACE:""}
-    # Unit seconds, sync period. Default fetch every 60 seconds.
-    period : \${SW_CONFIGURATION_NACOS_PERIOD:5}
-    # the name of current cluster, set the name if you want to upstream system known.
-    clusterName: \${SW_CONFIGURATION_NACOS_CLUSTER_NAME:default}
-EOT
-}
-
-generateConfigurationZookeeper() {
-    cat <<EOT >> ${var_application_file}
-configuration:
-  zookeeper:
-    period: \${SW_CONFIGURATION_ZOOKEEPER_PERIOD:60} # Unit seconds, sync period. Default fetch every 60 seconds.
-    nameSpace: \${SW_CONFIGURATION_ZOOKEEPER_NAMESPACE:/default}
-    hostPort: \${SW_CONFIGURATION_ZOOKEEPER_HOST_PATH:localhost:2181}
-    #Retry Policy
-    baseSleepTimeMs: \${SW_CONFIGURATION_ZOOKEEPER_BASE_SLEEP_TIME_MS:1000} # initial amount of time to wait between retries
-    maxRetries: \${SW_CONFIGURATION_ZOOKEEPER_MAX_RETRIES:3}3 # max number of times to retry
-EOT
-}
-
-generateConfigurationGRPC() {
-    cat <<EOT >> ${var_application_file}
-configuration:
-  grpc:
-    host: \${SW_CONFIGURATION_GRPC_HOST:127.0.0.1}
-    port: \${SW_CONFIGURATION_GRPC_PORT:9555}
-    period: \${SW_CONFIGURATION_GRPC_PERIOD:60}
-    clusterName: \${SW_CONFIGURATION_GRPC_CLUSTER_NAME:"default"}
-EOT
-}
-
-generateConfigurationConsul() {
-    cat <<EOT >> ${var_application_file}
-configuration:
-  consul:
-    # Consul host and ports, separated by comma, e.g. 1.2.3.4:8500,2.3.4.5:8500
-    hostAndPorts: \${SW_CONFIGURATION_CONSUL_ADDRESS:127.0.0.1:8500}
-    # Sync period in seconds. Defaults to 60 seconds.
-    period: \${SW_CONFIGURATION_CONSUL_PERIOD:60}
-EOT
-}
-
-generateTelemetryNone() {
-    cat <<EOT >> ${var_application_file}
-telemetry:
-  none:
-EOT
-}
-
-generateTelemetryPrometheus() {
-    cat <<EOT >> ${var_application_file}
-telemetry:
-  prometheus:
-    host: \${SW_TELEMETRY_PROMETHEUS_HOST:0.0.0.0}
-    port: \${SW_TELEMETRY_PROMETHEUS_PORT:1234}
-EOT
-}
-
-generateTelemetrySo11y() {
-    cat <<EOT >> ${var_application_file}
-telemetry:
-  so11y:
-    prometheusExporterEnabled: \${SW_TELEMETRY_SO11Y_PROMETHEUS_ENABLED:true}
-    prometheusExporterHost: \${SW_TELEMETRY_PROMETHEUS_HOST:0.0.0.0}
-    prometheusExporterPort: \${SW_TELEMETRY_PROMETHEUS_PORT:1234}
-EOT
-}
-
-validateVariables() {
-    name=$1; value=$2; list=$3
-    valid=false
-    for c in ${list} ; do
-        if [[ "$c" = "$value" ]]; then
-            valid=true
-        fi
-    done
 
-    if ! ${valid}; then
-        echo "Error: $name=$value please specify $name = $list"
-        exit 1
-    fi
-}
-
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
 Review comment:
   FYI @wu-sheng and @hanahmily , here is another bug in the Docker image, with this, the docker image for es7 never works

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng merged pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392670096
 
 

 ##########
 File path: oap-server/server-bootstrap/src/main/java/org/apache/skywalking/oap/server/starter/config/ApplicationConfigLoader.java
 ##########
 @@ -105,6 +112,48 @@ private void overrideConfigBySystemEnv(ApplicationConfiguration configuration) {
         }
     }
 
+    private void selectConfig(final Map<String, Map<String, Object>> moduleConfiguration) {
+        final Set<String> modulesWithoutProvider = new HashSet<>();
+        for (final Map.Entry<String, Map<String, Object>> entry : moduleConfiguration.entrySet()) {
+            final String moduleName = entry.getKey();
+            final Map<String, Object> providerConfig = entry.getValue();
+            if (!providerConfig.containsKey(SELECTOR)) {
+                continue;
+            }
+            final String selector = (String) providerConfig.get(SELECTOR);
+            final String resolvedSelector = PropertyPlaceholderHelper.INSTANCE.replacePlaceholders(
+                selector, System.getProperties()
+            );
+            providerConfig.entrySet().removeIf(e -> !resolvedSelector.equals(e.getKey()));
+
+            if (!providerConfig.isEmpty()) {
+                continue;
+            }
+
+            if (!DISABLE_SELECTOR.equals(resolvedSelector)) {
+                throw new RuntimeException(
 
 Review comment:
   This should be `ProviderNotFoundException`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392642883
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: \${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  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:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  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:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
 
-    # generate configuration
-    case ${SW_CONFIGURATION} in
-    none) generateConfigurationNone;;
-    apollo) generateConfigurationApollo;;
-    nacos) generateConfigurationNacos;;
-    zookeeper) generateConfigurationZookeeper;;
-    consul) generateConfigurationConsul;;
-    grpc) generateConfigurationGRPC;;
-    esac
+validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
 
-    cat <<EOT >> ${var_application_file}
-envoy-metric:
-  default:
-EOT
-    if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-    alsHTTPAnalysis: \${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:k8s-mesh}
-EOT
-    fi
-
-    if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_zipkin:
-  default:
-    host: \${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
-    port: \${SW_RECEIVER_ZIPKIN_PORT:9411}
-    contextPath: \${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
-EOT
-    fi
+if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
+    export SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS=k8s-mesh
+    echo "Set SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS to ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS}"
+fi
 
-    if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_jaeger:
-  default:
-    gRPCHost: \${SW_RECEIVER_JAEGER_HOST:0.0.0.0}
-    gRPCPort: \${SW_RECEIVER_JAEGER_PORT:14250}
-EOT
-    fi
+if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_ZIPKIN=default
+    echo "Set SW_RECEIVER_ZIPKIN to ${SW_RECEIVER_ZIPKIN}"
+fi
 
-    if [[ "$SW_TELEMETRY" = "so11y" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver-so11y:
-  default:
-EOT
-    fi
+if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_JAEGER=default
+    echo "Set SW_RECEIVER_JAEGER to ${SW_RECEIVER_JAEGER}"
+fi
 
-    if [[ "$SW_EXPORTER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-exporter:
-  grpc:
-    targetHost: \${SW_EXPORTER_GRPC_HOST:127.0.0.1}
-    targetPort: \${SW_EXPORTER_GRPC_PORT:9870}
-EOT
-    fi
-}
+if [[ "$SW_TELEMETRY" = "so11y" ]]; then
+    export SW_RECEIVER_SO11Y=default
+    echo "Set SW_RECEIVER_SO11Y to ${SW_RECEIVER_SO11Y}"
+fi
 
-echo "[Entrypoint] Apache SkyWalking Docker Image"
+if [[ "$SW_EXPORTER_ENABLED" = "true" ]]; then
+    export SW_EXPORTER=grpc
+    echo "Set SW_EXPORTER to ${SW_EXPORTER}"
+fi
 
-SW_CLUSTER=${SW_CLUSTER:-standalone}
-SW_STORAGE=${SW_STORAGE:-h2}
-SW_CONFIGURATION=${SW_CONFIGURATION:-none}
-SW_TELEMETRY=${SW_TELEMETRY:-none}
 EXT_LIB_DIR=/skywalking/ext-libs
 EXT_CONFIG_DIR=/skywalking/ext-config
 
-# If user wants to override application.yml, the one generated by docker-entrypoint.sh should be ignored.
-[[ -f ${EXT_CONFIG_DIR}/application.yml ]] && SW_L0AD_CONFIG_FILE_FROM_VOLUME=true
-
 # Override configuration files
 cp -vfR ${EXT_CONFIG_DIR}/ config/
-if [[ -z "$SW_L0AD_CONFIG_FILE_FROM_VOLUME" ]] || [[ "$SW_L0AD_CONFIG_FILE_FROM_VOLUME" != "true" ]]; then
-    generateApplicationYaml
-    echo "Generated application.yml"
-    echo "-------------------------"
-    cat ${var_application_file}
-    echo "-------------------------"
-fi
 
 Review comment:
   Why removing this block? user can't override generated yaml withou it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392643317
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: \${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  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:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  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:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
 
-    # generate configuration
-    case ${SW_CONFIGURATION} in
-    none) generateConfigurationNone;;
-    apollo) generateConfigurationApollo;;
-    nacos) generateConfigurationNacos;;
-    zookeeper) generateConfigurationZookeeper;;
-    consul) generateConfigurationConsul;;
-    grpc) generateConfigurationGRPC;;
-    esac
+validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
 
-    cat <<EOT >> ${var_application_file}
-envoy-metric:
-  default:
-EOT
-    if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-    alsHTTPAnalysis: \${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:k8s-mesh}
-EOT
-    fi
-
-    if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_zipkin:
-  default:
-    host: \${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
-    port: \${SW_RECEIVER_ZIPKIN_PORT:9411}
-    contextPath: \${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
-EOT
-    fi
+if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
+    export SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS=k8s-mesh
+    echo "Set SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS to ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS}"
+fi
 
-    if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_jaeger:
-  default:
-    gRPCHost: \${SW_RECEIVER_JAEGER_HOST:0.0.0.0}
-    gRPCPort: \${SW_RECEIVER_JAEGER_PORT:14250}
-EOT
-    fi
+if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_ZIPKIN=default
+    echo "Set SW_RECEIVER_ZIPKIN to ${SW_RECEIVER_ZIPKIN}"
+fi
 
 Review comment:
   same as above.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily edited a comment on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily edited a comment on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599170923
 
 
   @kezhenxu94 Good job! Except for some nits.
   
   I prefer to remove unnecessary environment variable converting in entrypoint script, so let's just delete them. But to keep `so11y` related segments is a good idea because of the link between receiver and telemetry. Thanks

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392642632
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
 Review comment:
   remove it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 commented on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599162735
 
 
   I just left the `application.yml`s in E2E intact, as they will be totally replaced in #4510 , and we can verify the compatibility with old `applicationl.yml` by the way

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392654338
 
 

 ##########
 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:
   This fails because some module request cluster module in the bootstrap stage, if not, then this error wouldn't show up. My point is, this should be a check rule.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392642883
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: \${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  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:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  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:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
 
-    # generate configuration
-    case ${SW_CONFIGURATION} in
-    none) generateConfigurationNone;;
-    apollo) generateConfigurationApollo;;
-    nacos) generateConfigurationNacos;;
-    zookeeper) generateConfigurationZookeeper;;
-    consul) generateConfigurationConsul;;
-    grpc) generateConfigurationGRPC;;
-    esac
+validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
 
-    cat <<EOT >> ${var_application_file}
-envoy-metric:
-  default:
-EOT
-    if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-    alsHTTPAnalysis: \${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:k8s-mesh}
-EOT
-    fi
-
-    if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_zipkin:
-  default:
-    host: \${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
-    port: \${SW_RECEIVER_ZIPKIN_PORT:9411}
-    contextPath: \${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
-EOT
-    fi
+if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
+    export SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS=k8s-mesh
+    echo "Set SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS to ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS}"
+fi
 
-    if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_jaeger:
-  default:
-    gRPCHost: \${SW_RECEIVER_JAEGER_HOST:0.0.0.0}
-    gRPCPort: \${SW_RECEIVER_JAEGER_PORT:14250}
-EOT
-    fi
+if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_ZIPKIN=default
+    echo "Set SW_RECEIVER_ZIPKIN to ${SW_RECEIVER_ZIPKIN}"
+fi
 
-    if [[ "$SW_TELEMETRY" = "so11y" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver-so11y:
-  default:
-EOT
-    fi
+if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_JAEGER=default
+    echo "Set SW_RECEIVER_JAEGER to ${SW_RECEIVER_JAEGER}"
+fi
 
-    if [[ "$SW_EXPORTER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-exporter:
-  grpc:
-    targetHost: \${SW_EXPORTER_GRPC_HOST:127.0.0.1}
-    targetPort: \${SW_EXPORTER_GRPC_PORT:9870}
-EOT
-    fi
-}
+if [[ "$SW_TELEMETRY" = "so11y" ]]; then
+    export SW_RECEIVER_SO11Y=default
+    echo "Set SW_RECEIVER_SO11Y to ${SW_RECEIVER_SO11Y}"
+fi
 
-echo "[Entrypoint] Apache SkyWalking Docker Image"
+if [[ "$SW_EXPORTER_ENABLED" = "true" ]]; then
+    export SW_EXPORTER=grpc
+    echo "Set SW_EXPORTER to ${SW_EXPORTER}"
+fi
 
-SW_CLUSTER=${SW_CLUSTER:-standalone}
-SW_STORAGE=${SW_STORAGE:-h2}
-SW_CONFIGURATION=${SW_CONFIGURATION:-none}
-SW_TELEMETRY=${SW_TELEMETRY:-none}
 EXT_LIB_DIR=/skywalking/ext-libs
 EXT_CONFIG_DIR=/skywalking/ext-config
 
-# If user wants to override application.yml, the one generated by docker-entrypoint.sh should be ignored.
-[[ -f ${EXT_CONFIG_DIR}/application.yml ]] && SW_L0AD_CONFIG_FILE_FROM_VOLUME=true
-
 # Override configuration files
 cp -vfR ${EXT_CONFIG_DIR}/ config/
-if [[ -z "$SW_L0AD_CONFIG_FILE_FROM_VOLUME" ]] || [[ "$SW_L0AD_CONFIG_FILE_FROM_VOLUME" != "true" ]]; then
-    generateApplicationYaml
-    echo "Generated application.yml"
-    echo "-------------------------"
-    cat ${var_application_file}
-    echo "-------------------------"
-fi
 
 Review comment:
   Why removing this block? user can't override generated yaml withou it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599169172
 
 
   Please notice k8s installation fails. Whether something wrong about the docker?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] kezhenxu94 commented on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599171382
 
 
   Thanks for reviewing, the review comments will be addressed after figuring out the reason why tests failed

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392654436
 
 

 ##########
 File path: oap-server/server-bootstrap/src/main/java/org/apache/skywalking/oap/server/starter/config/ApplicationConfigLoader.java
 ##########
 @@ -105,6 +109,26 @@ private void overrideConfigBySystemEnv(ApplicationConfiguration configuration) {
         }
     }
 
+    private void selectConfig(final Map<String, Map<String, Object>> moduleConfiguration) {
+        final Set<String> modulesWithoutProvider = new HashSet<>();
+        for (final Map.Entry<String, Map<String, Object>> entry : moduleConfiguration.entrySet()) {
+            final String moduleName = entry.getKey();
+            final Map<String, Object> providerConfig = entry.getValue();
+            if (providerConfig.containsKey("selector")) {
+                final String selector = (String) providerConfig.get("selector");
+                final String resolvedSelector = PropertyPlaceholderHelper.INSTANCE.replacePlaceholders(
+                    selector, System.getProperties()
+                );
+                providerConfig.entrySet().removeIf(e -> !resolvedSelector.equals(e.getKey()));
 
 Review comment:
   @kezhenxu94 To be more clear,  after this remove, it could be no provider available, we should check and report error immidiately.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392643324
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: \${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  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:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  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:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
 
-    # generate configuration
-    case ${SW_CONFIGURATION} in
-    none) generateConfigurationNone;;
-    apollo) generateConfigurationApollo;;
-    nacos) generateConfigurationNacos;;
-    zookeeper) generateConfigurationZookeeper;;
-    consul) generateConfigurationConsul;;
-    grpc) generateConfigurationGRPC;;
-    esac
+validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
 
-    cat <<EOT >> ${var_application_file}
-envoy-metric:
-  default:
-EOT
-    if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-    alsHTTPAnalysis: \${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:k8s-mesh}
-EOT
-    fi
-
-    if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_zipkin:
-  default:
-    host: \${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
-    port: \${SW_RECEIVER_ZIPKIN_PORT:9411}
-    contextPath: \${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
-EOT
-    fi
+if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
+    export SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS=k8s-mesh
+    echo "Set SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS to ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS}"
+fi
 
-    if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_jaeger:
-  default:
-    gRPCHost: \${SW_RECEIVER_JAEGER_HOST:0.0.0.0}
-    gRPCPort: \${SW_RECEIVER_JAEGER_PORT:14250}
-EOT
-    fi
+if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_ZIPKIN=default
+    echo "Set SW_RECEIVER_ZIPKIN to ${SW_RECEIVER_ZIPKIN}"
+fi
 
-    if [[ "$SW_TELEMETRY" = "so11y" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver-so11y:
-  default:
-EOT
-    fi
+if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_JAEGER=default
+    echo "Set SW_RECEIVER_JAEGER to ${SW_RECEIVER_JAEGER}"
+fi
 
 Review comment:
   same

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on issue #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on issue #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#issuecomment-599170923
 
 
   @kezhenxu94 Good job! Except for some nits.
   
   I prefer to remove unnecessary environment variable converting in entrypoint script, so let's just delete them. But keep `so11y` related is a good idea because of the link between receiver and telemetry. Thanks

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392642626
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
 Review comment:
   I think we should remove this assertation, leave it to oap config value checker.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392669645
 
 

 ##########
 File path: docs/en/setup/backend/backend-setup.md
 ##########
 @@ -14,26 +14,41 @@ End user can switch or assemble the collector features by their own requirements
 
 So, in `application.yml`, there are three levels.
 1. **Level 1**, module name. Meaning this module is active in running mode.
-1. **Level 2**, provider name. Set the provider of the module.
+1. **Level 2**, provider name and provider selector. Available providers are listed here with a selector to indicate which one will actually take effect.
 1. **Level 3**. settings of the provider.
 
 Example:
+
 ```yaml
-core:
-  default:
-    restHost: 0.0.0.0
-    restPort: 12800
-    restContextPath: /
-    gRPCHost: 0.0.0.0
-    gRPCPort: 11800
+storage:
+  selector: mysql # the mysql storage will actually be activated, while the h2 storage takes no effect
+  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}
+  # other configurations
 ```
-1. **core** is the module.
-1. **default** is the default implementor of core module.
-1. `restHost`, `restPort`, ... `gRPCHost` are all setting items of the implementor.
+
+1. **`core`** is the module.
+1. **`selector`** selects one out of the all providers listed below, the unselected ones take no effect as if they were deleted.
 
 Review comment:
   I think we also should indicate `selector` is optional if there is only one provider.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392648987
 
 

 ##########
 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:
   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.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392642670
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: \${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  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:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  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:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
 
-    # generate configuration
-    case ${SW_CONFIGURATION} in
-    none) generateConfigurationNone;;
-    apollo) generateConfigurationApollo;;
-    nacos) generateConfigurationNacos;;
-    zookeeper) generateConfigurationZookeeper;;
-    consul) generateConfigurationConsul;;
-    grpc) generateConfigurationGRPC;;
-    esac
+validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
 
 Review comment:
   remove it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392643268
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: \${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  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:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  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:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
 
-    # generate configuration
-    case ${SW_CONFIGURATION} in
-    none) generateConfigurationNone;;
-    apollo) generateConfigurationApollo;;
-    nacos) generateConfigurationNacos;;
-    zookeeper) generateConfigurationZookeeper;;
-    consul) generateConfigurationConsul;;
-    grpc) generateConfigurationGRPC;;
-    esac
+validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
 
-    cat <<EOT >> ${var_application_file}
-envoy-metric:
-  default:
-EOT
-    if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-    alsHTTPAnalysis: \${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:k8s-mesh}
-EOT
-    fi
-
-    if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_zipkin:
-  default:
-    host: \${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
-    port: \${SW_RECEIVER_ZIPKIN_PORT:9411}
-    contextPath: \${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
-EOT
-    fi
+if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
+    export SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS=k8s-mesh
+    echo "Set SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS to ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS}"
+fi
 
 Review comment:
   I suggest removing these codes. I should provide some "backwards" compbility, just like "SW_STORAGE", but keeping it only add complex and confusing variables convertion. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392670473
 
 

 ##########
 File path: docs/en/setup/backend/backend-setup.md
 ##########
 @@ -14,26 +14,41 @@ End user can switch or assemble the collector features by their own requirements
 
 So, in `application.yml`, there are three levels.
 1. **Level 1**, module name. Meaning this module is active in running mode.
-1. **Level 2**, provider name. Set the provider of the module.
+1. **Level 2**, provider name and provider selector. Available providers are listed here with a selector to indicate which one will actually take effect.
 
 Review comment:
   ```suggestion
   1. **Level 2**, provider option list and provider selector. Available providers are listed here with a selector to indicate which one will actually take effect.
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] hanahmily commented on a change in pull request #4514: Add selector property in application.yml

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392643402
 
 

 ##########
 File path: docker/oap-es7/docker-entrypoint.sh
 ##########
 @@ -294,202 +33,51 @@ validateVariables() {
     fi
 }
 
-generateApplicationYaml() {
-    # validate
-    [[ -z "$SW_CLUSTER" ]] && [[ -z "$SW_STORAGE" ]] && [[ -z "$SW_CONFIGURATION" ]] \
-        && [[ -z "$SW_TELEMETRY" ]] \
-        && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
-
-    validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
-
-    validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
-
-    validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
-
-    validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
+echo "[Entrypoint] Apache SkyWalking Docker Image"
 
-    echo "# Generated by 'docker-entrypoint.sh'" > ${var_application_file}
-    #generate cluster
-    case ${SW_CLUSTER} in
-    standalone) generateClusterStandalone;;
-    zookeeper) generateClusterZookeeper;;
-    kubernetes) generateClusterK8s;;
-    consul) generateClusterConsul;;
-    etcd) generateClusterEtcd;;
-    nacos) generateClusterNacos;;
-    esac
+# validate
+[[ -z "$SW_CLUSTER" ]] || [[ -z "$SW_STORAGE" ]] || [[ -z "$SW_CONFIGURATION" ]] \
+    || [[ -z "$SW_TELEMETRY" ]] \
+    && { echo "Error: please specify \"SW_CLUSTER\" \"SW_STORAGE\" \"SW_CONFIGURATION\" \"SW_TELEMETRY\""; exit 1; }
 
-    #generate core
-    cat <<EOT >> ${var_application_file}
-core:
-  default:
-    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
-    # Receiver: Receive agent data, Level 1 aggregate
-    # Aggregator: Level 2 aggregate
-    role: \${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
-    restHost: \${SW_CORE_REST_HOST:0.0.0.0}
-    restPort: \${SW_CORE_REST_PORT:12800}
-    restContextPath: \${SW_CORE_REST_CONTEXT_PATH:/}
-    gRPCHost: \${SW_CORE_GRPC_HOST:0.0.0.0}
-    gRPCPort: \${SW_CORE_GRPC_PORT:11800}
-    gRPCSslEnabled: \${SW_CORE_GRPC_SSL_ENABLED:false}
-    gRPCSslKeyPath: \${SW_CORE_GRPC_SSL_KEY_PATH:""}
-    gRPCSslCertChainPath: \${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
-    gRPCSslTrustedCAPath: \${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
-    downsampling:
-    - Hour
-    - Day
-    - Month
-    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
-    enableDataKeeperExecutor: \${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
-    dataKeeperExecutePeriod: \${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
-    recordDataTTL: \${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
-    minuteMetricsDataTTL: \${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
-    hourMetricsDataTTL: \${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
-    dayMetricsDataTTL: \${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
-    monthMetricsDataTTL: \${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
-    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
-    # the metrics may not be accurate within that minute.
-    enableDatabaseSession: \${SW_CORE_ENABLE_DATABASE_SESSION:true}
-    topNReportPeriod: \${SW_CORE_TOPN_REPORT_PERIOD:10}
-EOT
+validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
 
-    # generate storage
-    case ${SW_STORAGE} in
-    elasticsearch) generateStorageElastisearch;;
-    h2) generateStorageH2;;
-    mysql) generateStorageMySQL;;
-    influxdb) generateStorageInfluxDB;;
-    esac
+validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql influxdb"
 
-    cat <<EOT >> ${var_application_file}
-receiver-sharing-server:
-  default:
-   restHost: \${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
-   restPort: \${SW_RECEIVER_SHARING_REST_PORT:0}
-   restContextPath: \${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
-   gRPCHost: \${SW_RECEIVER_SHARING_GRPC_HOST:0.0.0.0}
-   gRPCPort: \${SW_RECEIVER_SHARING_GRPC_PORT:0}
-   maxConcurrentCallsPerConnection: \${SW_RECEIVER_SHARING_MAX_CONCURRENT_CALL:0}
-   maxMessageSize: \${SW_RECEIVER_SHARING_MAX_MESSAGE_SIZE:0}
-   gRPCThreadPoolSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_SIZE:0}
-   gRPCThreadPoolQueueSize: \${SW_RECEIVER_SHARING_GRPC_THREAD_POOL_QUEUE_SIZE:0}
-   authentication: \${SW_AUTHENTICATION:""}
-   gRPCSslEnabled: \${SW_RECEIVER_SHARING_GRPC_SSL_ENABLED:false}
-   gRPCSslKeyPath: \${SW_RECEIVER_SHARING_GRPC_SSL_KEY_PATH:""}
-   gRPCSslCertChainPath: \${SW_RECEIVER_SHARING_GRPC_SSL_CERT_CHAIN_PATH:""}
-receiver-register:
-  default:
-receiver-trace:
-  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:
-  default:
-receiver-clr:
-  default:
-service-mesh:
-  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:
-  default:
-query:
-  graphql:
-    path: \${SW_QUERY_GRAPHQL_PATH:/graphql}
-alarm:
-  default:
-EOT
-    # generate telemetry
-    case ${SW_TELEMETRY} in
-    none) generateTelemetryNone;;
-    prometheus) generateTelemetryPrometheus;;
-    so11y) generateTelemetrySo11y;;
-    esac
+validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
 
-    # generate configuration
-    case ${SW_CONFIGURATION} in
-    none) generateConfigurationNone;;
-    apollo) generateConfigurationApollo;;
-    nacos) generateConfigurationNacos;;
-    zookeeper) generateConfigurationZookeeper;;
-    consul) generateConfigurationConsul;;
-    grpc) generateConfigurationGRPC;;
-    esac
+validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
 
-    cat <<EOT >> ${var_application_file}
-envoy-metric:
-  default:
-EOT
-    if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-    alsHTTPAnalysis: \${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:k8s-mesh}
-EOT
-    fi
-
-    if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_zipkin:
-  default:
-    host: \${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
-    port: \${SW_RECEIVER_ZIPKIN_PORT:9411}
-    contextPath: \${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
-EOT
-    fi
+if [[ "$SW_ENVOY_ALS_ENABLED" = "true" ]]; then
+    export SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS=k8s-mesh
+    echo "Set SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS to ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS}"
+fi
 
-    if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver_jaeger:
-  default:
-    gRPCHost: \${SW_RECEIVER_JAEGER_HOST:0.0.0.0}
-    gRPCPort: \${SW_RECEIVER_JAEGER_PORT:14250}
-EOT
-    fi
+if [[ "$SW_RECEIVER_ZIPKIN_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_ZIPKIN=default
+    echo "Set SW_RECEIVER_ZIPKIN to ${SW_RECEIVER_ZIPKIN}"
+fi
 
-    if [[ "$SW_TELEMETRY" = "so11y" ]]; then
-        cat <<EOT >> ${var_application_file}
-receiver-so11y:
-  default:
-EOT
-    fi
+if [[ "$SW_RECEIVER_JAEGER_ENABLED" = "true" ]]; then
+    export SW_RECEIVER_JAEGER=default
+    echo "Set SW_RECEIVER_JAEGER to ${SW_RECEIVER_JAEGER}"
+fi
 
-    if [[ "$SW_EXPORTER_ENABLED" = "true" ]]; then
-        cat <<EOT >> ${var_application_file}
-exporter:
-  grpc:
-    targetHost: \${SW_EXPORTER_GRPC_HOST:127.0.0.1}
-    targetPort: \${SW_EXPORTER_GRPC_PORT:9870}
-EOT
-    fi
-}
+if [[ "$SW_TELEMETRY" = "so11y" ]]; then
+    export SW_RECEIVER_SO11Y=default
+    echo "Set SW_RECEIVER_SO11Y to ${SW_RECEIVER_SO11Y}"
+fi
 
-echo "[Entrypoint] Apache SkyWalking Docker Image"
+if [[ "$SW_EXPORTER_ENABLED" = "true" ]]; then
+    export SW_EXPORTER=grpc
+    echo "Set SW_EXPORTER to ${SW_EXPORTER}"
+fi
 
 Review comment:
   same as above, remove it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services