apache / incubator-kie-kogito-serverless-operator

Kubernetes operator for SonataFlow
Apache License 2.0
16 stars 41 forks source link

Create a Prometheus `ServiceMonitor` object that can capture/collect metrics from deployed `SonataFlow` instances #464

Open ricardozanini opened 5 months ago

ricardozanini commented 5 months ago

Description

The operator can track in the cluster if Prometheus Operator is installed. If this condition is true and the SonataFlowPlatform is marked with .spec.monitoring: true, then each workflow instance can have a ServiceMonitor object bound to it.

Implementation ideas

Each SonataFlow already exposes a Service. Hence, in this issue, it's expected that each ServiceMonitor instance binds to it.

Verify with kogito-runtimes the endpoints to scrap for metrics (should be /metrics).

Prereqs

jianrongzhang89 commented 6 days ago

We decided to modify the scope for this issue so that the operator only creates a service monitor for workflows deployed as k8s deployments. A separate issue has been created to track the work for workflows deployed as Knative services: https://github.com/apache/incubator-kie-kogito-serverless-operator/issues/550