Skip to content

Commit e67f2e0

Browse files
committed
Refactor observability documentation to replace Tabs and TabItem components with WranglerConfig for improved clarity and consistency in presenting configuration examples. This update streamlines the guide for exporting OpenTelemetry data to Grafana Cloud, ensuring users have a unified format for configuration across different sections.
1 parent 1005ce9 commit e67f2e0

File tree

3 files changed

+16
-82
lines changed

3 files changed

+16
-82
lines changed

src/content/docs/workers/observability/exporting-opentelemetry-data/grafana-cloud.mdx

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ title: Export to Grafana Cloud
44
sidebar:
55
order: 2
66
---
7-
8-
import { Tabs, TabItem } from "~/components";
7+
import {WranglerConfig} from "~/components";
98

109
Grafana Cloud is a fully managed observability platform that provides visualization, alerting, and analytics for your telemetry data. By exporting your Cloudflare Workers telemetry to Grafana Cloud, you can:
1110
- Visualize distributed traces in **Grafana Tempo** to understand request flows and performance bottlenecks
@@ -45,10 +44,9 @@ Before you begin, ensure you have:
4544

4645
With your destination created in the Cloudflare dashboard, update your Worker's configuration to enable telemetry export.
4746

48-
<Tabs>
49-
<TabItem label="wrangler.jsonc">
47+
<WranglerConfig>
5048

51-
```jsonc title="wrangler.jsonc"
49+
```json
5250
{
5351
"observability": {
5452
"traces": {
@@ -65,23 +63,7 @@ With your destination created in the Cloudflare dashboard, update your Worker's
6563
}
6664
```
6765

68-
</TabItem>
69-
<TabItem label="wrangler.toml">
70-
71-
```toml title="wrangler.toml"
72-
[observability.traces]
73-
enabled = true
74-
# Must match the destination name in the dashboard
75-
destinations = ["grafana-traces"]
76-
77-
[observability.logs]
78-
enabled = true
79-
# Must match the destination name in the dashboard
80-
destinations = ["grafana-logs"]
81-
```
82-
83-
</TabItem>
84-
</Tabs>
66+
</WranglerConfig>
8567

8668
After updating your configuration, deploy your Worker for the changes to take effect.
8769

src/content/docs/workers/observability/exporting-opentelemetry-data/index.mdx

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 5
66
---
77

8-
import { Badge, DirectoryListing, Tabs, TabItem } from "~/components";
8+
import { Badge, DirectoryListing, WranglerConfig } from "~/components";
99

1010
Cloudflare Workers supports exporting OpenTelemetry (OTel)-compliant telemetry data to any destination with an available OTel endpoint, allowing you to integrate with your existing monitoring and observability stack.
1111

@@ -44,10 +44,9 @@ To start sending data to your destination, you'll need to create a destination i
4444

4545
After setting up destinations in the dashboard, configure your Worker to export telemetry data by updating your Wrangler configuration. Your destination name configured in your configuration file should be the same as the destination configured in the dashboard.
4646

47-
<Tabs>
48-
<TabItem label="wrangler.jsonc">
47+
<WranglerConfig>
4948

50-
```jsonc title="wrangler.jsonc"
49+
```json
5150
{
5251
"observability": {
5352
"traces": {
@@ -66,25 +65,7 @@ After setting up destinations in the dashboard, configure your Worker to export
6665
}
6766
```
6867

69-
</TabItem>
70-
<TabItem label="wrangler.toml">
71-
72-
```toml title="wrangler.toml"
73-
[observability.traces]
74-
enabled = true
75-
destinations = ["tracing-destination-name"]
76-
# traces sample rate of 5%
77-
head_sampling_rate = 0.05
78-
79-
[observability.logs]
80-
enabled = true
81-
destinations = ["logs-destination-name"]
82-
# logs sample rate of 60%
83-
head_sampling_rate = 0.6
84-
```
85-
86-
</TabItem>
87-
</Tabs>
68+
</WranglerConfig>
8869

8970
Once you've configured your Wrangler configuration file, redeploy your Worker for new configurations to take effect. Note that it may take a few minutes for events to reach your destination.
9071

src/content/docs/workers/observability/traces/index.mdx

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 3
66

77
---
8-
import { Tabs, TabItem } from "~/components";
8+
import { WranglerConfig } from "~/components";
99

1010
### What is Workers tracing?
1111

@@ -31,33 +31,21 @@ While our work for automatic instrumentation is ongoing, we've [documented](/wor
3131

3232
To view traces in the Workers dashboard, set the following in your Wrangler configuration file:
3333

34-
<Tabs>
35-
<TabItem label="wrangler.jsonc">
34+
<WranglerConfig>
3635

37-
```jsonc title="wrangler.jsonc"
36+
```json
3837
{
3938
"observability": {
4039
"traces": {
4140
"enabled": true,
4241
// optional sampling rate
43-
"head_sampling_rate": .05
42+
"head_sampling_rate": 0.05
4443
}
4544
}
4645
}
4746
```
4847

49-
</TabItem>
50-
<TabItem label="wrangler.toml">
51-
52-
```toml title="wrangler.toml"
53-
[observability.traces]
54-
enabled = true
55-
# optional sampling rate
56-
head_sampling_rate = 0.05
57-
```
58-
59-
</TabItem>
60-
</Tabs>
48+
</WranglerConfig>
6149

6250
Or if you have already set `observability.enabled = true` in your wrangler configuration file, tracing **and** logs will be automatically enabled.
6351

@@ -72,10 +60,9 @@ With head-based sampling, you can trace a percentage of incoming requests in you
7260

7361
The valid sampling range is from 0 to 1, where 0 indicates zero out of one hundred invocations will be traced, and 1 indicates every requests will be traced. If `head_sampling_rate` is unspecified, it defaults to tracing 100% of requests.
7462

75-
<Tabs>
76-
<TabItem label="wrangler.jsonc">
63+
<WranglerConfig>
7764

78-
```jsonc title="wrangler.jsonc"
65+
```json
7966
{
8067
"observability": {
8168
"traces": {
@@ -92,23 +79,7 @@ The valid sampling range is from 0 to 1, where 0 indicates zero out of one hundr
9279
}
9380
```
9481

95-
</TabItem>
96-
<TabItem label="wrangler.toml">
97-
98-
```toml title="wrangler.toml"
99-
[observability.traces]
100-
enabled = true
101-
# set tracing sampling rate to 5%
102-
head_sampling_rate = 0.05
103-
104-
[observability.logs]
105-
enabled = true
106-
# set logging sampling rate to 60%
107-
head_sampling_rate = 0.6
108-
```
109-
110-
</TabItem>
111-
</Tabs>
82+
</WranglerConfig>
11283

11384
If you have `head_sampling_rate` configured specifically for logs, you can also create a separate rate for traces.
11485

0 commit comments

Comments
 (0)