Super Heroes on OpenShift Workshop
  • Super Heroes on OpenShift Workshop
    • About Workshop
    • Application Architecture
    • Getting Started
  • Application Services Deployment
    • Databases Deployment
      • Deploy Database For Hero Microservice
      • Deploy Database For Villain Microservice
      • Deploy Database For Fight Microservice
    • AMQ Streams (Kafka) Deployment
    • Service Registry (Apicurio) Deployment
  • Application Deployment
    • Microservices Deployment
      • Hero Microservice
      • Villain Microservice
      • Fight Microservice
      • Super Hero UI Microservice
      • Statistics and UI Microservices
      • Beautify The Topology View
  • Continuous Deployment (CD)
    • GitOps
  • Application Monitoring
    • Application Metrics
      • Configure Service Monitoring
      • Query Application Metrics
    • Distributed Tracing
      • Configure OpenShift Distributed Tracing Platform
      • Configure OpenShift Distributed Tracing Data Collection
      • Trace Application Transaction
  • Appendix
    • What's Quarkus?
    • Useful Resources
Powered by GitBook
On this page
  • Create Service Monitor
  • What have you learnt?
  1. Application Monitoring
  2. Application Metrics

Configure Service Monitoring

PreviousApplication MetricsNextQuery Application Metrics

Last updated 2 years ago

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.

Create Service Monitor

  1. Click on icon located at top right corner of web console.

  2. 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.

    apiVersion: monitoring.coreos.com/v1
    kind: ServiceMonitor
    metadata:
      name: super-heroes-monitor
    spec:
      endpoints:
      - interval: 30s
        port: http
        targetPort: 8080
        path: /q/metrics
        scheme: http
      selector:
        matchLabels:
          system: quarkus-super-heroes
  3. A super-heroes-monitor ServiceMonitor resource should be created.

What have you learnt?

How to create Service Monitor object to use the platform monitoring to monitor your application.

Create Service Monitoring
Create Service Monitoring
add