-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: support spring boot actuator #6006
base: 2.x
Are you sure you want to change the base?
feature: support spring boot actuator #6006
Conversation
server/src/main/java/io/seata/server/health/DataBaseHealthIndicator.java
Show resolved
Hide resolved
@@ -24,6 +24,7 @@ | |||
/** | |||
* @author spilledyear@outlook.com | |||
*/ | |||
@Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it marked as deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the health check url change to 'http://127.0.0.1:7091/actuator/health'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 2.x #6006 +/- ##
============================================
+ Coverage 49.55% 49.62% +0.07%
- Complexity 4759 4773 +14
============================================
Files 908 909 +1
Lines 31362 31377 +15
Branches 3778 3779 +1
============================================
+ Hits 15540 15571 +31
+ Misses 14285 14276 -9
+ Partials 1537 1530 -7
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
application.raft.example.yml should also be supplemented
fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -35,6 +36,7 @@ public class HealthController { | |||
private ServerRunner serverRunner; | |||
|
|||
|
|||
@Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个后面要考虑http的优雅下线问题,就是有没有接口能知道我们正在下线。目前你把自定义的健康检查接口废弃了
This is going to be followed by a consideration of http's graceful downtime, that is, whether there is an interface that can tell that we are going offline. Currently you deprecate the custom health check interface
changes/zh-cn/2.0.0.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
登记到2.x.md中
Registration to 2.x.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
return Health.status(isConnectionValid ? Status.UP : Status.DOWN) | ||
.withDetail("database", getDatabaseProductName(connection)) | ||
.withDetail("datasourceType", datasourceType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connection and datasource leaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The datasource is singleton.
@Override | ||
public Health health() { | ||
String datasourceType = CONFIG.getConfig(ConfigurationKeys.STORE_DB_DATASOURCE_TYPE); | ||
DataSource logStoreDataSource = EnhancedServiceLoader.load(DataSourceProvider.class, datasourceType).provide(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why create a new connection pool, which creates a lot of connection waste?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already check the EnhancedServiceLoader and it is singleton
94a16dd
to
78cdd32
Compare
Support Spring boot actuator(Only support check database connection yet)
Check Url: http://localhost:7091/actuator/health
Ⅱ. Does this pull request fix one issue?
fixes #4671
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews