<!-- llms-explorer concept facts · https://llms-explorer.com/tree/amazon-documentdb-profiler-cloudwatch-logs/ · pack 2026-10-23 · ~1536 tokens -->

# Amazon DocumentDB profiler (CloudWatch Logs)

> Source-anchored research for Amazon DocumentDB profiler (CloudWatch Logs). Run status: COMPLETED.

Parent: [Database Profiler vs Query Profiler](https://llms-explorer.com/tree/database-profiler-vs-query-profiler/) · 5 facets · 19 facts · page: https://llms-explorer.com/tree/amazon-documentdb-profiler-cloudwatch-logs/

## How it works

- Increasing batch size may enable capture, but can delay the first response and increase unnecessary I/O when clients do not consume all results. (low confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)

## How-to and procedures

- Enable profiling through a custom cluster parameter group and separately enable the cluster's profiler log export; configuring only one side does not deliver logs. (high confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)

## Measurements and reference values

- AWS documents query-log coverage only when the entire result fits in one batch and remains under 16 MB. Increasing batch size can improve capture but delay the first response and waste I/O when results are discarded. (low confidence) (verified as of 2026-10-20) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- Pabis demonstrates a low-traffic DocumentDB 4.0 test with a 50 ms threshold, sampling 1.0, and Terraform-enabled profiler exports. AWS recommends starting with a high threshold and lowering it gradually; it warns that 50 ms can cause performance issues for high-throughput applications, so the Pabis configuration should not be treated as a general default for those workloads. (low confidence) — [source](https://pabis.eu/blog/2023-10-31-AWS-DocumentDB-Profiling.html)

## Problems, failure modes and limitations

- Amazon DocumentDB's profiler captures slow database operations above a configured duration threshold and exports their execution details to CloudWatch Logs for investigation. (high confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- Plan summaries such as COLLSCAN help connect slow operations to missing indexes. One independent production account used profiler evidence to identify scan-heavy upserts and verify that those entries disappeared after indexing. (high confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- Profiler delivery is best effort, and sampling can omit eligible slow operations. Absence from CloudWatch Logs therefore cannot establish that an operation was fast. (low confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- An October 2022 user report described missing slow aggregate pipelines containing $lookup while other slow operations were logged. The thread provides no confirmed cause or general proof that $lookup is unsupported. (low confidence) — [source](https://stackoverflow.com/questions/74205235/can-aws-documentdb-log-slow-aggregate-queries-containing-a-lookup-stage)
- The profiler records slow-operation duration and command details in CloudWatch Logs; logged evidence can include planSummary and client metadata. (high confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- AWS documents a default 100 ms threshold, a 50 ms minimum, and a default sampling fraction of 1.0; sampling applies to slow operations. (low confidence) (verified as of 2026-10-20) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- AWS documents best-effort delivery and requires the complete query result to fit one batch and remain under 16 MB for slow-query logging. Missing entries therefore do not prove fast execution. (low confidence) (verified as of 2026-10-20) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- In an August 2026 production account, Castañeda used slow upsert COLLSCAN records to select indexes, then reported that those slow entries stopped appearing. This is a single incident, not a general performance guarantee. (low confidence) — [source](https://leocasta.com/posts/when-every-write-reads-the-whole-collection/)

## Facts and statements

- The profiler applies across all databases and instances in a cluster. Its records include command, duration, plan summary and client metadata. (low confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- CloudWatch stores profiler output under /aws/docdb/<cluster-name>/profiler, with instance-specific streams; Logs Insights can filter and rank the resulting operations. (high confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- Profiling consumes cluster resources. Start with a higher duration threshold and lower it deliberately; low thresholds on busy clusters can increase overhead and log volume. (high confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- A November 2021 Terraform AWS provider 3.61.0 issue reported recurring profiler_sampling_rate plan differences between values '1' and '1.0'. This is historical provider behavior, not evidence of a current DocumentDB profiling defect. (low confidence) — [source](https://github.com/hashicorp/terraform-provider-aws/issues/21679)
- Profiling applies across all databases and instances in the cluster. (low confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- COLLSCAN profiler entries can identify missing indexes in update/upsert paths, not only read queries. (high confidence) — [source](https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html)
- Castañeda reports that attaching a new parameter group required instance restarts in his environment; parameter-group attachment should be evaluated separately from changing an already-active profiler parameter. (low confidence) — [source](https://leocasta.com/posts/when-every-write-reads-the-whole-collection/)
