This page describes how to monitor a MongoDB Search and Vector Search deployment that you manage with the MongoDB Controllers for Kubernetes Operator. The following observability surfaces are available on the mongot pod:
A Prometheus-compatible
/metricsendpoint.A health check endpoint that exposes
/healthand/ready.Structured JSON logs written to the pod's stdout and stderr.
FTDC (Full-Time Diagnostic Data Capture) files for support and postmortem analysis.
When you enable an operator-managed load balancer through spec.clusters[].loadBalancer.managed, the Kubernetes Operator also provisions an Envoy proxy that exposes its own admin and metrics surfaces.
For the full schema of each MongoDBSearch setting referenced on this page, see MongoDB Search and Vector Search Settings. To diagnose and resolve specific runtime issues, see Troubleshoot mongot Deployment.
Monitor mongot Pod and Resource Status
The most direct signal of mongot availability is the state of its Pod and the status of the MongoDBSearch resource.
Check the pod state and restart count:
kubectl get pods -n <namespace> --context <context> | grep search
A healthy mongot pod reports a Running state with all containers ready and a restart count that doesn't increase. A rising restart count can indicate memory pressure or a configuration error. To learn more, see Troubleshoot mongot Deployment.
Inspect the MongoDBSearch resource status and conditions:
kubectl describe mongodbsearch <MongoDBSearch.metadata.name> \ -n <namespace> --context <context>
Enable Prometheus Metrics
By default, the mongot Prometheus metrics endpoint is disabled. Add the spec.observability.prometheus block to your MongoDBSearch resource to enable it. An empty block enables the endpoint on the default port 9946.
spec: observability: prometheus: {}
To use a non-default port, set spec.observability.prometheus.port:
spec: observability: prometheus: port: 9090
The endpoint is exposed inside the pod and is reachable through the mongot container's pod IP on the configured port. The Kubernetes Operator doesn't authenticate the metrics endpoint.
Scrape Metrics with Prometheus
If your cluster runs the Prometheus Operator, scrape the mongot metrics endpoint with a PodMonitor (recommended for per-pod scraping) or a ServiceMonitor (when fronted by a Service). Match on the labels that the Kubernetes Operator applies to mongot pods and target the port you configured in spec.observability.prometheus.port.
For an example that deploys a MongoDB resource with a ServiceMonitor for Prometheus, see Deploy a Resource to Use with Prometheus.
Available Metrics
The mongot Prometheus surface exposes the following categories of metrics:
JVM — heap and non-heap memory, garbage collection counts and pause times, thread counts, class loader stats.
System — CPU usage, system memory, disk usage, network I/O for the
mongotprocess.Per-index — index size, Lucene document and field counts, index status, last-update timestamps.
Search engine — query counts, failed query counts, query latency histograms.
Forward Metrics to Ops Manager
The metrics forwarder sends mongot metrics to Ops Manager so that you can view them alongside your other deployment metrics. The Kubernetes Operator deploys the forwarder as a separate Kubernetes Deployment that scrapes the mongot metrics endpoint and pushes the metrics to Ops Manager.
The metrics forwarder requires Ops Manager 8.0.25 or later and does not support Cloud Manager.
To configure the forwarder, set the following fields under spec.observability.metricsForwarder on the MongoDBSearch resource:
modecontrols whether the Kubernetes Operator deploys the forwarder. Set it to one of the following values:auto(default) automatically deploys the forwarder for an internal MongoDB source, and for an external source when you setopsManager.enabledalways deploys the forwarder.disablednever deploys the forwarder.
opsManager.projectConfigMapRefnames the ConfigMap that holds the Ops Manager project configuration. Populate the ConfigMap with the following keys:baseUrl: the URL of your Ops Manager instance.projectName: the name of the Ops Manager project.orgId: the ID of the Ops Manager organization.
opsManager.agentCredentialsnames the Secret that holds the Ops Manager API key. Populate the Secret with the following keys:publicKey: the public key of the Ops Manager API key.privateKey: the private key of the Ops Manager API key.
resourceRequirementssets the CPU and memory for the forwarder container.
If you don't set opsManager, the Kubernetes Operator derives the Ops Manager connection details from the source MongoDB resource. You must set opsManager for an external MongoDB source.
spec: observability: metricsForwarder: mode: enabled opsManager: projectConfigMapRef: name: my-om-project-config agentCredentials: name: my-om-agent-api-key
The Kubernetes Operator reports the forwarder status under status.metricsForwarder on the MongoDBSearch resource.
Configure Log Verbosity
mongot writes structured JSON logs to its container's stdout and stderr streams, so you can read them with standard Kubernetes log tools:
kubectl logs statefulset/<MongoDBSearch.metadata.name>-search-0
To stream logs in real time, add the --follow flag. To view logs from a previous container instance after a restart, add the --previous flag.
To change the log verbosity, set spec.logLevel on the MongoDBSearch resource. Valid values are TRACE, DEBUG, INFO, WARN, and ERROR. If omitted, mongot logs at INFO.
spec: logLevel: DEBUG
mongot doesn't rotate its own logs. In a Kubernetes deployment, the container runtime (containerd or CRI-O on most distributions) handles log rotation at the node level. If you forward logs to an external aggregator, configure retention in that system rather than at the mongot process.
Health Check Endpoint
mongot exposes an HTTP health server on port 8080 inside the pod with two endpoints:
Endpoint | Healthy response | Unhealthy response |
|---|---|---|
|
|
|
|
|
|
The endpoints reflect mongot startup, liveness, and the initialization of index replication. The endpoints cannot be disabled.
The Kubernetes Operator wires /health and /ready to the mongot container's liveness and readiness probes automatically. You typically don't need to override these probes; kubectl describe pod <mongot-pod> shows the probe configuration applied by the operator.
FTDC Diagnostics
mongot writes Full-Time Diagnostic Data Capture (FTDC) files to the persistent volume mounted at the pod's data path, under a diagnostic.data/ subdirectory. FTDC is enabled by default and is intended for MongoDB Support to triage performance and stability issues.
FTDC files include higher-cardinality data than the Prometheus surface, including per-index sizing, latency breakdowns for indexing and querying, request catalog statistics, serialization latency, and Lucene performance counters.
To collect FTDC files for a support case, copy the diagnostic.data/ directory from the mongot pod with kubectl cp:
kubectl cp <mongot-pod>:/mongot/data/diagnostic.data ./mongot-ftdc
The in-pod mount path is fixed at /mongot/data regardless of the spec.clusters[].persistence configuration. The persistence settings control the PVC size and storage class, not the mount location.
Managed Envoy Observability
When you set spec.clusters[].loadBalancer.managed, the Kubernetes Operator provisions an Envoy L7 proxy that fronts the mongot pods. The Envoy container exposes two observability surfaces:
Admin endpoint on port
9901for statistics and runtime control (log level, listener draining). The operator restricts the admin interface to an allowlist of paths:/ready,/stats*,/drain_listeners, and/logging*. Use this endpoint for ad-hoc troubleshooting withkubectl port-forward; it is not intended for external exposure.Prometheus metrics on the Envoy admin port at the standard
/stats/prometheuspath. Scrape this endpoint alongside themongotmetrics to get end-to-end visibility into request flow, upstream health, and connection state for the search traffic plane.
The operator reports the high-level Envoy status under status.loadBalancer.phase on the MongoDBSearch resource:
kubectl get mongodbsearch <name> -o jsonpath='{.status.loadBalancer.phase}'
The phase reflects the operator-managed Envoy Deployment lifecycle (for example, Pending, Running, Failed).