-
Notifications
You must be signed in to change notification settings - Fork 44
[issue-464]Create a Prometheus ServiceMonitor object that can capture/collect metrics from deployed SonataFlow instances #540
Conversation
ricardozanini
left a comment
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.
Thanks @jianrongzhang89! I left a few comments, but I believe we are on the right path.
b8091fc to
18b1063
Compare
|
Please add conditionals when registering the listeners in the controller: |
|
The e2e tests have been fixed, please rebase your branch 🙏 |
d1438cc to
a0edf9d
Compare
Done! |
Code has been rebased. |
|
Can you check the files generation? 😬 |
bundle/manifests/sonataflow.org_sonataflowclusterplatforms.yaml
Outdated
Show resolved
Hide resolved
6231535 to
038527b
Compare
|
@jianrongzhang89 can you please rebase? Your Knative fix has been merged with the e2e refactoring. |
5d12fc2 to
0eb16ee
Compare
ricardozanini
left a comment
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 will stop reviewing since we will rescope this feature.
59f71df to
86a5975
Compare
ricardozanini
left a comment
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.
Also, I think we can have a rather simple test for monitoring in the e2e. Do we really need all the supporting services and persistence?
ab5b575 to
506d9f1
Compare
a4d77e9 to
309827a
Compare
test/e2e/testdata/workflows/prometheus/k8s_deployment/02-sonataflow_greeting.yaml
Outdated
Show resolved
Hide resolved
309827a to
5ce5c92
Compare
wmedvede
left a comment
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.
Some minor comments from my side.
I'll give it a try.
test/e2e/testdata/workflows/prometheus/k8s_deployment/01-sonataflow_platform.yaml
Outdated
Show resolved
Hide resolved
test/e2e/testdata/workflows/prometheus/k8s_deployment/02-sonataflow_greetings.yaml
Outdated
Show resolved
Hide resolved
test/e2e/testdata/workflows/prometheus/k8s_deployment/kustomization.yaml
Outdated
Show resolved
Hide resolved
5ce5c92 to
0a24d5c
Compare
|
@ricardozanini @jianrongzhang89 My last comment on this PR guys. case1: In customer OpenShfift cluster installations different thant OpenShift Local installations IDK what will happen. Probably the operator is always there. case2: I create a namespace test2, I don't install the Prometheus operator in that namespace. Sort of corolary o case1 |
wmedvede
left a comment
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.
left a last comment
|
@wmedvede I think we can safely create the monitor always if the My only take is that we should report in events that monitoring: true and Prometheus is not available. This must be done in this PR. @jianrongzhang89 can you confirm? |
@ricardozanini yes, in this case, a message will be logged in the platform log: |
|
@jianrongzhang89 Can you change to an event instead too? |
0a24d5c to
a7769e9
Compare
Done |
fe75da8 to
215631d
Compare
…e/collect metrics from deployed SonataFlow instances
215631d to
74d5d88
Compare
…e/collect metrics from deployed SonataFlow instances (apache#540)
Fix #464.
The operator an track in the cluster if Prometheus Operator is installed. If this condition is true and the SonataFlowPlatform is marked with .spec.monitoring.enabled: true, and the workflow is deployed as an k8s deployment, then each workflow can have a ServiceMonitor object bound to it.
Note: for workflows deployed as Knative services, this PR does not create the ServiceMonitor objects.
Checklist
[X ] Add or Modify a unit test for your change
[X ] Have you verified that tall the tests are passing?