Skip to content

Integration with the Prometheus operator #98

@lmilleri

Description

@lmilleri

Trustee is exposing some prometheus metrics at the default /metrics endpoint (port 8080)

The trustee operator is required to make metrics available in OpenShift (or Kubernetes environments utilizing the Prometheus operator).

What is missing:

  • the operator already creates a service for the trustee application. The service must be created with a label to be used as a selector by the ServiceMonitor. For example: oc label service kbs-service app=trustee -n trustee-operator-system
  • Create (or amend existing one) a trustee ServiceMonitor. This resource tells the OpenShift user-workload Prometheus instance how to discover and scrape metrics from the Service associated with your workload. For example:
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: trustee-servicemonitor
  namespace: trustee-operator-system
  labels:
    release: prometheus-operator # This label is important for the Prometheus instance to discover it
spec:
  selector:
    matchLabels:
      app: trustee
  endpoints:
  - port: kbs-port
    path: /metrics
    interval: 30s
  namespaceSelector:
    matchNames:
    - trustee-operator-system

Note: the user workload monitoring should be enabled, but not sure it is under the operator responsability. For example:

apiVersion: v1
kind: ConfigMap
metadata:
  name: cluster-monitoring-config
  namespace: openshift-monitoring
data:
  config.yaml: |
    enableUserWorkload: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions