install oc client docs
prepare monitor stack on OCP docs
check if user project monitoring is enabled docs
oc -n openshift-monitoring describe configmap cluster-monitoring-config | grep enableUserWorkload
the result should be
enableUserWorkload: true
granting users permission to configure monitoring for user-defined projects docs
oc new-project <name of the project>
make sure that the Red Hat OpenShift distributed tracing platform
is installed before running following command docs
oc apply -f ocp/jaeger.yaml
build the application and deploy the services in the namespace
mvn clean package -Popenshift
add targets for metrics
oc apply -f ocp/service-monitor.yaml
configuring example alert docs
oc apply -f ocp/alert-rule.yaml
To see traces connect to the Jaeger UI at:
echo "https://$(oc get route jaeger-all-in-one-inmemory -o go-template --template='{{.spec.host}}')"
Select client
as a Service
parameter and trigger
as Operation
parameter.
If you want to filter only errors fill in the Tags
parameter the value error=true
To see collected metrics, connect to the console at:
echo "$(oc whoami --show-console)/monitoring/query-browser"
or navigate manually to Observe → Metrics
in the web console menu
you can fill the query field to show data and graph, for example:
#show the max execution time for the camel-http and camel-platform-http components (with and without errors) POST_seconds_max{component="camel-platform-http"} or POST_seconds_max{component="camel-http"} #how many triggered events by the camel-trigger component (with and without errors) trigger_seconds_count{component="camel-timer"}
moreover the alert example is fired if an error is faced within the latest 30 seconds
echo "$(oc whoami --show-console)/monitoring/alerts?rowFilter-alert-source=user"
or navigate manually to Observe → Alerting
in the web console menu, filtering results by Source=User
Once fired the alert it is also visible in the Status panel of the project’s Overview panel