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
[#9177] add metrics server to go function #9318
[#9177] add metrics server to go function #9318
Conversation
@@ -119,7 +119,8 @@ | |||
public static List<String> getGoInstanceCmd(InstanceConfig instanceConfig, | |||
String originalCodeFileName, | |||
String pulsarServiceUrl, | |||
boolean k8sRuntime) throws IOException { | |||
boolean k8sRuntime, | |||
int metricsPort) throws IOException { |
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 not introduce the new configuration in the InstanceConfig
?
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 havnt add metricsPort
to InstanceConfig
is because metricsPort
is generated with different mechanisms for different runtime, such as for process runtime, metricsPort
is generated by FunctionCommon.findAvailablePort()
but for k8s runtime, metricsPort
comes from the config functions_worker.yml
.
Also, for java and python function, metricsPort
is also not included in InstanceConfig
(ref:
pulsar/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java
Line 249 in 7c68ade
int metricsPort, |
I did seem a bit lazy with these changes here, but also want to avoid making changes to java and python runtime's code. So let me know if we want apply metricsPort
into InstanceConfig
.
cd65b4c
to
2676bd5
Compare
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
2676bd5
to
f1a7572
Compare
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
f1a7572
to
33b7258
Compare
@wolfstudy thanks for review. I will go for @zymap and your advice. But this will affect java and python's code, should I put |
Yes, make sense to me. Let's get merge this PR. |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
33b7258
to
a7f52b5
Compare
/pulsarbot run-failure-checks |
### Motivation #9318 add metrics server to go function, but didnt serve `"/"` endpoint in metrics server, which will cause some metrics calls failed. ### Modifications add handler for `"/"` in `MetricsServicer` ### Verifying this change - [x] Make sure that the change passes the CI checks.
### Motivation #9318 add metrics server to go function, but didnt serve `"/"` endpoint in metrics server, which will cause some metrics calls failed. ### Modifications add handler for `"/"` in `MetricsServicer` ### Verifying this change - [x] Make sure that the change passes the CI checks.
Fixes #9177 go function added metrics collector by #6105, but havnt pass `metricsPort` to go function, also not init & start prometheus http server. As the result, function worker will keep trying to access to the metrics port to collect data, which will cause massive log errors in log history. - expose `metricsPort` to go function - add prometheus http server to go function - [x] Make sure that the change passes the CI checks. (cherry picked from commit 211a125)
### Motivation #9318 add metrics server to go function, but didnt serve `"/"` endpoint in metrics server, which will cause some metrics calls failed. ### Modifications add handler for `"/"` in `MetricsServicer` ### Verifying this change - [x] Make sure that the change passes the CI checks. (cherry picked from commit c99e1a0)
Master Issue: #9177 ### Motivation As discussed in #9318, both @zymap and @wolfstudy suggested, to add `metricsPort` as a field of `InstanceConfig`. ### Modifications - add metricsPort to InstanceConfig - add hasValidMetricsPort to InstanceConfig to check if metrics port is valid - applied changes to k8s runtime & process runtime
@freeznet Thank you for fixing this issue! |
Master Issue: apache#9177 As discussed in apache#9318, both @zymap and @wolfstudy suggested, to add `metricsPort` as a field of `InstanceConfig`. - add metricsPort to InstanceConfig - add hasValidMetricsPort to InstanceConfig to check if metrics port is valid - applied changes to k8s runtime & process runtime
Fixes #9177
Motivation
go function added metrics collector by #6105, but havnt pass
metricsPort
to go function, also not init & start prometheus http server. As the result, function worker will keep trying to access to the metrics port to collect data, which will cause massive log errors in log history.Modifications
metricsPort
to go functionVerifying this change