> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-serverless-sft-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Prometheus によるモニタリングの使用

W\&B Server で [Prometheus](https://prometheus.io/docs/introduction/overview/) を使用します。Prometheus のインストールは [kubernetes ClusterIP サービス](https://github.com/wandb/terraform-kubernetes-wandb/blob/main/main.tf#L225) として公開されます。

<Warning>
  Prometheus モニタリングは [セルフマネージドインスタンス](/platform/hosting/hosting-options/self-managed) でのみ利用可能です。
</Warning>

Prometheus の メトリクス エンドポイント (`/metrics`) に アクセス するには、以下の手順に従ってください。

1. Kubernetes CLI ツールキットである [kubectl](https://kubernetes.io/docs/reference/kubectl/) を使用して クラスター に接続します。詳細については、Kubernetes の [Accessing Clusters](https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/) ドキュメントを参照してください。

2. 以下の コマンド で クラスター の内部 アドレス を確認します。

   ```bash theme={null}
   kubectl describe svc prometheus
   ```

3. [`kubectl exec`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands) を使用して、Kubernetes クラスター 内で実行されているコンテナ内でシェルセッションを開始します。`<internal address>/metrics` のエンドポイントを叩きます。

   以下の コマンド をコピーして ターミナル で実行し、`<internal address>` を実際の内部 アドレス に置き換えてください。

   ```bash theme={null}
   kubectl exec <internal address>/metrics
   ```

ネットワーク内のあらゆるリソースに アクセス するためだけに exec できるテスト用 Pod が起動します。

```bash theme={null}
kubectl run -it testpod --image=alpine bin/ash --restart=Never --rm
```

そこから、ネットワーク内部への アクセス を維持するか、Kubernetes nodeport サービス を使用して自身で公開するかを選択できます。
