-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Common Configuration
Eric Zhao edited this page Aug 16, 2023
·
4 revisions
Sentinel provides the following ways to configure the common items:
- JVM -D parameter
- properties file (since 1.7.0)
The project.name
item should be configured with JVM -D parameter, while other items support both approaches.
Users can configure the path of the properties file via the -Dcsp.sentinel.config.file
property item, which also supports files in classpath (such as classpath:sentinel.properties
). Sentinel will attempt to read the configuration from the classpath:sentinel.properties
file (the default charset is UTF-8).
Note: If you're using Spring Boot or Spring Cloud, you may leverage Spring Cloud Alibaba Sentinel to provide Sentinel configuration in your Spring config file directly.
Item | Description | Type | Default Value | Required | Notes |
---|---|---|---|---|---|
project.name |
The name of your microservice | String |
null |
no | It's recommended to provide the name. |
csp.sentinel.app.type |
The type of your microservice | int |
0 (APP_TYPE_COMMON ) |
no | introduced since 1.6.0 |
csp.sentinel.metric.file.single.size |
The max size of single metric log file | long |
52428800 (50MB) | no | |
csp.sentinel.metric.file.total.count |
The max amount of metric log files | int |
6 | no | |
csp.sentinel.metric.flush.interval |
Flush interval (second) of the metric log. Setting this to 0 means that the metric log task will be disabled. | int |
1 | no | introduced since 1.8.x |
csp.sentinel.spi.classloader |
The SPI classloader mechanism | String |
default |
no | If the value is context , then Sentinel will use the thread context classloader as the SPI classloader. |
Item | Description | Type | Default Value | Required | Notes |
---|---|---|---|---|---|
csp.sentinel.log.dir |
The log directory | String |
${user.home}/logs/csp/ |
no | introduced since 1.3.0 |
csp.sentinel.log.use.pid |
Whether the log files include the process ID | boolean |
false |
no | introduced since 1.3.0 |
csp.sentinel.log.output.type |
The output destination of the record logs (console for the terminal, file for the file) |
String |
file |
no | introduced since 1.6.2 |
-
文档
-
Documents
- Read Me
- Introduction
- How to Use
- How it Works
- Flow Control
- Parameter Flow Control
- Cluster Flow Control
- API Gateway Flow Control
- Circuit Breaking
- Adaptive System Protection
- Metrics
- General Configuration
- Dynamic Rule Configuration
- Dashboard
- Integrations with open-source frameworks
- Contribution Guideline