Configure Service Monitoring
Last updated
Last updated
In OpenShift Container Platform, you can enable monitoring for user-defined projects in addition to the default platform monitoring. You can monitor your own projects in OpenShift Container Platform without the need for an additional monitoring solution. Using this feature centralizes monitoring for core platform components and user-defined projects.
In this workshop, user-defined projects monitoring is already enable so you don't need to worry about that. What you need to do is create a Service Monitor resource to tell the platform monitoring what workload/services you want it to monitor.
Click on icon located at top right corner of web console.
Copy this YAML snippet to the editor and click Create button.
path: /q/metrics
is the URI exposed by our microservices. Prometheus will call the services with this URI to collect metrics.
targetPort: 8080
is the network port exposed by services.
A super-heroes-monitor ServiceMonitor resource should be created.
How to create Service Monitor object to use the platform monitoring to monitor your application.