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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]