10.3. Prometheus による Data Grid の監視の有効化
サービスモニターを使用することで、Prometheus は Data Grid メトリクスサービスに接続できます。
ServiceMonitor
オブジェクトの定義を保持するservice-monitor.yaml
ファイルを作成します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
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
service-monitor.yaml
を適用します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc apply -f service-monitor.yaml
$ oc apply -f service-monitor.yaml