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

Autofill homePageUrl and statusPageUrl of an InstanceInfo in Eureka using path properties. #5465

Merged
merged 3 commits into from
Feb 19, 2024

Conversation

minwoox
Copy link
Member

@minwoox minwoox commented Feb 15, 2024

Motivation:
Following up on the improvements introduced in #5369, it's beneficial to extend the autofill feature to include homePageUrl and statusPageUrl of an InstanceInfo. This enhancement streamlines configuration by automatically populating these URLs based on corresponding path properties.

Modifications:

  • Introduce homePageUrlPath and statusPageUrlPath properties to InstanceInfo and their respective builders.
  • Implement autofill functionality for homePageUrl and statusPageUrl using the configured path properties.

Result:

…reka using path properties.

Motivation:
Following up on the improvements introduced in line#5369,
it's beneficial to extend the autofill feature to include `homePageUrl` and `statusPageUrl` of an `InstanceInfo`.
This enhancement streamlines configuration by automatically populating these URLs based on corresponding path properties.

Modifications:
- Introduce `homePageUrlPath` and `statusPageUrlPath` properties to `InstanceInfo` and their respective builders.
- Implement autofill functionality for `homePageUrl` and `statusPageUrl` using the configured path properties.

Result:
- `homePageUrl` and `statusPageUrl` of an `InstanceInfo` in Eureka are correctly set if corresponding path properties are configured.
- Close line#5464
@minwoox minwoox added the defect label Feb 15, 2024
@minwoox minwoox added this to the 1.27.2 milestone Feb 15, 2024
@minwoox
Copy link
Member Author

minwoox commented Feb 15, 2024

@codefromthecrypt Could you check this, please? 😉

@codefromthecrypt
Copy link
Contributor

cool this afternoon I will integration test this and let you know!

@CsvSource({
"'',/,'',/,'',/",
"custom-health,/custom-health,home-page,/home-page,status-page,/status-page",
"/custom-health,/custom-health,/home-page,/home-page,/status-page,/status-page",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@codefromthecrypt
Copy link
Contributor

🚢

diff --git a/pom.xml b/pom.xml
index 3560f8dbc..01f4ed50e 100755
--- a/pom.xml
+++ b/pom.xml
@@ -57,7 +57,7 @@
 
     <!-- This allows you to test feature branches with jitpack -->
     <armeria.groupId>com.linecorp.armeria</armeria.groupId>
-    <armeria.version>1.27.1</armeria.version>
+    <armeria.version>1.27.2-SNAPSHOT</armeria.version>
     <!-- Match Armeria version to avoid conflicts including running tests in the IDE -->
     <netty.version>4.1.106.Final</netty.version>
 
diff --git a/zipkin-server/src/main/java/zipkin2/server/internal/eureka/ZipkinEurekaDiscoveryProperties.java b/zipkin-server/src/main/java/zipkin2/server/internal/eureka/ZipkinEurekaDiscoveryProperties.java
index b783dfbe5..8513a5cd6 100644
--- a/zipkin-server/src/main/java/zipkin2/server/internal/eureka/ZipkinEurekaDiscoveryProperties.java
+++ b/zipkin-server/src/main/java/zipkin2/server/internal/eureka/ZipkinEurekaDiscoveryProperties.java
@@ -106,7 +106,8 @@ class ZipkinEurekaDiscoveryProperties implements Serializable { // for Spark job
 
   EurekaUpdatingListenerBuilder toBuilder() {
     EurekaUpdatingListenerBuilder result = EurekaUpdatingListener.builder(serviceUrl)
-      .healthCheckUrlPath("/health");
+      .healthCheckUrlPath("/health")
+      .statusPageUrlPath("/info");
     if (auth != null) result.auth(auth);
     if (appName != null) result.appName(appName);
     if (instanceId != null) result.instanceId(instanceId);

Screenshot 2024-02-15 at 16 59 13

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

👍👍

@@ -36,7 +36,8 @@
/**
* An instance information.
*/
@JsonIgnoreProperties(value = { "healthCheckUrlPath" }, ignoreUnknown = true)
@JsonIgnoreProperties(
value = { "homePageUrlPath", "statusPageUrlPath", "healthCheckUrlPath" }, ignoreUnknown = true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional) @JsonIgnore would be more maintainable to exclude some fields from serialization.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I forgot about it. 😉

})
void customHealthCheckPath(String healthCheckUrlPath, String expectedHealthCheckUrlPath)
void customHealthCheckPath(String healthCheckUrlPath, String expectedHealthCheckUrlPath,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
void customHealthCheckPath(String healthCheckUrlPath, String expectedHealthCheckUrlPath,
void customPaths(String healthCheckUrlPath, String expectedHealthCheckUrlPath,

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, thanks!

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks @minwoox 🙇 👍 🙇

hostnameOrIpAddr(hostnameOrIpAddr) + ':' + portWrapper.getPort();
}

private static String concatPath(String baseURL, String oldHealthCheckUrlPath) {
Copy link
Contributor

Choose a reason for hiding this comment

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

style nit; since the method isn't specific to healthcheck

Suggested change
private static String concatPath(String baseURL, String oldHealthCheckUrlPath) {
private static String concatPath(String baseURL, String urlPath) {

Copy link
Member Author

Choose a reason for hiding this comment

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

That's correct. Thanks!

@jrhee17 jrhee17 merged commit 0efc776 into line:main Feb 19, 2024
16 checks passed
@minwoox minwoox deleted the statusPageUrl branch February 19, 2024 02:47
@codefromthecrypt
Copy link
Contributor

do you have an ETA for 1.28? I would like to release this fix and there isn't any clean way to work around it without the new code..

@codefromthecrypt
Copy link
Contributor

actually we could consider this 1.27.2 maybe if nothing else is merged

@minwoox
Copy link
Member Author

minwoox commented Feb 21, 2024

We will release 1.27.2 this week. 😉
The release will contain some other bug fixes and I believe they will not affect to Zipkin.
https://github.com/line/armeria/milestone/227

jrhee17 pushed a commit to jrhee17/armeria that referenced this pull request Mar 4, 2024
…reka using path properties. (line#5465)

Motivation:
Following up on the improvements introduced in
line#5369, it's beneficial to extend the
autofill feature to include `homePageUrl` and `statusPageUrl` of an
`InstanceInfo`. This enhancement streamlines configuration by
automatically populating these URLs based on corresponding path
properties.

Modifications:
- Introduce `homePageUrlPath` and `statusPageUrlPath` properties to
`InstanceInfo` and their respective builders.
- Implement autofill functionality for `homePageUrl` and `statusPageUrl`
using the configured path properties.

Result:
- `homePageUrl` and `statusPageUrl` of an `InstanceInfo` in Eureka are
correctly set if corresponding path properties are configured.
- Close line#5464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add homePageUrlPath, statusPageUrlPath to EurekaUpdatingListenerBuilder
4 participants