此内容没有您所选择的语言版本。
Chapter 9. Monitoring Data Grid with Prometheus
Data Grid exposes a metrics endpoint that provides statistics and events to Prometheus.
9.1. Setting Up Prometheus 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Set up Prometheus so it can authenticate with and monitor Data Grid clusters.
Prerequisites
- Install the Prometheus Operator.
- Create a running Prometheus instance.
Procedure
Add an authentication secret to your Prometheus namespace.
This secret allows Prometheus to authenticate with your Data Grid cluster. You can find Data Grid credentials in the authentication secret in your Data Grid Operator namespace.
apiVersion: v1 stringData: username: developer1 password: dIRs5cAAsHIeeRIL2 kind: Secret metadata: name: basic-auth type: OpaqueCreate a service monitor instance 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: - basicAuth: username: key: username name: basic-auth3 password: key: password name: basic-auth4 interval: 30s scheme: https5 tlsConfig: insecureSkipVerify: true serverName: certificate-CN6 namespaceSelector: matchNames: - infinispan7 selector: matchLabels: app: infinispan-service clusterName: cluster-name8 - 1
- names the service monitor.
- 2
- specifies your Prometheus namespace.
- 3
- specifies the name of the authentication secret that has Data Grid credentials.
- 4
- specifies the name of the authentication secret that has Data Grid credentials.
- 5
- specifies that Data Grid endpoints use encryption. If you do not use TLS, remove
spec.endpoints.scheme. - 6
- 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. If you do not use TLS, removespec.endpoints.tlsConfig. - 7
- specifies the Data Grid Operator namespace.
- 8
- specifies the name of the Data Grid cluster.