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/14 13:43:19 UTC

[GitHub] [skywalking] kezhenxu94 opened a new issue #4511: [DISCUSSION] Optimize configurations `application.yml`

kezhenxu94 opened a new issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511
 
 
   ### Background
   
   During the E2E test refactoring work, I found it troublesome to change some of the configurations, the similarities are that they are all single-choice configuration, examples are storages, cluster coordinators, dynamic configuration implementations
   
   ### Current status
   
   The current solution is to list them all, but comment out some of them, only leaving one item uncommented, the trouble is when we're changing the configuration in auto workflow (such as Docker container, e2e tests), we have to do many string manipulations, (awk, shell, etc.), which is error prone and unstable.
   
   ### Proposal
   
   I'm proposing to organize the configurations as follows, taking the storage as an example:
   
   <details>
   
   <summary>click to expand the suggested format</summary>
   
   ```yaml
   storage:
     selector: ${SW_STORAGE:elasticsearch7}
     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}
     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
   ```
   </details>
   
   the key point is to leave all choices uncommented, and add a `selector` to indicate which will take effect actually, in this way, we can simply change this selector by environment variable or system property.

----------------------------------------------------------------
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 #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
hanahmily commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599067501
 
 
   LGTM. For docker and k8s, here are some tips for you:
   
    1. Simplify `docker-entrypoint.sh`, we can remove most of its content because the main purpose is to select one from multiple options. I suggest you keep the same naming pattern with entrypoint since your example follows this way.
   
    1. K8s Helm chart would get benefits from it. If we keep the same selector name, helm chart doesn't need any change @innerpeacez Is that ok?
   

----------------------------------------------------------------
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] innerpeacez commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
innerpeacez commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599075949
 
 
   There is no default application.yml file maintained for helm. For helm, as long as the env variable name is unchanged, there is no need to change it. @wu-sheng

----------------------------------------------------------------
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] innerpeacez commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
innerpeacez commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599072911
 
 
   > 2. K8s Helm chart would get benefits from it. If we keep the same selector name, helm chart doesn't need any change @innerpeacez Is that ok?
   
   Yes, If the selector name is the same ,helm doesn't need to be changed. @hanahmily
   

----------------------------------------------------------------
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 closed issue #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/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] hanahmily commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
hanahmily commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599068335
 
 
   > > If we keep the same selector name, helm chart doesn't need any change @innerpeacez Is that ok?
   > 
   > I'd like to minimize the changes, what's the name in helm chart?
   
   It uses the environment variables from docker-entrypoint.sh. If we convert them into the new application.yml configuration system helm chart doesn't need any update/change, just leave it alone.

----------------------------------------------------------------
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 #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
hanahmily commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599068563
 
 
   > * `${SW_CLUSTER}`
   > * `${SW_STORAGE}`
   > 
   > I read from this, https://github.com/apache/skywalking-docker/blob/master/6/6.6/oap/docker-entrypoint.ss
   
   They are the key points.
   ```
       validateVariables "SW_CLUSTER" "$SW_CLUSTER" "standalone zookeeper kubernetes consul etcd nacos"
   
   
       validateVariables "SW_STORAGE" "$SW_STORAGE" "elasticsearch h2 mysql"
   
   
       validateVariables "SW_CONFIGURATION" "$SW_CONFIGURATION" "none apollo nacos zookeeper"
   
   
       validateVariables "SW_TELEMETRY" "$SW_TELEMETRY" "none prometheus so11y"
   ```

----------------------------------------------------------------
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 #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599068217
 
 
   - `${SW_CLUSTER}`
   - `${SW_STORAGE}`
   
   I read from this, https://github.com/apache/skywalking-docker/blob/master/6/6.6/oap/docker-entrypoint.sh

----------------------------------------------------------------
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 #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599065166
 
 
   Suggestion, in order to keep end user friendly, we should make `selector` optional, if there is only one provider found(this is the case for all existing users). 

----------------------------------------------------------------
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 #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599067942
 
 
   > If we keep the same selector name, helm chart doesn't need any change @innerpeacez Is that ok?
   
   I'd like to minimize the changes, what's the name in helm chart?
   

----------------------------------------------------------------
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 #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599063594
 
 
   I am OK with this, but I hope this could be done in 7.0.0 release as this is a break changes and effects most docker/image/k8s system. So we need to be very serious.

----------------------------------------------------------------
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 #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599077476
 
 
   @kezhenxu94 I think if we follow these 4 env variable names for selector, we are good to go.

----------------------------------------------------------------
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 #4511: [DISCUSSION] Optimize configurations `application.yml`

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4511: [DISCUSSION] Optimize configurations `application.yml`
URL: https://github.com/apache/skywalking/issues/4511#issuecomment-599074303
 
 
   @hanahmily @innerpeacez All these validateVariables are just system env, right? Nothing special.

----------------------------------------------------------------
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