Skip to content

Commit 394f740

Browse files
[Containers] Document per-container observability in Wrangler
Document `containers[].observability` for Wrangler Containers. Add the new container-level observability fields to the Wrangler configuration reference, including root `observability` fallback, per-container override behavior, and the targeting fields. Also update the Containers FAQ and pricing docs to clarify that logs can be enabled either at the Worker level or per container.
1 parent 738a281 commit 394f740

4 files changed

Lines changed: 99 additions & 6 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Configure observability per container application
3+
description: Set observability for individual container applications in Wrangler.
4+
products:
5+
- containers
6+
date: 2026-09-18
7+
---
8+
9+
import { WranglerConfig } from "~/components";
10+
11+
You can now configure observability for each container application when you deploy [Containers](/containers/) with [Wrangler](/workers/wrangler/). This lets you change logging for one container without changing the rest of your Worker.
12+
13+
If you omit `containers[].observability`, Wrangler uses the top-level `observability` setting for that container. If you set it, the container setting overrides the top-level setting.
14+
15+
Use `target_instance_percentage` or `target_instance_count` to apply an observability change to a subset of running instances.
16+
17+
<WranglerConfig>
18+
19+
```jsonc
20+
{
21+
"observability": {
22+
"enabled": false,
23+
},
24+
"containers": [
25+
{
26+
"class_name": "MyContainer",
27+
"image": "./Dockerfile",
28+
"observability": {
29+
"enabled": true,
30+
"target_instance_percentage": 25,
31+
},
32+
},
33+
],
34+
}
35+
```
36+
37+
</WranglerConfig>
38+
39+
For more information about Workers Logs, refer to [Workers Logs](/workers/observability/logs/workers-logs/).

src/content/docs/containers/faq.mdx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ import { Render, WranglerConfig } from "~/components";
1212

1313
## How do Container logs work?
1414

15-
To get logs in the Dashboard, including live tailing of logs, toggle `observability` to true
16-
in your Worker's wrangler config:
15+
To get logs in the Dashboard, including live tailing of logs, enable observability in
16+
your Wrangler config.
17+
18+
You can enable it at the Worker level, which applies to containers by default:
1719

1820
<WranglerConfig>
1921

20-
```json
22+
```jsonc
2123
{
2224
"observability": {
2325
"enabled": true
@@ -27,6 +29,29 @@ in your Worker's wrangler config:
2729

2830
</WranglerConfig>
2931

32+
You can also configure observability per container:
33+
34+
<WranglerConfig>
35+
36+
```jsonc
37+
{
38+
"containers": [
39+
{
40+
"class_name": "MyContainer",
41+
"image": "./Dockerfile",
42+
"observability": {
43+
"enabled": true
44+
}
45+
}
46+
]
47+
}
48+
```
49+
50+
</WranglerConfig>
51+
52+
If a container sets `observability` in its container entry, it overrides the top-level
53+
`observability` setting for that container.
54+
3055
Logs are subject to the same [limits as Worker logs](/workers/observability/logs/workers-logs/#limits), which means that they are
3156
retained for 3 days on Free plans and 7 days on Paid plans.
3257

src/content/docs/containers/platform/pricing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ When you use Containers, incoming requests to your containers are handled by you
5353

5454
Containers are integrated with the [Workers Logs](/workers/observability/logs/workers-logs/) platform, and billed at the same rate. Refer to [Workers Logs pricing](/workers/observability/logs/workers-logs/#pricing) for details.
5555

56-
When you [enable observability for your Worker](/workers/observability/logs/workers-logs/#enable-workers-logs) with a binding to a container, logs from your container will show in both the Containers and Observability sections of the Cloudflare dashboard.
56+
When you [enable observability for your Worker](/workers/observability/logs/workers-logs/#enable-workers-logs), or configure `observability` on a specific container, logs from that container will show in both the Containers and Observability sections of the Cloudflare dashboard.

src/content/docs/workers/wrangler/configuration.mdx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,10 @@ Example:
400400

401401
The [Observability](/workers/observability/logs/workers-logs) setting allows you to automatically ingest, store, filter, and analyze logging data emitted from Cloudflare Workers directly from your Cloudflare Worker's dashboard.
402402

403-
- `enabled` <Type text="boolean" /> <MetaInfo text="required" />
404-
- When set to `true` on a Worker, logs for the Worker are persisted. Defaults to `true` for all new Workers.
403+
- `enabled` <Type text="boolean" /> <MetaInfo text="optional" />
404+
- Shorthand for `logs.enabled`. When set to `true` on a Worker, logs for the Worker are persisted. Defaults to `true` for all new Workers.
405+
- `logs.enabled` <Type text="boolean" /> <MetaInfo text="optional" />
406+
- Whether logs for the Worker are persisted.
405407
- `head_sampling_rate` <Type text="number" /> <MetaInfo text="optional" />
406408
- A number between 0 and 1, where 0 indicates zero out of one hundred requests are logged, and 1 indicates every request is logged. If `head_sampling_rate` is unspecified, it is configured to a default value of 1 (100%). Read more about [head-based sampling](/workers/observability/logs/workers-logs/#head-based-sampling).
407409

@@ -1305,6 +1307,29 @@ The following options are available:
13051307
- `constraints.jurisdiction` <Type text="string" /> <MetaInfo text="optional" />
13061308
- Restrict containers to compliance boundaries. Valid values: `"eu"`, `"fedramp"`.
13071309

1310+
- `observability` <Type text="object" /> <MetaInfo text="optional" />
1311+
- Configures observability for this container application when deploying with `wrangler deploy`.
1312+
- If omitted, Wrangler uses the top-level [`observability`](#observability) setting as a fallback for that container.
1313+
- If set, it overrides the top-level `observability` setting for that container.
1314+
1315+
- `observability.enabled` <Type text="boolean" /> <MetaInfo text="optional" />
1316+
- Shorthand for `observability.logs.enabled`.
1317+
1318+
- `observability.logs.enabled` <Type text="boolean" /> <MetaInfo text="optional" />
1319+
- Whether logs for this container are persisted to Cloudflare's observability platform.
1320+
1321+
- `observability.target_instance_percentage` <Type text="number" /> <MetaInfo text="optional" />
1322+
- Apply application-level observability changes to this percentage of running instances.
1323+
- Must be an integer from `1` to `99`.
1324+
- Cannot be used with `observability.target_instance_count`.
1325+
- Requires observability to be enabled for the container.
1326+
1327+
- `observability.target_instance_count` <Type text="number" /> <MetaInfo text="optional" />
1328+
- Apply application-level observability changes to this many running instances.
1329+
- Must be a positive integer.
1330+
- Cannot be used with `observability.target_instance_percentage`.
1331+
- Requires observability to be enabled for the container.
1332+
13081333
<WranglerConfig>
13091334

13101335
```jsonc
@@ -1315,6 +1340,10 @@ The following options are available:
13151340
"image": "./Dockerfile",
13161341
"max_instances": 10,
13171342
"instance_type": "basic", // Optional, defaults to "lite"
1343+
"observability": {
1344+
"enabled": true,
1345+
"target_instance_percentage": 25,
1346+
},
13181347
"image_vars": {
13191348
"FOO": "BAR",
13201349
},

0 commit comments

Comments
 (0)