You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "platinumhamburg (via GitHub)" <gi...@apache.org> on 2026/09/03 07:27:35 UTC

[PR] [gateway] Add Prometheus identity labels [fluss]

platinumhamburg opened a new pull request, #4219:
URL: https://github.com/apache/fluss/pull/4219

   <!--
   *Thank you very much for contributing to Fluss - we are happy that you want to help us improve Fluss. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GitHub issue](https://github.com/apache/fluss/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no issue.
   
     - Name the pull request in the format "[component] Title of the pull request", where *[component]* should be replaced by the name of the component being changed. Typically, this corresponds to the component label assigned to the issue (e.g., [kv], [log], [client], [flink], [rust], [python], [c++], [elixir]). Skip *[component]* if you are unsure about which is the best component.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
   
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes.
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
   
     - **Generative AI disclosure:** Indicate whether generative AI tools were used in authoring this PR. If yes, specify the tool below.
       - [ ] No generative AI tools used
       - [ ] Yes (please specify the tool below)
   
   **(The sections below can be removed for hotfixes or typos)**
   -->
   
   <!--
   Generated-by: [Tool Name and Version] following [the guidelines](https://github.com/apache/fluss/blob/main/AGENTS.md)
   -->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   Linked issue: close #4217
   
   <!-- What is the purpose of the change -->
   
   ### Brief change log
   
   <!-- Please describe the changes made in this pull request and explain how they address the issue -->
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [gateway] Add Prometheus identity labels [fluss]

Posted by "platinumhamburg (via GitHub)" <gi...@apache.org>.
platinumhamburg merged PR #4219:
URL: https://github.com/apache/fluss/pull/4219


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [gateway] Add Prometheus identity labels [fluss]

Posted by "platinumhamburg (via GitHub)" <gi...@apache.org>.
platinumhamburg commented on PR #4219:
URL: https://github.com/apache/fluss/pull/4219#issuecomment-5533805113

   After further discussion, I added host back to provide the Gateway’s network-addressing identity in metrics. This complements the logical and instance identities and aligns with the metric label design used by Fluss servers.


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [gateway] Add Prometheus identity labels [fluss]

Posted by "beryllw (via GitHub)" <gi...@apache.org>.
beryllw commented on code in PR #4219:
URL: https://github.com/apache/fluss/pull/4219#discussion_r3923970740


##########
fluss-gateway/src/config.rs:
##########
@@ -1087,6 +1094,18 @@ impl GatewayConfig {
                 ));
             }
         }
+        for (key, value) in [
+            (GATEWAY_ID_KEY, server.gateway_id.as_deref()),
+            (HOST_KEY, server.host.as_deref()),
+        ] {
+            if value.is_some_and(|value| {
+                value.is_empty() || value.len() > 253 || value.chars().any(char::is_control)

Review Comment:
   Should we reject whitespace-only values here? Currently values such as `"   " `pass validation and produce meaningless `gateway_id` or `host` labels. Would `value.trim().is_empty()` be more appropriate?



-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [gateway] Add Prometheus identity labels [fluss]

Posted by "platinumhamburg (via GitHub)" <gi...@apache.org>.
platinumhamburg commented on PR #4219:
URL: https://github.com/apache/fluss/pull/4219#issuecomment-5526025420

   > Could we add an integration test that starts the Gateway with `gateway.id` and `gateway.host`, then verifies the labels from the actual `/metrics` endpoint? It would cover the configuration, lifecycle, and exporter wiring together.
   
   Added an end-to-end HTTP test that starts the Gateway with gateway.id and gateway.instance-id, fetches the actual /metrics endpoint, and verifies the gateway_id and instance_id labels. The existing configuration tests continue to cover YAML and environment-variable loading.


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [gateway] Add Prometheus identity labels [fluss]

Posted by "platinumhamburg (via GitHub)" <gi...@apache.org>.
platinumhamburg commented on PR #4219:
URL: https://github.com/apache/fluss/pull/4219#issuecomment-5526014001

   > My main question is about the Gateway identity model. We now have:
   > 
   > * `gateway.id`: logical Gateway deployment
   > * `gateway.instance-id`: individual Gateway instance used for diagnostics
   > * `gateway.host`: host or network location
   > 
   > Is `gateway.host` expected to uniquely identify each Gateway replica? If it only represents location, multiple replicas may share the same value. In that case, could we expose the existing `gateway.instance-id` as the per-replica metric label instead?
   
   Good point. I removed gateway.host and reused the existing gateway.instance-id as the per-replica identity. It is now exposed as the instance_id metric label, while gateway.id remains the identity shared by one logical Gateway deployment. This avoids introducing two overlapping per-replica identity configurations.


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [gateway] Add Prometheus identity labels [fluss]

Posted by "platinumhamburg (via GitHub)" <gi...@apache.org>.
platinumhamburg commented on code in PR #4219:
URL: https://github.com/apache/fluss/pull/4219#discussion_r3924685771


##########
fluss-gateway/src/config.rs:
##########
@@ -1087,6 +1094,18 @@ impl GatewayConfig {
                 ));
             }
         }
+        for (key, value) in [
+            (GATEWAY_ID_KEY, server.gateway_id.as_deref()),
+            (HOST_KEY, server.host.as_deref()),
+        ] {
+            if value.is_some_and(|value| {
+                value.is_empty() || value.len() > 253 || value.chars().any(char::is_control)

Review Comment:
   Added an end-to-end HTTP test that starts the Gateway with gateway.id and gateway.instance-id, fetches the actual /metrics endpoint, and verifies the gateway_id and instance_id labels. The existing configuration tests continue to cover YAML and environment-variable loading.



-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [gateway] Add Prometheus identity labels [fluss]

Posted by "platinumhamburg (via GitHub)" <gi...@apache.org>.
platinumhamburg commented on code in PR #4219:
URL: https://github.com/apache/fluss/pull/4219#discussion_r3924685771


##########
fluss-gateway/src/config.rs:
##########
@@ -1087,6 +1094,18 @@ impl GatewayConfig {
                 ));
             }
         }
+        for (key, value) in [
+            (GATEWAY_ID_KEY, server.gateway_id.as_deref()),
+            (HOST_KEY, server.host.as_deref()),
+        ] {
+            if value.is_some_and(|value| {
+                value.is_empty() || value.len() > 253 || value.chars().any(char::is_control)

Review Comment:
   Addressed. gateway.id now rejects whitespace-only values using trim().is_empty(). gateway.host has been removed as part of the identity model simplification.



-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org