hawkular / hawkular-openshift-agent

A Hawkular feed that collects metrics from Prometheus and/or Jolokia endpoints deployed in one or more pods within an OpenShift node.
16 stars 21 forks source link

Metrics not being collected from jolokia endpoint #178

Open viv816 opened 6 years ago

viv816 commented 6 years ago

Hi,

I have created a test project on an Openshift cluster (1 master, 1 infra, 2 nodes).

Then pulled and deployed latest "hawkular/hawkular-openshift-agent" image to my project and config map 'hosa-config.yaml' as environment variable.

I also deployed a docker image of a spring boot application containing camel routes with jolokia enabled and config map 'app-config.yaml' as environment variable.

However, the 'hawkular-openshift-agent' pod does not seem to collect metrics from my spring boot application. Log details shown below.

hosa

Did I miss any step or configuration? I am new to openshift. I tried the instructions mentioned in the readme file, but got same logs. Please help.

(Btw, the spring boot application logs show everything is fine and all camel routes are started and all metrics endpoints are mapped and jolokia listening on 8080.)

Thank you,

hosa-config.yaml

kind: ConfigMap apiVersion: v1 name: Hawkular OpenShift Agent Configuration metadata: name: hawkular-openshift-agent-configuration labels: metrics-infra: agent data: config.yaml: | collector: minimum_collection_interval_secs: 10 metric_id_prefix: pod/${POD:uid}/custom/ tags: metric_name: ${METRIC:name} description: ${METRIC:description} units: ${METRIC:units} namespace_id: ${POD:namespace_uid} namespace_name: ${POD:namespace_name} node_name: ${POD:node_name} pod_id: ${POD:uid} pod_ip: ${POD:ip} pod_name: ${POD:name} pod_namespace: ${POD:namespace_name} hostname: ${POD:hostname} host_ip: ${POD:host_ip} labels: ${POD:labels} type: pod collector: hawkular_openshift_agent custom_metric: true

app-config.yaml kind: ConfigMap apiVersion: v1 metadata: name: app-metrics-config data: hawkular-openshift-agent-configuration: | endpoints:

rahnarsson commented 6 years ago

Make sure you have ConfigMap as volume on your springboot application and the volume name must be hawkular-openshift-agent where you specify the metrics to be collected.