Este conteúdo não está disponível no idioma selecionado.

Chapter 10. Setting Up Monitoring


Collect JMX metrics with the Prometheus Operator to monitor events and get statistics for Data Grid clusters.

From a high-level, you set up monitoring capabilities as follows:

  1. Configure Data Grid with the AB_PROMETHEUS_ENABLE environment variable set to true.
  2. Install the Prometheus Operator and expose the Prometheus web UI.
  3. Export Data Grid metrics to Prometheus.
  4. Enable Prometheus to monitor Data Grid for metrics.

10.1. Deploying the Prometheus Operator

To install the Prometheus Operator, you should refer to the following documentation:

Tip

10.2. Exposing Data Grid Metrics to Prometheus

Add a service that exposes JMX metrics from Data Grid to Prometheus.

  1. Create a service-metrics.yaml file that defines a metrics service.

    apiVersion: v1
    kind: Service
    metadata:
      annotations:
        description: Expose Data Grid metrics to Prometheus.
      labels:
        app: datagrid-service
        application: datagrid-service
        template: datagrid-service
        metrics: datagrid
      name: datagrid-app-metrics
    spec:
      ClusterIP: None
      ports:
          # Set the port name where Data Grid publishes metrics.
          # You add the port name to service-monitor.yaml.
        - name: web
          port: 8080
          protocol: TCP
          targetPort: 9779
      selector:
        deploymentConfig: datagrid-service
      sessionAffinity: None
    Copy to Clipboard Toggle word wrap
  2. Apply service-metrics.yaml.

    $ oc apply -f service-metrics.yaml
    Copy to Clipboard Toggle word wrap

10.3. Enabling Prometheus to Monitor Data Grid

A service monitor lets Prometheus connect to the Data Grid metrics service.

  1. Create a service-monitor.yaml file that holds the definition for a ServiceMonitor object.

    apiVersion: monitoring.coreos.com/v1
    kind: ServiceMonitor
    metadata:
      name: datagrid-service-monitor
      labels:
        team: frontend
    spec:
      selector:
        matchLabels:
          metrics: datagrid
      endpoints:
          # Set the name of the port where Data Grid publishes metrics.
          # You create this port in service-metrics.yaml.
        - port: web
    Copy to Clipboard Toggle word wrap
  2. Apply service-monitor.yaml.

    $ oc apply -f service-monitor.yaml
    Copy to Clipboard Toggle word wrap
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat