Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 11. Monitoring Data Grid with Prometheus
Data Grid exposes a metrics endpoint that provides statistics and events to Prometheus.
11.1. Creating a Prometheus Service Monitor Link kopierenLink in die Zwischenablage kopiert!
Define a service monitor instances that configures Prometheus to monitor your Data Grid cluster.
Prerequisites
- Set up a Prometheus stack on your OpenShift cluster.
Procedure
Create an authentication secret that contains Data Grid credentials so that Prometheus can authenticate with your Data Grid cluster.
apiVersion: v1 stringData: username: developer1 password: dIRs5cAAsHIeeRIL2 kind: Secret metadata: name: basic-auth type: OpaqueAdd the authentication secret to your Prometheus namespace.
$ oc apply -f basic-auth.yamlCreate a service monitor that configures Prometheus to monitor your Data Grid cluster.
apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: k8s-app: prometheus name: datagrid-monitoring1 namespace: infinispan-monitoring2 spec: endpoints: - targetPort: 112223 path: /metrics4 honorLabels: true basicAuth: username: key: username name: basic-auth5 password: key: password name: basic-auth interval: 30s scrapeTimeout: 10s scheme: https6 tlsConfig: insecureSkipVerify: true serverName: example-infinispan7 namespaceSelector: matchNames: - infinispan8 selector: matchLabels: app: infinispan-service clusterName: example-infinispan9 - 1
- Names the service monitor instances.
- 2
- Specifies the namespace of your Prometheus stack.
- 3
- Sets the port of
11222for the Data Grid metrics endpoint. - 4
- Sets the path where Data Grid exposes metrics.
- 5
- Specifies the authentication secret with Data Grid credentials.
- 6
- Specifies that Data Grid clusters use endpoint encryption.
- 7
- Specifies the Common Name (CN) of the TLS certificate for Data Grid encryption. If you use an OpenShift service certificate, the CN matches the
metadata.nameresource for your Data Grid cluster. - 8
- Specifies the namespace of your Data Grid cluster.
- 9
- Specifies the name of your Data Grid cluster.
Add the service monitor instance to your Prometheus namespace.
$ oc apply -f service-monitor.yaml