Skip to content
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

Open
wants to merge 9 commits into
base: 2.x
Choose a base branch
from

Conversation

l81893521
Copy link
Contributor

@l81893521 l81893521 commented Nov 7, 2023

  • I have registered the PR changes.
    Support Spring boot actuator(Only support check database connection yet)

Check Url: http://localhost:7091/actuator/health
image

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

@@ -24,6 +24,7 @@
/**
* @author spilledyear@outlook.com
*/
@Deprecated
Copy link
Contributor

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?

Copy link
Contributor Author

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'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #6006 (6070ca4) into 2.x (7894473) will increase coverage by 0.07%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@             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     
Files Coverage Δ
...a/io/seata/server/controller/HealthController.java 50.00% <ø> (ø)
...o/seata/server/health/DataBaseHealthIndicator.java 0.00% <0.00%> (ø)

... and 8 files with indirect coverage changes

Copy link
Contributor

@funky-eyes funky-eyes left a 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

@funky-eyes funky-eyes added this to the 2.x Backlog milestone Nov 11, 2023
@l81893521
Copy link
Contributor Author

application.raft.example.yml should also be supplemented

fixed

funky-eyes
funky-eyes previously approved these changes Nov 13, 2023
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@funky-eyes funky-eyes added the module/server server module label Nov 13, 2023
@funky-eyes funky-eyes modified the milestones: 2.x Backlog, 2.1.0 Nov 27, 2023
@@ -35,6 +36,7 @@ public class HealthController {
private ServerRunner serverRunner;


@Deprecated
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connection and datasource leaks.

Copy link
Contributor Author

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();
Copy link
Member

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?

Copy link
Contributor Author

@l81893521 l81893521 Jan 19, 2024

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

@l81893521 l81893521 force-pushed the feature_support_spring_acturator_2.x branch from 94a16dd to 78cdd32 Compare January 19, 2024 16:40
@slievrly slievrly removed this from the 2.1.0 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/server server module
Projects
None yet
3 participants