You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "jianrongzhang89 (via GitHub)" <gi...@apache.org> on 2024/12/10 09:30:41 UTC
[PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
jianrongzhang89 opened a new pull request, #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693
Closes/Fixes/Resolves
https://github.com/apache/incubator-kie-kogito-serverless-operator/issues/465
<!-- Please provide a short description of what this PR does -->
Update the document to include Prometheus and Grafana installation, and Grafana Data Source congfiguration and import the default dashboard.
- [X ] You have read the [contributions doc](https://github.com/apache/incubator-kie-kogito-docs/blob/main/CONTRIBUTING.md)
- [X ] Pull Request title is properly formatted: `Issue-XYZ Subject`
- [X] Pull Request title contains the target branch if not targeting main: `[0.9.x] Issue-XYZ Subject`
- [ ] The nav.adoc file has a link to this guide in the proper category
- [] The index.adoc file has a card to this guide in the proper category, with a meaningful description
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#issuecomment-2535446947
🎊 PR Preview ea1866dbe87d6aece98047a511d017d19a2fb0cb has been successfully built and deployed. See the documentation preview: https://sonataflow-docs-preview-pr-693.surge.sh
<!-- Sticky Pull Request Comment -->
<!-- Sticky Pull Request Comment -->
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1880950026
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/monitoring-workflows.adoc:
##########
@@ -0,0 +1,332 @@
+= Monitoring Workflows
+:compat-mode!:
+// Metadata:
+:description: Workflows monitoring configuration configuration
+:keywords: kogito, sonataflow, workflow, operator, kubernetes, prometheus, grafana
+
+// External pages
+:openshift_enable_monitoring_user_defined_projects_url: https://docs.openshift.com/container-platform/4.17/observability/monitoring/enabling-monitoring-for-user-defined-projects.html
+
+:dev_services_url: https://quarkus.io/guides/dev-services
+:test_containers_url: https://www.testcontainers.org/
+
+This document describes how to deploy and configure Prometheus and Grafana components for monitoring of {product_name} workflows.
+
+[IMPORTANT]
+====
+Currently, only those {product_name} workflows deployed as Kubernetes deployments have workflow related metrics exposed to Prometheus and are hence available for monitoring by Grafana Dashboards. Monitoring of {product_name} workflows deployed as Knative services is not supported and such serverless workflows are not included in the Grafana Dashboards.
+====
+
+[#deploy-monitoring]
+== Deploy Prometheus and Grafana
+=== Deploy Prometheus and Grafana on OpenShift Container Platform
+==== Deploy Prometheus
+OpenShift Container Platform includes a preconfigured, preinstalled, and self-updating monitoring stack that provides monitoring for core platform components. As such the Prometheus Operator is already installed on the cluster. To monitor SonataFlow workflows, you shall enable monitoring for user-defined projects. This is achieved by updating `cluster-monitoring-config` ConfigMap in the openshift-monitoring namespace. Create a new one if the ConfigMap does not exist.
+[source, yaml]
+----
+cat << EOF | oc apply -f -
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: cluster-monitoring-config
+ namespace: openshift-monitoring
+data:
+ config.yaml: |
+ enableUserWorkload: true
+EOF
+----
+A new Prometheus server pod will be started and running in the namespace `openshift-user-workload-monitoring`.
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+Create a namespace for the Grafana Operator to be installed in
+[source,shell,subs="attributes+"]
+----
+oc new-project grafana-operator
+----
+Deploy the Grafana Operator using command line. You can also deploy the operator through OperatorHub.
+[source,shell,subs="attributes+"]
+----
+cat << EOF | oc create -f -
+apiVersion: operators.coreos.com/v1
+kind: OperatorGroup
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ targetNamespaces:
+ - grafana-operator
+---
+apiVersion: operators.coreos.com/v1alpha1
+kind: Subscription
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ channel: v5
+ name: grafana-operator
+ installPlanApproval: Automatic
+ source: community-operators
+ sourceNamespace: openshift-marketplace
+EOF
+----
+Wait for the Operator to be ready
+[source,shell,subs="attributes+"]
+----
+oc -n grafana-operator rollout status \
+ deployment grafana-operator-controller-manager-v5
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Give the Grafana service account the cluster-monitoring-view role
+[source, yaml]
+----
+oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-sa
+----
+===== Generate a bearer token for the grafana service account
+[source, yaml]
+----
+TOKEN=`oc sa new-token grafana-sa`
+----
+===== Deploy the Prometheus Data Source
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ isDefault: true
+ type: prometheus
+ jsonData:
+ httpHeaderName1: 'Authorization'
+ timeInterval: 5s
+ tlsSkipVerify: true
+ secureJsonData:
+ httpHeaderValue1: 'Bearer ${TOKEN}'
+ name: Prometheus
+ url: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
Review Comment:
That's correct: the metrics are exposed to Prometheus but are not available in Grafana.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#issuecomment-2533143158
@jianrongzhang89 can you please take a look on CI?
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1882756570
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
Review Comment:
Good suggestion. Done!
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#issuecomment-2535447065
> @jianrongzhang89 can you please take a look on CI?
@ricardozanini fixed CI errors.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini merged PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1880946772
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/monitoring-workflows.adoc:
##########
@@ -0,0 +1,332 @@
+= Monitoring Workflows
+:compat-mode!:
+// Metadata:
+:description: Workflows monitoring configuration configuration
+:keywords: kogito, sonataflow, workflow, operator, kubernetes, prometheus, grafana
+
+// External pages
+:openshift_enable_monitoring_user_defined_projects_url: https://docs.openshift.com/container-platform/4.17/observability/monitoring/enabling-monitoring-for-user-defined-projects.html
+
+:dev_services_url: https://quarkus.io/guides/dev-services
+:test_containers_url: https://www.testcontainers.org/
+
+This document describes how to deploy and configure Prometheus and Grafana components for monitoring of {product_name} workflows.
+
+[IMPORTANT]
+====
+Currently, only those {product_name} workflows deployed as Kubernetes deployments have workflow related metrics exposed to Prometheus and are hence available for monitoring by Grafana Dashboards. Monitoring of {product_name} workflows deployed as Knative services is not supported and such serverless workflows are not included in the Grafana Dashboards.
+====
+
+[#deploy-monitoring]
+== Deploy Prometheus and Grafana
+=== Deploy Prometheus and Grafana on OpenShift Container Platform
+==== Deploy Prometheus
+OpenShift Container Platform includes a preconfigured, preinstalled, and self-updating monitoring stack that provides monitoring for core platform components. As such the Prometheus Operator is already installed on the cluster. To monitor SonataFlow workflows, you shall enable monitoring for user-defined projects. This is achieved by updating `cluster-monitoring-config` ConfigMap in the openshift-monitoring namespace. Create a new one if the ConfigMap does not exist.
+[source, yaml]
+----
+cat << EOF | oc apply -f -
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: cluster-monitoring-config
+ namespace: openshift-monitoring
+data:
+ config.yaml: |
+ enableUserWorkload: true
+EOF
+----
+A new Prometheus server pod will be started and running in the namespace `openshift-user-workload-monitoring`.
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+Create a namespace for the Grafana Operator to be installed in
+[source,shell,subs="attributes+"]
+----
+oc new-project grafana-operator
+----
+Deploy the Grafana Operator using command line. You can also deploy the operator through OperatorHub.
+[source,shell,subs="attributes+"]
+----
+cat << EOF | oc create -f -
+apiVersion: operators.coreos.com/v1
+kind: OperatorGroup
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ targetNamespaces:
+ - grafana-operator
+---
+apiVersion: operators.coreos.com/v1alpha1
+kind: Subscription
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ channel: v5
+ name: grafana-operator
+ installPlanApproval: Automatic
+ source: community-operators
+ sourceNamespace: openshift-marketplace
+EOF
+----
+Wait for the Operator to be ready
+[source,shell,subs="attributes+"]
+----
+oc -n grafana-operator rollout status \
+ deployment grafana-operator-controller-manager-v5
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Give the Grafana service account the cluster-monitoring-view role
+[source, yaml]
+----
+oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-sa
+----
+===== Generate a bearer token for the grafana service account
+[source, yaml]
+----
+TOKEN=`oc sa new-token grafana-sa`
+----
+===== Deploy the Prometheus Data Source
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ isDefault: true
+ type: prometheus
+ jsonData:
+ httpHeaderName1: 'Authorization'
+ timeInterval: 5s
+ tlsSkipVerify: true
+ secureJsonData:
+ httpHeaderValue1: 'Bearer ${TOKEN}'
+ name: Prometheus
+ url: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
+ instanceSelector:
+ matchLabels:
+ dashboards: grafana
+EOF
+----
+Wait until the Grafana server is ready.
+[source,shell,subs="attributes+"]
+----
+oc wait --for=condition=Available=True deployment/grafana-deployment
+----
+===== Create a route for Grafana service
+[source,shell,subs="attributes+"]
+----
+oc expose service grafana-service
+----
+===== Get the URL for Grafana
+[source,shell,subs="attributes+"]
+----
+oc get route grafana-service -o jsonpath='{"http://"}{.spec.host}{"\n"}'
+----
+===== Open Grafana Dashboard UI
+Open Grafana Dashboard UI in your web browser with the URL found. Log in using with admin user name `root` and passward `secret`.
+
+=== Deploy Prometheus and Grafana on Kubernetes
+==== Deploy Prometheus
+===== Deploy Prometheus Operator
+:attribute: prometheus_version
+[source,shell,subs="attributes+"]
+----
+PROMETHEUS_VERSION=v0.70.0
+kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/$\{PROMETHEUS_VERSION}/bundle.yaml -n default
+----
+Wait until the operator is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deploy/prometheus-operator -n default
+----
+===== Deploy Prometheus Instance
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: monitoring.coreos.com/v1
+kind: Prometheus
+metadata:
+ name: prometheus
+spec:
+ serviceAccountName: prometheus
+ serviceMonitorNamespaceSelector: {}
+ serviceMonitorSelector: {}
+ podMonitorSelector: {}
+ resources:
+ requests:
+ memory: 400Mi
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: prometheus
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: prometheus
+rules:
+- apiGroups: [""]
+ resources:
+ - nodes
+ - nodes/metrics
+ - services
+ - endpoints
+ - pods
+ verbs: ["get", "list", "watch"]
+- apiGroups: [""]
+ resources:
+ - configmaps
+ verbs: ["get"]
+- apiGroups:
+ - networking.k8s.io
+ resources:
+ - ingresses
+ verbs: ["get", "list", "watch"]
+- nonResourceURLs: ["/metrics"]
+ verbs: ["get"]
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: prometheus
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: prometheus
+subjects:
+- kind: ServiceAccount
+ name: prometheus
+ namespace: default
+EOF
+----
+Wait until the Prometheus server is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl apply -f ./test/testdata/prometheus.yaml -n default
+kubectl wait --for=condition=Available=True prometheus/prometheus -n default
+----
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+:attribute: grafana_version
+[source,shell,subs="attributes+"]
+----
+GRAFANA_VERSION=v5.13.0
+kubectl create -f https://github.com/grafana/grafana-operator/releases/download/$\{GRAFANA_VERSION}/kustomize-cluster_scoped.yaml
+----
+Wait until Grafana Operator is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deploy/grafana-operator-controller-manager -n grafana
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Create a Grafana Datasource for Prometheus
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ type: prometheus
+ jsonData:
+ timeInterval: 5s
+ tlsSkipVerify: true
+ name: Prometheus
+ url: http://prometheus-operated.default.svc.cluster.local:9090
+ instanceSelector:
+ matchLabels:
+ dashboards: grafana
+EOF
+----
+
+Wait until the Grafana server is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deployment/grafana-deployment -n default
+----
+
+===== Open Grafana Dashboard UI
+Now you can forward local port number `3000` to the Grafana service.
+[source,shell,subs="attributes+"]
+----
+kubectl port-forward svc/grafana-service -n default 3000:3000
+----
+Open Grafana Dashboard UI in your web browser with the URL `http://localhost:30000`. Log in using with admin user name `root` and passward `secret`.
+
+[#workflow-monitoring]
+== Workflows Monitoring
+=== Enable monitoring in `SonataFlowPlatform` CR
+When `SonataFlowPlatform` CR has `spec.monitoring.enabled` set, and Prometheus has been deployed in the cluster, {operator_name} will automatically create a service monitor for each workflow that is deployed as a Kubernetes Deployment object. The service monitor allows Prometheus to scrape the workflow related metrics from the workflow pod.
+[source, yaml]
+----
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlowPlatform
+metadata:
+ name: sonataflow-platform
+spec:
+ monitoring:
+ enabled: true
+----
+=== Test Data Source Connection
+In the Grafana UI, click `Connections` -> `Data sources`, and open the data source. Then click `Save & test` button to test the data source to make sure it can connect to the Prometheus server successfully.
+
+image::cloud/operator/monitoring/grafana-data-source-test.png[]
+
+=== Import the sample dashboard
+
+Click `+` -> `Import dashboard`, copy the json model data for xref::cloud/operator/grafana-dashbord-example.adoc[the sample dashboard] and then paste the data in the `Import via dashboard JSON model` text box, and then click `Load`. The sample dashboard is loaded.
+
+image::cloud/operator/monitoring/grafana-dashboard-example.png[]
+
+=== Customize or build your own dashboard
+You can customize or build your own dashboard. For more information, see xref:https://grafana.com/docs/grafana/latest/dashboards[Grafana Dashboards] and xref:cloud/operator/sonataflow-metrics.adoc[SonataFlow Metrics].
Review Comment:
Fixed.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1883836969
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
Review Comment:
ok
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
Review Comment:
ok
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
Review Comment:
done
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#issuecomment-2557945377
@wmedvede I updated PR based on your above comments. Thanks.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1883838523
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
Review Comment:
ok
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1880951776
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,99 @@
+= SonataFlow Metrics
Review Comment:
@ricardozanini @wmedvede @domhanak I tried to merge them. Please review.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1883794256
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
Review Comment:
```suggestion
* `kogito_process_instance_completed_total`: Number of completed workflows.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
Review Comment:
```suggestion
* `kogito_process_instance_error`: Number of workflows that report an error.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
Review Comment:
```suggestion
* `kogito_process_instance_duration_seconds`: Duration of a workflow instance in seconds.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
Review Comment:
```suggestion
* `sonataflow_input_parameters_counter_total`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
Review Comment:
```suggestion
* `kogito_process_instance_started_total`: Number of started workflows.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the `Error` state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. `Completed` or `Aborted`, are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, `Aborted` or `Completed`, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The `Error` state is not terminal.
+Additionally, the metric has the process_state=`Completed`, or could be `Aborted`, to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_error
+Records the number of errors that have occurred per processId and error, including the error message.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_error Number of errors that has occurred
+# TYPE kogito_process_instance_error counter
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state,, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
Review Comment:
```suggestion
Calculates duration of a workflow instance that has reached a terminal state, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
Review Comment:
```suggestion
Each of the metrics mentioned previously contains a label for a specific workflow id. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
Review Comment:
```suggestion
* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
Review Comment:
```suggestion
Internally, workflows are referred as processes. Therefore, the `processId` and `processName` are workflow id and name respectively.
```
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1893632786
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,136 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows.
+* `kogito_process_instance_running_total`: Number of running workflows.
+* `kogito_process_instance_completed_total`: Number of completed workflows.
+* `kogito_process_instance_error`: Number of workflows that report an error.
+* `kogito_process_instance_duration_seconds`: Duration of a workflow instance in seconds.
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds.
+* `sonataflow_input_parameters_counter_total`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` are workflow id and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow id. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the `Error` state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. `Completed` or `Aborted`, are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, `Aborted` or `Completed`, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The `Error` state is not terminal.
+Additionally, the metric has the process_state=`Completed`, or could be `Aborted`, to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_error
+Records the number of errors that have occurred per processId and error, including the error message.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_error_total Number of errors that has occurred
+# TYPE kogito_process_instance_error_total counter
+kogito_process_instance_error_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",error_message="java.net.ConnectException - Connection refused",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_duration_seconds_max Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds_max gauge
+ kogito_process_instance_duration_seconds_max{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 30.0
+
+
+# HELP kogito_process_instance_duration_seconds Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds summary
+ kogito_process_instance_duration_seconds_count{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 3.0
+ kogito_process_instance_duration_seconds_sum{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 90.0
+----
+
+=== kogito_node_instance_duration_milliseconds
+Records the duration of the execution for nodes “relevant” to the workflows. The metric is calculated when a given node has finished executing.
+
+[source, yaml]
+----
+# HELP kogito_node_instance_duration_milliseconds_max Relevant nodes duration in milliseconds
+# TYPE kogito_node_instance_duration_milliseconds_max gauge
+kogito_node_instance_duration_milliseconds_max{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 30014.0
+
+
+# HELP kogito_node_instance_duration_milliseconds Relevant nodes duration in milliseconds
+# TYPE kogito_node_instance_duration_milliseconds summary
+kogito_node_instance_duration_milliseconds_count{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 3.0
+kogito_node_instance_duration_milliseconds_sum{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 90128.0
+----
+
+=== sonataflow_input_parameters_counter_total
+
+Records the occurrences of <"param_name", "param_value"> per processId.
+
+[NOTE]
+====
+Parameters that are json values, or arrays are flattened.
+====
+
+[source, yaml]
+----
+# HELP sonataflow_input_parameters_counter_total Input parameters
+# TYPE sonataflow_input_parameters_counter_total counter
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="name",param_value="walter",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="surname.sur1",param_value="Medvedeo",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
Review Comment:
```suggestion
sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="surname.sur1",param_value="Lennon",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,136 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows.
+* `kogito_process_instance_running_total`: Number of running workflows.
+* `kogito_process_instance_completed_total`: Number of completed workflows.
+* `kogito_process_instance_error`: Number of workflows that report an error.
+* `kogito_process_instance_duration_seconds`: Duration of a workflow instance in seconds.
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds.
+* `sonataflow_input_parameters_counter_total`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` are workflow id and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow id. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the `Error` state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. `Completed` or `Aborted`, are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, `Aborted` or `Completed`, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The `Error` state is not terminal.
+Additionally, the metric has the process_state=`Completed`, or could be `Aborted`, to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_error
+Records the number of errors that have occurred per processId and error, including the error message.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_error_total Number of errors that has occurred
+# TYPE kogito_process_instance_error_total counter
+kogito_process_instance_error_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",error_message="java.net.ConnectException - Connection refused",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
Review Comment:
```suggestion
Calculates duration of a workflow instance that has reached a terminal state, i.e. `Aborted` or `Completed`. This metric is registered when the workflow reaches the terminal state.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,136 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows.
+* `kogito_process_instance_running_total`: Number of running workflows.
+* `kogito_process_instance_completed_total`: Number of completed workflows.
+* `kogito_process_instance_error`: Number of workflows that report an error.
+* `kogito_process_instance_duration_seconds`: Duration of a workflow instance in seconds.
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds.
+* `sonataflow_input_parameters_counter_total`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` are workflow id and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow id. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the `Error` state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. `Completed` or `Aborted`, are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, `Aborted` or `Completed`, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The `Error` state is not terminal.
+Additionally, the metric has the process_state=`Completed`, or could be `Aborted`, to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_error
+Records the number of errors that have occurred per processId and error, including the error message.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_error_total Number of errors that has occurred
+# TYPE kogito_process_instance_error_total counter
+kogito_process_instance_error_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",error_message="java.net.ConnectException - Connection refused",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_duration_seconds_max Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds_max gauge
+ kogito_process_instance_duration_seconds_max{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 30.0
+
+
+# HELP kogito_process_instance_duration_seconds Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds summary
+ kogito_process_instance_duration_seconds_count{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 3.0
+ kogito_process_instance_duration_seconds_sum{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 90.0
+----
+
+=== kogito_node_instance_duration_milliseconds
+Records the duration of the execution for nodes “relevant” to the workflows. The metric is calculated when a given node has finished executing.
+
+[source, yaml]
+----
+# HELP kogito_node_instance_duration_milliseconds_max Relevant nodes duration in milliseconds
+# TYPE kogito_node_instance_duration_milliseconds_max gauge
+kogito_node_instance_duration_milliseconds_max{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 30014.0
+
+
+# HELP kogito_node_instance_duration_milliseconds Relevant nodes duration in milliseconds
+# TYPE kogito_node_instance_duration_milliseconds summary
+kogito_node_instance_duration_milliseconds_count{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 3.0
+kogito_node_instance_duration_milliseconds_sum{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 90128.0
+----
+
+=== sonataflow_input_parameters_counter_total
+
+Records the occurrences of <"param_name", "param_value"> per processId.
+
+[NOTE]
+====
+Parameters that are json values, or arrays are flattened.
+====
+
+[source, yaml]
+----
+# HELP sonataflow_input_parameters_counter_total Input parameters
+# TYPE sonataflow_input_parameters_counter_total counter
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="name",param_value="walter",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="surname.sur1",param_value="Medvedeo",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="name",param_value="bob",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 5.0
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="surname",param_value="esponja",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 5.0
Review Comment:
```suggestion
sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="surname.sur1",param_value="McCartney",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 5.0
```
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/monitoring-workflows.adoc:
##########
@@ -0,0 +1,332 @@
+= Monitoring Workflows
+:compat-mode!:
+// Metadata:
+:description: Workflows monitoring configuration
+:keywords: kogito, sonataflow, workflow, operator, kubernetes, prometheus, grafana
+
+// External pages
+:openshift_enable_monitoring_user_defined_projects_url: https://docs.openshift.com/container-platform/4.17/observability/monitoring/enabling-monitoring-for-user-defined-projects.html
+
+:dev_services_url: https://quarkus.io/guides/dev-services
+:test_containers_url: https://www.testcontainers.org/
+
+This document describes how to deploy and configure Prometheus and Grafana components for monitoring of {product_name} workflows.
+
+[IMPORTANT]
+====
+Currently, only those {product_name} workflows deployed as Kubernetes deployments have workflow related metrics exposed to Prometheus and are hence available for monitoring by Grafana Dashboards. Monitoring of {product_name} workflows deployed as Knative services is not supported and such serverless workflows are not included in the Grafana Dashboards.
+====
+
+[#deploy-monitoring]
+== Deploy Prometheus and Grafana
+=== Deploy Prometheus and Grafana on OpenShift Container Platform
+==== Deploy Prometheus
+OpenShift Container Platform includes a preconfigured, preinstalled, and self-updating monitoring stack that provides monitoring for core platform components. As such the Prometheus Operator is already installed on the cluster. To monitor SonataFlow workflows, you shall enable monitoring for user-defined projects. This is achieved by updating `cluster-monitoring-config` ConfigMap in the openshift-monitoring namespace. Create a new one if the ConfigMap does not exist.
+[source, yaml]
+----
+cat << EOF | oc apply -f -
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: cluster-monitoring-config
+ namespace: openshift-monitoring
+data:
+ config.yaml: |
+ enableUserWorkload: true
+EOF
+----
+A new Prometheus server pod will be started and running in the namespace `openshift-user-workload-monitoring`.
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+Create a namespace for the Grafana Operator to be installed in
+[source,shell,subs="attributes+"]
+----
+oc new-project grafana-operator
+----
+Deploy the Grafana Operator using command line. You can also deploy the operator through OperatorHub.
+[source,shell,subs="attributes+"]
+----
+cat << EOF | oc create -f -
+apiVersion: operators.coreos.com/v1
+kind: OperatorGroup
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ targetNamespaces:
+ - grafana-operator
+---
+apiVersion: operators.coreos.com/v1alpha1
+kind: Subscription
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ channel: v5
+ name: grafana-operator
+ installPlanApproval: Automatic
+ source: community-operators
+ sourceNamespace: openshift-marketplace
+EOF
+----
+Wait for the Operator to be ready
+[source,shell,subs="attributes+"]
+----
+oc -n grafana-operator rollout status \
+ deployment grafana-operator-controller-manager-v5
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Give the Grafana service account the cluster-monitoring-view role
+[source, yaml]
+----
+oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-sa
+----
+===== Generate a bearer token for the grafana service account
+[source, yaml]
+----
+TOKEN=`oc sa new-token grafana-sa`
+----
+===== Deploy the Prometheus Data Source
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ isDefault: true
+ type: prometheus
+ jsonData:
+ httpHeaderName1: 'Authorization'
+ timeInterval: 5s
+ tlsSkipVerify: true
+ secureJsonData:
+ httpHeaderValue1: 'Bearer ${TOKEN}'
+ name: Prometheus
+ url: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
+ instanceSelector:
+ matchLabels:
+ dashboards: grafana
+EOF
+----
+Wait until the Grafana server is ready.
+[source,shell,subs="attributes+"]
+----
+oc wait --for=condition=Available=True deployment/grafana-deployment
+----
+===== Create a route for Grafana service
+[source,shell,subs="attributes+"]
+----
+oc expose service grafana-service
+----
+===== Get the URL for Grafana
+[source,shell,subs="attributes+"]
+----
+oc get route grafana-service -o jsonpath='{"http://"}{.spec.host}{"\n"}'
+----
+===== Open Grafana Dashboard UI
+Open Grafana Dashboard UI in your web browser with the URL found. Log in using with admin user name `root` and passward `secret`.
Review Comment:
```suggestion
Open Grafana Dashboard UI in your web browser with the URL found. Log in using with admin user name `root` and password `secret`.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,136 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows.
+* `kogito_process_instance_running_total`: Number of running workflows.
+* `kogito_process_instance_completed_total`: Number of completed workflows.
+* `kogito_process_instance_error`: Number of workflows that report an error.
+* `kogito_process_instance_duration_seconds`: Duration of a workflow instance in seconds.
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds.
+* `sonataflow_input_parameters_counter_total`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` are workflow id and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow id. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the `Error` state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. `Completed` or `Aborted`, are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, `Aborted` or `Completed`, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The `Error` state is not terminal.
+Additionally, the metric has the process_state=`Completed`, or could be `Aborted`, to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_error
+Records the number of errors that have occurred per processId and error, including the error message.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_error_total Number of errors that has occurred
+# TYPE kogito_process_instance_error_total counter
+kogito_process_instance_error_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",error_message="java.net.ConnectException - Connection refused",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_duration_seconds_max Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds_max gauge
+ kogito_process_instance_duration_seconds_max{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 30.0
+
+
+# HELP kogito_process_instance_duration_seconds Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds summary
+ kogito_process_instance_duration_seconds_count{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 3.0
+ kogito_process_instance_duration_seconds_sum{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 90.0
+----
+
+=== kogito_node_instance_duration_milliseconds
+Records the duration of the execution for nodes “relevant” to the workflows. The metric is calculated when a given node has finished executing.
+
+[source, yaml]
+----
+# HELP kogito_node_instance_duration_milliseconds_max Relevant nodes duration in milliseconds
+# TYPE kogito_node_instance_duration_milliseconds_max gauge
+kogito_node_instance_duration_milliseconds_max{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 30014.0
+
+
+# HELP kogito_node_instance_duration_milliseconds Relevant nodes duration in milliseconds
+# TYPE kogito_node_instance_duration_milliseconds summary
+kogito_node_instance_duration_milliseconds_count{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 3.0
+kogito_node_instance_duration_milliseconds_sum{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 90128.0
+----
+
+=== sonataflow_input_parameters_counter_total
+
+Records the occurrences of <"param_name", "param_value"> per processId.
+
+[NOTE]
+====
+Parameters that are json values, or arrays are flattened.
+====
+
+[source, yaml]
+----
+# HELP sonataflow_input_parameters_counter_total Input parameters
+# TYPE sonataflow_input_parameters_counter_total counter
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="name",param_value="walter",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
Review Comment:
```suggestion
sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="name",param_value="John",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,136 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows.
+* `kogito_process_instance_running_total`: Number of running workflows.
+* `kogito_process_instance_completed_total`: Number of completed workflows.
+* `kogito_process_instance_error`: Number of workflows that report an error.
+* `kogito_process_instance_duration_seconds`: Duration of a workflow instance in seconds.
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds.
+* `sonataflow_input_parameters_counter_total`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` are workflow id and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow id. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the `Error` state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. `Completed` or `Aborted`, are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, `Aborted` or `Completed`, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The `Error` state is not terminal.
+Additionally, the metric has the process_state=`Completed`, or could be `Aborted`, to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_error
+Records the number of errors that have occurred per processId and error, including the error message.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_error_total Number of errors that has occurred
+# TYPE kogito_process_instance_error_total counter
+kogito_process_instance_error_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",error_message="java.net.ConnectException - Connection refused",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_duration_seconds_max Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds_max gauge
+ kogito_process_instance_duration_seconds_max{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 30.0
+
+
+# HELP kogito_process_instance_duration_seconds Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds summary
+ kogito_process_instance_duration_seconds_count{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 3.0
+ kogito_process_instance_duration_seconds_sum{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 90.0
+----
+
+=== kogito_node_instance_duration_milliseconds
+Records the duration of the execution for nodes “relevant” to the workflows. The metric is calculated when a given node has finished executing.
Review Comment:
```suggestion
Records the duration of the execution for nodes relevant to the workflows. The metric is calculated when a given node has finished executing.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,136 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows.
+* `kogito_process_instance_running_total`: Number of running workflows.
+* `kogito_process_instance_completed_total`: Number of completed workflows.
+* `kogito_process_instance_error`: Number of workflows that report an error.
+* `kogito_process_instance_duration_seconds`: Duration of a workflow instance in seconds.
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds.
+* `sonataflow_input_parameters_counter_total`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` are workflow id and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow id. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the `Error` state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. `Completed` or `Aborted`, are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, `Aborted` or `Completed`, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The `Error` state is not terminal.
+Additionally, the metric has the process_state=`Completed`, or could be `Aborted`, to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_error
+Records the number of errors that have occurred per processId and error, including the error message.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_error_total Number of errors that has occurred
+# TYPE kogito_process_instance_error_total counter
+kogito_process_instance_error_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",error_message="java.net.ConnectException - Connection refused",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_duration_seconds_max Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds_max gauge
+ kogito_process_instance_duration_seconds_max{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 30.0
+
+
+# HELP kogito_process_instance_duration_seconds Process Instances Duration
+# TYPE kogito_process_instance_duration_seconds summary
+ kogito_process_instance_duration_seconds_count{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 3.0
+ kogito_process_instance_duration_seconds_sum{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 90.0
+----
+
+=== kogito_node_instance_duration_milliseconds
+Records the duration of the execution for nodes “relevant” to the workflows. The metric is calculated when a given node has finished executing.
+
+[source, yaml]
+----
+# HELP kogito_node_instance_duration_milliseconds_max Relevant nodes duration in milliseconds
+# TYPE kogito_node_instance_duration_milliseconds_max gauge
+kogito_node_instance_duration_milliseconds_max{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 30014.0
+
+
+# HELP kogito_node_instance_duration_milliseconds Relevant nodes duration in milliseconds
+# TYPE kogito_node_instance_duration_milliseconds summary
+kogito_node_instance_duration_milliseconds_count{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 3.0
+kogito_node_instance_duration_milliseconds_sum{artifactId="serverless-workflow-project",node_name="CallbackState",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 90128.0
+----
+
+=== sonataflow_input_parameters_counter_total
+
+Records the occurrences of <"param_name", "param_value"> per processId.
+
+[NOTE]
+====
+Parameters that are json values, or arrays are flattened.
+====
+
+[source, yaml]
+----
+# HELP sonataflow_input_parameters_counter_total Input parameters
+# TYPE sonataflow_input_parameters_counter_total counter
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="name",param_value="walter",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="surname.sur1",param_value="Medvedeo",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 1.0
+sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="name",param_value="bob",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 5.0
Review Comment:
```suggestion
sonataflow_input_parameters_counter_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",param_name="name",param_value="Paul",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 5.0
```
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#issuecomment-2580610526
@domhanak mind taking a look so we can close this one?
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1880952309
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/monitoring-workflows.adoc:
##########
@@ -0,0 +1,332 @@
+= Monitoring Workflows
+:compat-mode!:
+// Metadata:
+:description: Workflows monitoring configuration configuration
+:keywords: kogito, sonataflow, workflow, operator, kubernetes, prometheus, grafana
+
+// External pages
+:openshift_enable_monitoring_user_defined_projects_url: https://docs.openshift.com/container-platform/4.17/observability/monitoring/enabling-monitoring-for-user-defined-projects.html
+
+:dev_services_url: https://quarkus.io/guides/dev-services
+:test_containers_url: https://www.testcontainers.org/
+
+This document describes how to deploy and configure Prometheus and Grafana components for monitoring of {product_name} workflows.
+
+[IMPORTANT]
+====
+Currently, only those {product_name} workflows deployed as Kubernetes deployments have workflow related metrics exposed to Prometheus and are hence available for monitoring by Grafana Dashboards. Monitoring of {product_name} workflows deployed as Knative services is not supported and such serverless workflows are not included in the Grafana Dashboards.
+====
+
+[#deploy-monitoring]
+== Deploy Prometheus and Grafana
+=== Deploy Prometheus and Grafana on OpenShift Container Platform
+==== Deploy Prometheus
+OpenShift Container Platform includes a preconfigured, preinstalled, and self-updating monitoring stack that provides monitoring for core platform components. As such the Prometheus Operator is already installed on the cluster. To monitor SonataFlow workflows, you shall enable monitoring for user-defined projects. This is achieved by updating `cluster-monitoring-config` ConfigMap in the openshift-monitoring namespace. Create a new one if the ConfigMap does not exist.
+[source, yaml]
+----
+cat << EOF | oc apply -f -
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: cluster-monitoring-config
+ namespace: openshift-monitoring
+data:
+ config.yaml: |
+ enableUserWorkload: true
+EOF
+----
+A new Prometheus server pod will be started and running in the namespace `openshift-user-workload-monitoring`.
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+Create a namespace for the Grafana Operator to be installed in
+[source,shell,subs="attributes+"]
+----
+oc new-project grafana-operator
+----
+Deploy the Grafana Operator using command line. You can also deploy the operator through OperatorHub.
+[source,shell,subs="attributes+"]
+----
+cat << EOF | oc create -f -
+apiVersion: operators.coreos.com/v1
+kind: OperatorGroup
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ targetNamespaces:
+ - grafana-operator
+---
+apiVersion: operators.coreos.com/v1alpha1
+kind: Subscription
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ channel: v5
+ name: grafana-operator
+ installPlanApproval: Automatic
+ source: community-operators
+ sourceNamespace: openshift-marketplace
+EOF
+----
+Wait for the Operator to be ready
+[source,shell,subs="attributes+"]
+----
+oc -n grafana-operator rollout status \
+ deployment grafana-operator-controller-manager-v5
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Give the Grafana service account the cluster-monitoring-view role
+[source, yaml]
+----
+oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-sa
+----
+===== Generate a bearer token for the grafana service account
+[source, yaml]
+----
+TOKEN=`oc sa new-token grafana-sa`
+----
+===== Deploy the Prometheus Data Source
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ isDefault: true
+ type: prometheus
+ jsonData:
+ httpHeaderName1: 'Authorization'
+ timeInterval: 5s
+ tlsSkipVerify: true
+ secureJsonData:
+ httpHeaderValue1: 'Bearer ${TOKEN}'
+ name: Prometheus
+ url: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
+ instanceSelector:
+ matchLabels:
+ dashboards: grafana
+EOF
+----
+Wait until the Grafana server is ready.
+[source,shell,subs="attributes+"]
+----
+oc wait --for=condition=Available=True deployment/grafana-deployment
+----
+===== Create a route for Grafana service
+[source,shell,subs="attributes+"]
+----
+oc expose service grafana-service
+----
+===== Get the URL for Grafana
+[source,shell,subs="attributes+"]
+----
+oc get route grafana-service -o jsonpath='{"http://"}{.spec.host}{"\n"}'
+----
+===== Open Grafana Dashboard UI
+Open Grafana Dashboard UI in your web browser with the URL found. Log in using with admin user name `root` and passward `secret`.
+
+=== Deploy Prometheus and Grafana on Kubernetes
+==== Deploy Prometheus
+===== Deploy Prometheus Operator
+:attribute: prometheus_version
+[source,shell,subs="attributes+"]
+----
+PROMETHEUS_VERSION=v0.70.0
+kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/$\{PROMETHEUS_VERSION}/bundle.yaml -n default
+----
+Wait until the operator is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deploy/prometheus-operator -n default
+----
+===== Deploy Prometheus Instance
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: monitoring.coreos.com/v1
+kind: Prometheus
+metadata:
+ name: prometheus
+spec:
+ serviceAccountName: prometheus
+ serviceMonitorNamespaceSelector: {}
+ serviceMonitorSelector: {}
+ podMonitorSelector: {}
+ resources:
+ requests:
+ memory: 400Mi
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: prometheus
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: prometheus
+rules:
+- apiGroups: [""]
+ resources:
+ - nodes
+ - nodes/metrics
+ - services
+ - endpoints
+ - pods
+ verbs: ["get", "list", "watch"]
+- apiGroups: [""]
+ resources:
+ - configmaps
+ verbs: ["get"]
+- apiGroups:
+ - networking.k8s.io
+ resources:
+ - ingresses
+ verbs: ["get", "list", "watch"]
+- nonResourceURLs: ["/metrics"]
+ verbs: ["get"]
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: prometheus
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: prometheus
+subjects:
+- kind: ServiceAccount
+ name: prometheus
+ namespace: default
+EOF
+----
+Wait until the Prometheus server is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl apply -f ./test/testdata/prometheus.yaml -n default
+kubectl wait --for=condition=Available=True prometheus/prometheus -n default
+----
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+:attribute: grafana_version
+[source,shell,subs="attributes+"]
+----
+GRAFANA_VERSION=v5.13.0
+kubectl create -f https://github.com/grafana/grafana-operator/releases/download/$\{GRAFANA_VERSION}/kustomize-cluster_scoped.yaml
+----
+Wait until Grafana Operator is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deploy/grafana-operator-controller-manager -n grafana
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Create a Grafana Datasource for Prometheus
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ type: prometheus
+ jsonData:
+ timeInterval: 5s
+ tlsSkipVerify: true
+ name: Prometheus
+ url: http://prometheus-operated.default.svc.cluster.local:9090
+ instanceSelector:
+ matchLabels:
+ dashboards: grafana
+EOF
+----
+
+Wait until the Grafana server is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deployment/grafana-deployment -n default
+----
+
+===== Open Grafana Dashboard UI
+Now you can forward local port number `3000` to the Grafana service.
+[source,shell,subs="attributes+"]
+----
+kubectl port-forward svc/grafana-service -n default 3000:3000
+----
+Open Grafana Dashboard UI in your web browser with the URL `http://localhost:30000`. Log in using with admin user name `root` and passward `secret`.
+
+[#workflow-monitoring]
+== Workflows Monitoring
+=== Enable monitoring in `SonataFlowPlatform` CR
+When `SonataFlowPlatform` CR has `spec.monitoring.enabled` set, and Prometheus has been deployed in the cluster, {operator_name} will automatically create a service monitor for each workflow that is deployed as a Kubernetes Deployment object. The service monitor allows Prometheus to scrape the workflow related metrics from the workflow pod.
+[source, yaml]
+----
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlowPlatform
+metadata:
+ name: sonataflow-platform
+spec:
+ monitoring:
+ enabled: true
+----
+=== Test Data Source Connection
+In the Grafana UI, click `Connections` -> `Data sources`, and open the data source. Then click `Save & test` button to test the data source to make sure it can connect to the Prometheus server successfully.
+
+image::cloud/operator/monitoring/grafana-data-source-test.png[]
+
+=== Import the sample dashboard
+
+Click `+` -> `Import dashboard`, copy the json model data for xref::cloud/operator/grafana-dashbord-example.adoc[the sample dashboard] and then paste the data in the `Import via dashboard JSON model` text box, and then click `Load`. The sample dashboard is loaded.
+
+image::cloud/operator/monitoring/grafana-dashboard-example.png[]
+
+=== Customize or build your own dashboard
+You can customize or build your own dashboard. For more information, see xref:https://grafana.com/docs/grafana/latest/dashboards[Grafana Dashboards] and xref:cloud/operator/sonataflow-metrics.adoc[SonataFlow Metrics].
+
+== Additional resources
+
+* xref:cloud/operator/sonataflow-metrics.adoc[SonataFlow Metrics]
+* xref:https://grafana.com/docs/grafana/latest/dashboards[Grafana Dashboards]
Review Comment:
Fixed
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1882756251
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The “Error” state is not terminal.
+Additionally, the metric has the process_state="Completed", or could be "Aborted", to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the "Error" state, since the error state is not a terminal state.
Review Comment:
Accepted
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The “Error” state is not terminal.
Review Comment:
Accepted
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
Review Comment:
Accepted
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#issuecomment-2539619099
@kaldesai mind taking a look too?
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1882756019
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/monitoring-workflows.adoc:
##########
@@ -0,0 +1,332 @@
+= Monitoring Workflows
+:compat-mode!:
+// Metadata:
+:description: Workflows monitoring configuration configuration
Review Comment:
Accepted
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The “Error” state is not terminal.
+Additionally, the metric has the process_state="Completed", or could be "Aborted", to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the "Error" state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. "Completed" or "Aborted", are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state,, i.e. "Aborted" or "Completed". This metric is registered when the process reaches the terminal state.
Review Comment:
Accepted
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The “Error” state is not terminal.
+Additionally, the metric has the process_state="Completed", or could be "Aborted", to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the "Error" state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. "Completed" or "Aborted", are not present in this metric.
Review Comment:
Accepted
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1883837332
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
Review Comment:
ok
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
Review Comment:
ok
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#issuecomment-2536183835
Would you mind check the procedure for regular Kubernetes clusters? @domhanak
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1880319186
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,99 @@
+= SonataFlow Metrics
Review Comment:
I think this page is not shown in the menu Cloud -> Operator or in any other menu entry.
On the other hand, we have a sort of metrics page that shows the metrics and that I personally don't like 100%.
I think that what we must do, is to do a kind of merge between this metrics content and what is shown in the page below, and provide something good.
But , it's out of from @jianrongzhang89 scope.
see below:

Feel free to merge as is, to not loose this content and we can restructure in a followup PR.
@ricardozanini @domhanak
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/monitoring-workflows.adoc:
##########
@@ -0,0 +1,332 @@
+= Monitoring Workflows
+:compat-mode!:
+// Metadata:
+:description: Workflows monitoring configuration configuration
+:keywords: kogito, sonataflow, workflow, operator, kubernetes, prometheus, grafana
+
+// External pages
+:openshift_enable_monitoring_user_defined_projects_url: https://docs.openshift.com/container-platform/4.17/observability/monitoring/enabling-monitoring-for-user-defined-projects.html
+
+:dev_services_url: https://quarkus.io/guides/dev-services
+:test_containers_url: https://www.testcontainers.org/
+
+This document describes how to deploy and configure Prometheus and Grafana components for monitoring of {product_name} workflows.
+
+[IMPORTANT]
+====
+Currently, only those {product_name} workflows deployed as Kubernetes deployments have workflow related metrics exposed to Prometheus and are hence available for monitoring by Grafana Dashboards. Monitoring of {product_name} workflows deployed as Knative services is not supported and such serverless workflows are not included in the Grafana Dashboards.
+====
+
+[#deploy-monitoring]
+== Deploy Prometheus and Grafana
+=== Deploy Prometheus and Grafana on OpenShift Container Platform
+==== Deploy Prometheus
+OpenShift Container Platform includes a preconfigured, preinstalled, and self-updating monitoring stack that provides monitoring for core platform components. As such the Prometheus Operator is already installed on the cluster. To monitor SonataFlow workflows, you shall enable monitoring for user-defined projects. This is achieved by updating `cluster-monitoring-config` ConfigMap in the openshift-monitoring namespace. Create a new one if the ConfigMap does not exist.
+[source, yaml]
+----
+cat << EOF | oc apply -f -
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: cluster-monitoring-config
+ namespace: openshift-monitoring
+data:
+ config.yaml: |
+ enableUserWorkload: true
+EOF
+----
+A new Prometheus server pod will be started and running in the namespace `openshift-user-workload-monitoring`.
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+Create a namespace for the Grafana Operator to be installed in
+[source,shell,subs="attributes+"]
+----
+oc new-project grafana-operator
+----
+Deploy the Grafana Operator using command line. You can also deploy the operator through OperatorHub.
+[source,shell,subs="attributes+"]
+----
+cat << EOF | oc create -f -
+apiVersion: operators.coreos.com/v1
+kind: OperatorGroup
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ targetNamespaces:
+ - grafana-operator
+---
+apiVersion: operators.coreos.com/v1alpha1
+kind: Subscription
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ channel: v5
+ name: grafana-operator
+ installPlanApproval: Automatic
+ source: community-operators
+ sourceNamespace: openshift-marketplace
+EOF
+----
+Wait for the Operator to be ready
+[source,shell,subs="attributes+"]
+----
+oc -n grafana-operator rollout status \
+ deployment grafana-operator-controller-manager-v5
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Give the Grafana service account the cluster-monitoring-view role
+[source, yaml]
+----
+oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-sa
+----
+===== Generate a bearer token for the grafana service account
+[source, yaml]
+----
+TOKEN=`oc sa new-token grafana-sa`
+----
+===== Deploy the Prometheus Data Source
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ isDefault: true
+ type: prometheus
+ jsonData:
+ httpHeaderName1: 'Authorization'
+ timeInterval: 5s
+ tlsSkipVerify: true
+ secureJsonData:
+ httpHeaderValue1: 'Bearer ${TOKEN}'
+ name: Prometheus
+ url: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
+ instanceSelector:
+ matchLabels:
+ dashboards: grafana
+EOF
+----
+Wait until the Grafana server is ready.
+[source,shell,subs="attributes+"]
+----
+oc wait --for=condition=Available=True deployment/grafana-deployment
+----
+===== Create a route for Grafana service
+[source,shell,subs="attributes+"]
+----
+oc expose service grafana-service
+----
+===== Get the URL for Grafana
+[source,shell,subs="attributes+"]
+----
+oc get route grafana-service -o jsonpath='{"http://"}{.spec.host}{"\n"}'
+----
+===== Open Grafana Dashboard UI
+Open Grafana Dashboard UI in your web browser with the URL found. Log in using with admin user name `root` and passward `secret`.
+
+=== Deploy Prometheus and Grafana on Kubernetes
+==== Deploy Prometheus
+===== Deploy Prometheus Operator
+:attribute: prometheus_version
+[source,shell,subs="attributes+"]
+----
+PROMETHEUS_VERSION=v0.70.0
+kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/$\{PROMETHEUS_VERSION}/bundle.yaml -n default
+----
+Wait until the operator is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deploy/prometheus-operator -n default
+----
+===== Deploy Prometheus Instance
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: monitoring.coreos.com/v1
+kind: Prometheus
+metadata:
+ name: prometheus
+spec:
+ serviceAccountName: prometheus
+ serviceMonitorNamespaceSelector: {}
+ serviceMonitorSelector: {}
+ podMonitorSelector: {}
+ resources:
+ requests:
+ memory: 400Mi
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: prometheus
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: prometheus
+rules:
+- apiGroups: [""]
+ resources:
+ - nodes
+ - nodes/metrics
+ - services
+ - endpoints
+ - pods
+ verbs: ["get", "list", "watch"]
+- apiGroups: [""]
+ resources:
+ - configmaps
+ verbs: ["get"]
+- apiGroups:
+ - networking.k8s.io
+ resources:
+ - ingresses
+ verbs: ["get", "list", "watch"]
+- nonResourceURLs: ["/metrics"]
+ verbs: ["get"]
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: prometheus
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: prometheus
+subjects:
+- kind: ServiceAccount
+ name: prometheus
+ namespace: default
+EOF
+----
+Wait until the Prometheus server is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl apply -f ./test/testdata/prometheus.yaml -n default
+kubectl wait --for=condition=Available=True prometheus/prometheus -n default
+----
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+:attribute: grafana_version
+[source,shell,subs="attributes+"]
+----
+GRAFANA_VERSION=v5.13.0
+kubectl create -f https://github.com/grafana/grafana-operator/releases/download/$\{GRAFANA_VERSION}/kustomize-cluster_scoped.yaml
+----
+Wait until Grafana Operator is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deploy/grafana-operator-controller-manager -n grafana
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Create a Grafana Datasource for Prometheus
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ type: prometheus
+ jsonData:
+ timeInterval: 5s
+ tlsSkipVerify: true
+ name: Prometheus
+ url: http://prometheus-operated.default.svc.cluster.local:9090
+ instanceSelector:
+ matchLabels:
+ dashboards: grafana
+EOF
+----
+
+Wait until the Grafana server is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deployment/grafana-deployment -n default
+----
+
+===== Open Grafana Dashboard UI
+Now you can forward local port number `3000` to the Grafana service.
+[source,shell,subs="attributes+"]
+----
+kubectl port-forward svc/grafana-service -n default 3000:3000
+----
+Open Grafana Dashboard UI in your web browser with the URL `http://localhost:30000`. Log in using with admin user name `root` and passward `secret`.
+
+[#workflow-monitoring]
+== Workflows Monitoring
+=== Enable monitoring in `SonataFlowPlatform` CR
+When `SonataFlowPlatform` CR has `spec.monitoring.enabled` set, and Prometheus has been deployed in the cluster, {operator_name} will automatically create a service monitor for each workflow that is deployed as a Kubernetes Deployment object. The service monitor allows Prometheus to scrape the workflow related metrics from the workflow pod.
+[source, yaml]
+----
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlowPlatform
+metadata:
+ name: sonataflow-platform
+spec:
+ monitoring:
+ enabled: true
+----
+=== Test Data Source Connection
+In the Grafana UI, click `Connections` -> `Data sources`, and open the data source. Then click `Save & test` button to test the data source to make sure it can connect to the Prometheus server successfully.
+
+image::cloud/operator/monitoring/grafana-data-source-test.png[]
+
+=== Import the sample dashboard
+
+Click `+` -> `Import dashboard`, copy the json model data for xref::cloud/operator/grafana-dashbord-example.adoc[the sample dashboard] and then paste the data in the `Import via dashboard JSON model` text box, and then click `Load`. The sample dashboard is loaded.
+
+image::cloud/operator/monitoring/grafana-dashboard-example.png[]
+
+=== Customize or build your own dashboard
+You can customize or build your own dashboard. For more information, see xref:https://grafana.com/docs/grafana/latest/dashboards[Grafana Dashboards] and xref:cloud/operator/sonataflow-metrics.adoc[SonataFlow Metrics].
Review Comment:
This link: xref:https://grafana.com/docs/grafana/latest/dashboards[Grafana Dashboards] is not working.
I think that for external links you must use the link: tag instead.
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/monitoring-workflows.adoc:
##########
@@ -0,0 +1,332 @@
+= Monitoring Workflows
+:compat-mode!:
+// Metadata:
+:description: Workflows monitoring configuration configuration
+:keywords: kogito, sonataflow, workflow, operator, kubernetes, prometheus, grafana
+
+// External pages
+:openshift_enable_monitoring_user_defined_projects_url: https://docs.openshift.com/container-platform/4.17/observability/monitoring/enabling-monitoring-for-user-defined-projects.html
+
+:dev_services_url: https://quarkus.io/guides/dev-services
+:test_containers_url: https://www.testcontainers.org/
+
+This document describes how to deploy and configure Prometheus and Grafana components for monitoring of {product_name} workflows.
+
+[IMPORTANT]
+====
+Currently, only those {product_name} workflows deployed as Kubernetes deployments have workflow related metrics exposed to Prometheus and are hence available for monitoring by Grafana Dashboards. Monitoring of {product_name} workflows deployed as Knative services is not supported and such serverless workflows are not included in the Grafana Dashboards.
+====
+
+[#deploy-monitoring]
+== Deploy Prometheus and Grafana
+=== Deploy Prometheus and Grafana on OpenShift Container Platform
+==== Deploy Prometheus
+OpenShift Container Platform includes a preconfigured, preinstalled, and self-updating monitoring stack that provides monitoring for core platform components. As such the Prometheus Operator is already installed on the cluster. To monitor SonataFlow workflows, you shall enable monitoring for user-defined projects. This is achieved by updating `cluster-monitoring-config` ConfigMap in the openshift-monitoring namespace. Create a new one if the ConfigMap does not exist.
+[source, yaml]
+----
+cat << EOF | oc apply -f -
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: cluster-monitoring-config
+ namespace: openshift-monitoring
+data:
+ config.yaml: |
+ enableUserWorkload: true
+EOF
+----
+A new Prometheus server pod will be started and running in the namespace `openshift-user-workload-monitoring`.
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+Create a namespace for the Grafana Operator to be installed in
+[source,shell,subs="attributes+"]
+----
+oc new-project grafana-operator
+----
+Deploy the Grafana Operator using command line. You can also deploy the operator through OperatorHub.
+[source,shell,subs="attributes+"]
+----
+cat << EOF | oc create -f -
+apiVersion: operators.coreos.com/v1
+kind: OperatorGroup
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ targetNamespaces:
+ - grafana-operator
+---
+apiVersion: operators.coreos.com/v1alpha1
+kind: Subscription
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ channel: v5
+ name: grafana-operator
+ installPlanApproval: Automatic
+ source: community-operators
+ sourceNamespace: openshift-marketplace
+EOF
+----
+Wait for the Operator to be ready
+[source,shell,subs="attributes+"]
+----
+oc -n grafana-operator rollout status \
+ deployment grafana-operator-controller-manager-v5
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Give the Grafana service account the cluster-monitoring-view role
+[source, yaml]
+----
+oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-sa
+----
+===== Generate a bearer token for the grafana service account
+[source, yaml]
+----
+TOKEN=`oc sa new-token grafana-sa`
+----
+===== Deploy the Prometheus Data Source
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ isDefault: true
+ type: prometheus
+ jsonData:
+ httpHeaderName1: 'Authorization'
+ timeInterval: 5s
+ tlsSkipVerify: true
+ secureJsonData:
+ httpHeaderValue1: 'Bearer ${TOKEN}'
+ name: Prometheus
+ url: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
Review Comment:
So, access to metrics is in the end "protected", and can be accessed only if we give the cluster-monitoring-view to grafana, right?
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/monitoring-workflows.adoc:
##########
@@ -0,0 +1,332 @@
+= Monitoring Workflows
+:compat-mode!:
+// Metadata:
+:description: Workflows monitoring configuration configuration
+:keywords: kogito, sonataflow, workflow, operator, kubernetes, prometheus, grafana
+
+// External pages
+:openshift_enable_monitoring_user_defined_projects_url: https://docs.openshift.com/container-platform/4.17/observability/monitoring/enabling-monitoring-for-user-defined-projects.html
+
+:dev_services_url: https://quarkus.io/guides/dev-services
+:test_containers_url: https://www.testcontainers.org/
+
+This document describes how to deploy and configure Prometheus and Grafana components for monitoring of {product_name} workflows.
+
+[IMPORTANT]
+====
+Currently, only those {product_name} workflows deployed as Kubernetes deployments have workflow related metrics exposed to Prometheus and are hence available for monitoring by Grafana Dashboards. Monitoring of {product_name} workflows deployed as Knative services is not supported and such serverless workflows are not included in the Grafana Dashboards.
+====
+
+[#deploy-monitoring]
+== Deploy Prometheus and Grafana
+=== Deploy Prometheus and Grafana on OpenShift Container Platform
+==== Deploy Prometheus
+OpenShift Container Platform includes a preconfigured, preinstalled, and self-updating monitoring stack that provides monitoring for core platform components. As such the Prometheus Operator is already installed on the cluster. To monitor SonataFlow workflows, you shall enable monitoring for user-defined projects. This is achieved by updating `cluster-monitoring-config` ConfigMap in the openshift-monitoring namespace. Create a new one if the ConfigMap does not exist.
+[source, yaml]
+----
+cat << EOF | oc apply -f -
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: cluster-monitoring-config
+ namespace: openshift-monitoring
+data:
+ config.yaml: |
+ enableUserWorkload: true
+EOF
+----
+A new Prometheus server pod will be started and running in the namespace `openshift-user-workload-monitoring`.
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+Create a namespace for the Grafana Operator to be installed in
+[source,shell,subs="attributes+"]
+----
+oc new-project grafana-operator
+----
+Deploy the Grafana Operator using command line. You can also deploy the operator through OperatorHub.
+[source,shell,subs="attributes+"]
+----
+cat << EOF | oc create -f -
+apiVersion: operators.coreos.com/v1
+kind: OperatorGroup
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ targetNamespaces:
+ - grafana-operator
+---
+apiVersion: operators.coreos.com/v1alpha1
+kind: Subscription
+metadata:
+ generateName: grafana-operator-
+ namespace: grafana-operator
+spec:
+ channel: v5
+ name: grafana-operator
+ installPlanApproval: Automatic
+ source: community-operators
+ sourceNamespace: openshift-marketplace
+EOF
+----
+Wait for the Operator to be ready
+[source,shell,subs="attributes+"]
+----
+oc -n grafana-operator rollout status \
+ deployment grafana-operator-controller-manager-v5
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Give the Grafana service account the cluster-monitoring-view role
+[source, yaml]
+----
+oc adm policy add-cluster-role-to-user cluster-monitoring-view -z grafana-sa
+----
+===== Generate a bearer token for the grafana service account
+[source, yaml]
+----
+TOKEN=`oc sa new-token grafana-sa`
+----
+===== Deploy the Prometheus Data Source
+[source, yaml]
+----
+cat << EOF | oc create -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ isDefault: true
+ type: prometheus
+ jsonData:
+ httpHeaderName1: 'Authorization'
+ timeInterval: 5s
+ tlsSkipVerify: true
+ secureJsonData:
+ httpHeaderValue1: 'Bearer ${TOKEN}'
+ name: Prometheus
+ url: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091
+ instanceSelector:
+ matchLabels:
+ dashboards: grafana
+EOF
+----
+Wait until the Grafana server is ready.
+[source,shell,subs="attributes+"]
+----
+oc wait --for=condition=Available=True deployment/grafana-deployment
+----
+===== Create a route for Grafana service
+[source,shell,subs="attributes+"]
+----
+oc expose service grafana-service
+----
+===== Get the URL for Grafana
+[source,shell,subs="attributes+"]
+----
+oc get route grafana-service -o jsonpath='{"http://"}{.spec.host}{"\n"}'
+----
+===== Open Grafana Dashboard UI
+Open Grafana Dashboard UI in your web browser with the URL found. Log in using with admin user name `root` and passward `secret`.
+
+=== Deploy Prometheus and Grafana on Kubernetes
+==== Deploy Prometheus
+===== Deploy Prometheus Operator
+:attribute: prometheus_version
+[source,shell,subs="attributes+"]
+----
+PROMETHEUS_VERSION=v0.70.0
+kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/$\{PROMETHEUS_VERSION}/bundle.yaml -n default
+----
+Wait until the operator is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deploy/prometheus-operator -n default
+----
+===== Deploy Prometheus Instance
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: monitoring.coreos.com/v1
+kind: Prometheus
+metadata:
+ name: prometheus
+spec:
+ serviceAccountName: prometheus
+ serviceMonitorNamespaceSelector: {}
+ serviceMonitorSelector: {}
+ podMonitorSelector: {}
+ resources:
+ requests:
+ memory: 400Mi
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: prometheus
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: prometheus
+rules:
+- apiGroups: [""]
+ resources:
+ - nodes
+ - nodes/metrics
+ - services
+ - endpoints
+ - pods
+ verbs: ["get", "list", "watch"]
+- apiGroups: [""]
+ resources:
+ - configmaps
+ verbs: ["get"]
+- apiGroups:
+ - networking.k8s.io
+ resources:
+ - ingresses
+ verbs: ["get", "list", "watch"]
+- nonResourceURLs: ["/metrics"]
+ verbs: ["get"]
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ name: prometheus
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: prometheus
+subjects:
+- kind: ServiceAccount
+ name: prometheus
+ namespace: default
+EOF
+----
+Wait until the Prometheus server is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl apply -f ./test/testdata/prometheus.yaml -n default
+kubectl wait --for=condition=Available=True prometheus/prometheus -n default
+----
+
+==== Deploy Grafana
+===== Deploy Grafana Operator
+:attribute: grafana_version
+[source,shell,subs="attributes+"]
+----
+GRAFANA_VERSION=v5.13.0
+kubectl create -f https://github.com/grafana/grafana-operator/releases/download/$\{GRAFANA_VERSION}/kustomize-cluster_scoped.yaml
+----
+Wait until Grafana Operator is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deploy/grafana-operator-controller-manager -n grafana
+----
+===== Deploy Grafana Instance
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: Grafana
+metadata:
+ name: grafana
+ labels:
+ dashboards: "grafana"
+spec:
+ config:
+ security:
+ admin_user: root
+ admin_password: secret
+EOF
+----
+===== Create a Grafana Datasource for Prometheus
+[source, yaml]
+----
+cat << EOF | kubectl create -n default -f -
+apiVersion: grafana.integreatly.org/v1beta1
+kind: GrafanaDatasource
+metadata:
+ name: example-grafanadatasource
+spec:
+ datasource:
+ access: proxy
+ type: prometheus
+ jsonData:
+ timeInterval: 5s
+ tlsSkipVerify: true
+ name: Prometheus
+ url: http://prometheus-operated.default.svc.cluster.local:9090
+ instanceSelector:
+ matchLabels:
+ dashboards: grafana
+EOF
+----
+
+Wait until the Grafana server is ready.
+[source,shell,subs="attributes+"]
+----
+kubectl wait --for=condition=Available=True deployment/grafana-deployment -n default
+----
+
+===== Open Grafana Dashboard UI
+Now you can forward local port number `3000` to the Grafana service.
+[source,shell,subs="attributes+"]
+----
+kubectl port-forward svc/grafana-service -n default 3000:3000
+----
+Open Grafana Dashboard UI in your web browser with the URL `http://localhost:30000`. Log in using with admin user name `root` and passward `secret`.
+
+[#workflow-monitoring]
+== Workflows Monitoring
+=== Enable monitoring in `SonataFlowPlatform` CR
+When `SonataFlowPlatform` CR has `spec.monitoring.enabled` set, and Prometheus has been deployed in the cluster, {operator_name} will automatically create a service monitor for each workflow that is deployed as a Kubernetes Deployment object. The service monitor allows Prometheus to scrape the workflow related metrics from the workflow pod.
+[source, yaml]
+----
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlowPlatform
+metadata:
+ name: sonataflow-platform
+spec:
+ monitoring:
+ enabled: true
+----
+=== Test Data Source Connection
+In the Grafana UI, click `Connections` -> `Data sources`, and open the data source. Then click `Save & test` button to test the data source to make sure it can connect to the Prometheus server successfully.
+
+image::cloud/operator/monitoring/grafana-data-source-test.png[]
+
+=== Import the sample dashboard
+
+Click `+` -> `Import dashboard`, copy the json model data for xref::cloud/operator/grafana-dashbord-example.adoc[the sample dashboard] and then paste the data in the `Import via dashboard JSON model` text box, and then click `Load`. The sample dashboard is loaded.
+
+image::cloud/operator/monitoring/grafana-dashboard-example.png[]
+
+=== Customize or build your own dashboard
+You can customize or build your own dashboard. For more information, see xref:https://grafana.com/docs/grafana/latest/dashboards[Grafana Dashboards] and xref:cloud/operator/sonataflow-metrics.adoc[SonataFlow Metrics].
+
+== Additional resources
+
+* xref:cloud/operator/sonataflow-metrics.adoc[SonataFlow Metrics]
+* xref:https://grafana.com/docs/grafana/latest/dashboards[Grafana Dashboards]
Review Comment:
same here, non working link.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1881981209
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
Review Comment:
@jianrongzhang89 this common sonataflow_metrics document is great, many thanks.
My only observation is that the order of occurrence of each metric in the document, is not the same as the one being shown in the initial paragraph, which somehow corresponds with the workflow "natural" life-cycle.
see:

##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The “Error” state is not terminal.
+Additionally, the metric has the process_state="Completed", or could be "Aborted", to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the "Error" state, since the error state is not a terminal state.
Review Comment:
```suggestion
This includes workflow instances that are in the `Error` state, since the error state is not a terminal state.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The “Error” state is not terminal.
+Additionally, the metric has the process_state="Completed", or could be "Aborted", to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the "Error" state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. "Completed" or "Aborted", are not present in this metric.
Review Comment:
```suggestion
Process instances that have reached a terminal status, i.e. `Completed` or `Aborted`, are not present in this metric.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The “Error” state is not terminal.
+Additionally, the metric has the process_state="Completed", or could be "Aborted", to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the "Error" state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. "Completed" or "Aborted", are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state,, i.e. "Aborted" or "Completed". This metric is registered when the process reaches the terminal state.
Review Comment:
```suggestion
Calculates duration of a workflow instance that has reached a terminal state, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
```
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The “Error” state is not terminal.
Review Comment:
```suggestion
These are the only two terminal status. The `Error` state is not terminal.
```
##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/monitoring-workflows.adoc:
##########
@@ -0,0 +1,332 @@
+= Monitoring Workflows
+:compat-mode!:
+// Metadata:
+:description: Workflows monitoring configuration configuration
Review Comment:
```suggestion
:description: Workflows monitoring configuration
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,134 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, “Aborted” or “Completed”, and thus are considered as completed.
Review Comment:
```suggestion
Workflow instances that have reached a terminal status, `Aborted` or `Completed`, and thus are considered as completed.
```
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] issue-465 Create a documentation section to use Grafana DataSource with SonataFlow Prometheus metrics [incubator-kie-kogito-docs]
Posted by "jianrongzhang89 (via GitHub)" <gi...@apache.org>.
jianrongzhang89 commented on code in PR #693:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/693#discussion_r1883837794
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
Review Comment:
ok
##########
serverlessworkflow/modules/ROOT/pages/_common-content/sonataflow-metrics.adoc:
##########
@@ -0,0 +1,135 @@
+== Overview
+
+In {product_name}, you can check the following metrics:
+
+* `kogito_process_instance_started_total`: Number of started workflows (a workflow that has started might be running or completed)
+* `kogito_process_instance_running_total`: Number of running workflows
+* `kogito_process_instance_completed_total`: Number of completed workflows
+* `kogito_process_instance_error`: Number of workflows that report an error ( a workflow with an error might be still running or have been completed)
+* `kogito_process_instance_duration_seconds`: Duration of a process instance in seconds
+* `kogito_node_instance_duration_milliseconds`: Duration of relevant nodes in milliseconds (a workflow is composed by nodes, user might be interested on the time consumed by an specific node type)
+* `sonataflow_input_parameters_counter`: Records input parameters, the occurrences of <"param_name","param_value"> per `processId`.
+
+[NOTE]
+====
+Internally, workflows are referred as processes. Therefore, the `processId` and `processName` is workflow ID and name respectively.
+====
+
+Each of the metrics mentioned previously contains a label for a specific workflow ID. For example, the `kogito_process_instance_completed_total` metric below contains the labels for `callbackstatetimeouts` workflow:
+
+.Example `kogito_process_instance_completed_total` metric
+[source,yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+[NOTE]
+====
+Internally, {product_name} uses Quarkus Micrometer extension, which also exposes built-in metrics. You can disable the Micrometer metrics in {product_name}. For more information, see link:https://quarkus.io/guides/micrometer[Quarkus - Micrometer Metrics].
+====
+
+== Metrics Description
+
+=== kogito_process_instance_started_total
+Count the number of started workflow instances.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_started_total Started Process Instances
+# TYPE kogito_process_instance_started_total counter
+kogito_process_instance_started_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 7.0
+----
+
+=== kogito_process_instance_running_total
+Records the number of running workflow instances.
+
+[NOTE]
+====
+This includes workflow instances that are in the `Error` state, since the error state is not a terminal state.
+Process instances that have reached a terminal status, i.e. `Completed` or `Aborted`, are not present in this metric.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_running_total Running Process Instances
+# TYPE kogito_process_instance_running_total gauge
+kogito_process_instance_running_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",version="1.0.0-SNAPSHOT",} 4.0
+----
+
+=== kogito_process_instance_completed_total
+Workflow instances that have reached a terminal status, `Aborted` or `Completed`, and thus are considered as completed.
+
+[NOTE]
+====
+These are the only two terminal status. The `Error` state is not terminal.
+Additionally, the metric has the process_state=`Completed`, or could be `Aborted`, to register exactly which of the two terminal status were reached.
+====
+
+[source, yaml]
+----
+# HELP kogito_process_instance_completed_total Completed Process Instances
+# TYPE kogito_process_instance_completed_total counter
+kogito_process_instance_completed_total{app_id="sonataflow-process-monitoring-listener",artifactId="serverless-workflow-project",process_id="callbackstatetimeouts",process_state="Completed",version="1.0.0-SNAPSHOT",} 3.0
+----
+
+=== kogito_process_instance_error
+Records the number of errors that have occurred per processId and error, including the error message.
+
+[source, yaml]
+----
+# HELP kogito_process_instance_error Number of errors that has occurred
+# TYPE kogito_process_instance_error counter
+----
+
+=== kogito_process_instance_duration_seconds
+Calculates duration of a workflow instance that has reached a terminal state,, i.e. `Aborted` or `Completed`. This metric is registered when the process reaches the terminal state.
Review Comment:
ok
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org