Hawkular Monitoring Support

The OPE provides support for exposing the application bean JMX endpoints on the HTTP protocol, by using Jolokia library.

Jolokia is a third-party library released under Apache license and enables exposing application JMX information on HTTP protocol. An OpenShift monitoring application such as Hawkular uses this information to display the additional metrics as shown below.

An example of an OPE deployment yaml file with Jolokia configuration:
ope.yaml
================================
apiVersion: v1
kind: List
items:
- apiVersion: v1
  kind: Service
  metadata:
    name: ope
  spec:
    ports:
    - port: 9094
      targetPort: 9094
      name: jolokia
    selector:
      deploymentconfig: ope
- apiVersion: v1
  kind: DeploymentConfig
  metadata:
    name: ope
    annotations:
      hawkular-openshift-agent: ope-jolokia
  spec:
    replicas: 1
    selector:
      deploymentconfig: ope
    strategy:
      # We set the type of strategy to Recreate, which means that it will be scaled down prior to being scaled up
      type: Recreate
    template:
      metadata:
        labels:
          deploymentconfig: ope
      spec:
        containers:
        - image: tibco/ope:4.0.1
          name: ope
          ports:
          - name: jolokia
            containerPort: 9094
          - name: http
            containerPort: 9094
          env:
          - name: CONSOLE_LEVEL
            value: INFO
        volumes:
          - name: hawkular-openshift-agent
            configMap:
              name: ope-jolokia
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: ope-jolokia
    labels:
      name: ope-jolokia
  data:
    hawkular-openshift-agent: |
      endpoints:
      - type: jolokia
        protocol: http
        port: 9094
        path: /management/jolokia/
        collection_interval: 15s
        metrics:
        # int data value
        - name: java.lang:type=Memory#ObjectPendingFinalizationCount
          type: gauge
          description: Object Pending Finalization Count
        # long data value
        - name: java.lang:type=OperatingSystem#OpenFileDescriptorCount
          type: gauge
          description: Open File Descriptor Count
        # double data value
        - name: java.lang:type=OperatingSystem#ProcessCpuLoad
          type: gauge
          description: Process CPU Load
        # composite data value
        - name: java.lang:type=Memory#HeapMemoryUsage#used
          type: gauge
          description: Heap Memory Used
          units: B
        # boolean value
        - name: java.lang:type=Memory#Verbose
          type: gauge
          description: Memory Verbose Mode
- apiVersion: v1
  kind: Route
  metadata:
    name: ope
  spec:
    to:
      kind: Service
      name: ope