Monitoring Camel K applications using Prometheus and Grafana

oc new-project camel-k-monitoring
kamel install
oc -n openshift-monitoring create configmap cluster-monitoring-config
oc -n openshift-monitoring edit configmap cluster-monitoring-config
apiVersion: v1kind: ConfigMapmetadata:  name: cluster-monitoring-config  namespace: openshift-monitoringdata:  config.yaml: |    enableUserWorkload: true
// camel-k: language=javaimport org.apache.camel.builder.RouteBuilder;public class Basic extends RouteBuilder {  @Override  public void configure() throws Exception {    from("timer:java?period=1000")      .setHeader("example")      .constant("Java")     .setBody()     .simple("Hello World! Camel K route written in  ${header.example}.")    .log("${body}");  }}
kamel run Basic.java --trait prometheus.enabled=true
// camel-k: language=java trait=prometheus.enabled=true
metadata: annotations:   trait.camel.apache.org/prometheus.enabled: "true"
oc patch ip camel-k — type=merge -p '{"spec":{"traits":{"prometheus":{"configuration":{"enabled":true}}}}}'

--

--

--

Sadhana is a Principal Solutions Architect at Red Hat. She has extensive experience in creating solutions for Banking and Insurance customers across the globe.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building a Data Lake on Google Cloud Platform

Dynamic Programming

Microservice chassis

functions.https.onRequestのquery/body

The 4 Best Resources I Used to Learn Ruby on Rails on the Job

Workplace PowerSu

Tricky Python (Part I)

Creating a Load balancer and Web Server on AWS using Ansible.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sadhana Nandakumar

Sadhana Nandakumar

Sadhana is a Principal Solutions Architect at Red Hat. She has extensive experience in creating solutions for Banking and Insurance customers across the globe.

More from Medium

Deconstructing Elasticsearch 8

MYSQL Database Instance on Red Hat Openshift

Run Argo CD using operator on Kind

Kind — Install Prometheus Operator and fix missing targets