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
  • Query application metrics manually
  • Query application metrics via OpenShift web console
  • What have you learnt?
  1. Application Monitoring
  2. Application Metrics

Query Application Metrics

PreviousConfigure Service MonitoringNextDistributed Tracing

Last updated 2 years ago

Query application metrics manually

Open Web Terminal then run this command to query application metrics. You can also query metrics of other microservices as well by just change rest-villains hostname to other service hostnames i.e. rest-fights.

However, this way is not practical and really hard to understand what each metric value means. So, we'll do something better by using OpenShift platform monitoring.

curl http://rest-villains:8080/q/metrics

Query application metrics via OpenShift web console

  1. Go to Observe menu.

  2. Click on Metrics tab.

  3. Click Select query drop-down list menu then select Custom query.

  4. Open Web Terminal and run following command to simulate load test to the Fight microservice.

    while(true); do curl http://rest-fights:8080/api/fights/randomfighters; sleep 0.2; done;
  5. Let the curl command runs aside. Enter fillowing query in the Expression input text, then change zoom to 5m, and then check Stacked option.

    Click on the Expression input text then keep pressing Enter button on keyboard. You shold see the histogram moving.

    rate(http_server_requests_seconds_count{method="GET",uri="/api/fights/randomfighters"}[1m])
  6. Click on Web Terminal window then press Ctrl + C button on keyboard to stop curl command.

What have you learnt?

  1. How to query application metrics manually.

  2. How to use OpenSHift built-in monitoring tool to query application metrics.

Query metric manually
Query application metrics
Query application metrics
Query application metrics
Query application metrics