Cyanty opened a new issue, #3230:
URL: https://github.com/apache/hertzbeat/issues/3230
### Question
### **Incorrect YML Configuration in Spring Boot 2.0/3.0 Monitoring
Documentation**
------
#### **Problem Description**
In the Spring Boot 2.0/3.0 monitoring documentation, the YML configuration
example uses `enabled-by-default: on` for the
`management.endpoints.enabled-by-default` property. However, according to the
official Spring Boot documentation and parameter specifications, **this value
is incorrect**.
------
#### **Key Issues**
1. **Type Mismatch**
- Parameter Definition
```json
{
"name": "management.endpoints.enabled-by-default",
"type": "java.lang.Boolean",
"description": "Whether to enable or disable all endpoints by
default."
}
```
The `enabled-by-default` property explicitly requires a **boolean
value** (`true`/`false`), not a string like `on`.
2. **Default Value Clarification**
- By default, all endpoints (except `shutdown`) are enabled
(`enabled-by-default: true`) in Spring Boot 2.x. Using `on` might be parsed as
`true` in some contexts, but this is **not standardized** and can lead to
confusion.
3. **Best Practice**
- To ensure clarity and compatibility, the documentation should use the
correct boolean syntax:
```yaml
management:
endpoints:
enabled-by-default: true # ✅ Correct
```
------
#### **Impact of the Error**
- **Functional Impact**: While `on` might work in some environments (due to
Spring Boot's lenient property binding), it is **not officially supported** and
could cause unexpected behavior in strict YAML parsers or future versions.
- **Developer Experience**: Incorrect documentation may mislead users,
especially those new to Spring Boot, resulting in configuration errors during
production setup.
--
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.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]