此内容没有您所选择的语言版本。

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

  1. 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: developer 1
      password: dIRs5cAAsHIeeRIL 2
    kind: Secret
    metadata:
      name: basic-auth
    type: Opaque
    1
    specifies an application user. developer is the default application user.
    2
    specifies a corresponding password.
  2. Create 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-monitoring 1
      namespace: infinispan-monitoring 2
    spec:
      endpoints:
        - basicAuth:
            username:
              key: username
              name: basic-auth 3
            password:
              key: password
              name: basic-auth 4
          interval: 30s
          scheme: https 5
          tlsConfig:
            insecureSkipVerify: true
            serverName: certificate-CN 6
      namespaceSelector:
        matchNames:
          - infinispan 7
      selector:
        matchLabels:
          app: infinispan-service
          clusterName: cluster-name 8
    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.name resource for your Data Grid cluster. If you do not use TLS, remove spec.endpoints.tlsConfig.
    7
    specifies the Data Grid Operator namespace.
    8
    specifies the name of the Data Grid cluster.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.