Skip to content

Commit d922833

Browse files
committed
replace logs and metrics content with include files
1 parent b41aade commit d922833

27 files changed

Lines changed: 91 additions & 709 deletions

File tree

‎docs/platforms/javascript/guides/astro/index.mdx‎

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -163,46 +163,18 @@ SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
163163

164164
## Send Logs
165165

166-
Use `Sentry.logger` to send logs at different levels, such as `info`, `warn`, or `error`. You can add searchable attributes to each log.
166+
<PlatformContent includePath="getting-started-logs" />
167167

168168
If you already use `console`, capture those calls as Sentry Logs with <PlatformLink to="/logs/#console-integration">`consoleLoggingIntegration`</PlatformLink>.
169169
We also provide integrations for:
170170
- <PlatformLink to="/logs/#console-integration">Consola</PlatformLink>
171171
- <PlatformLink to="/configuration/integrations/pino/">Pino</PlatformLink>
172172

173-
See <PlatformLink to="/logs/">Set Up Logs</PlatformLink> for all available logging methods and message formatting options.
174-
175-
```javascript
176-
Sentry.logger.info("User example action completed");
177-
178-
Sentry.logger.warn("Slow operation detected", {
179-
operation: "data_fetch",
180-
duration: 3500,
181-
});
182-
183-
Sentry.logger.error("Validation failed", {
184-
form_field: "email",
185-
reason: "Invalid email",
186-
});
187-
```
188-
189173
## Send Application Metrics <FeatureBadge type="new" />
190174

191-
Use `Sentry.metrics` to send counters, gauges, and distributions from your app to Sentry. You can add searchable attributes to each metric.
192-
On Node.js, <PlatformLink to="/configuration/integrations/noderuntimemetrics/">`nodeRuntimeMetricsIntegration`</PlatformLink> also collects runtime health metrics automatically.
193-
194-
See <PlatformLink to="/metrics/">Set Up Metrics</PlatformLink> for all available metric types and configuration options.
195-
196-
```javascript
197-
Sentry.metrics.count("checkout.failed", 1);
198-
199-
Sentry.metrics.gauge("time_since_refresh", 4, { unit: "hour" });
175+
<PlatformContent includePath="getting-started-metrics" />
200176

201-
Sentry.metrics.distribution("api_latency", 187, {
202-
unit: "millisecond",
203-
attributes: { endpoint: "/api/orders" },
204-
});
205-
```
177+
On Node.js, <PlatformLink to="/configuration/integrations/noderuntimemetrics/">`nodeRuntimeMetricsIntegration`</PlatformLink> also collects runtime health metrics automatically.
206178

207179
## Verify Your Setup
208180

‎docs/platforms/javascript/guides/azure-functions/index.mdx‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -93,40 +93,18 @@ module.exports = async function (context, req) {
9393

9494
## Send Logs
9595

96-
Use `Sentry.logger` to send logs at different levels, such as `info`, `warn`, or `error`.
96+
<PlatformContent includePath="getting-started-logs" />
9797

9898
If you're already logging with another library, use an integration to capture those logs as Sentry Logs automatically:
9999
- <PlatformLink to="/logs/#console-integration">`consoleLoggingIntegration`</PlatformLink> for `console` calls
100100
- <PlatformLink to="/logs/#console-integration">Consola</PlatformLink>
101101
- <PlatformLink to="/configuration/integrations/pino/">Pino</PlatformLink>
102102

103-
See <PlatformLink to="/logs/">Set Up Logs</PlatformLink> for logging methods and message formatting.
104-
105-
```javascript
106-
Sentry.logger.info("User example action completed");
107-
108-
Sentry.logger.warn("Slow operation detected", { operation: "data_fetch", duration: 3500 });
109-
110-
Sentry.logger.error("Validation failed", { form_field: "email", reason: "Invalid email" });
111-
```
112-
113103
## Send Application Metrics <FeatureBadge type="new" />
114104

115-
Use `Sentry.metrics` to send counters, gauges, and distributions from your application to Sentry. You can pass attributes to search or filter by later.
116-
On Node.js, <PlatformLink to="/configuration/integrations/noderuntimemetrics/">`nodeRuntimeMetricsIntegration`</PlatformLink> also collects runtime health metrics automatically.
117-
118-
See <PlatformLink to="/metrics/">Set Up Metrics</PlatformLink> for metric types and configuration options.
119-
120-
```javascript
121-
Sentry.metrics.count("checkout.failed", 1);
122-
123-
Sentry.metrics.gauge("time_since_refresh", 4, { unit: "hour" });
105+
<PlatformContent includePath="getting-started-metrics" />
124106

125-
Sentry.metrics.distribution("api_latency", 187, {
126-
unit: "millisecond",
127-
attributes: { endpoint: "/api/orders" },
128-
});
129-
```
107+
On Node.js, <PlatformLink to="/configuration/integrations/noderuntimemetrics/">`nodeRuntimeMetricsIntegration`</PlatformLink> also collects runtime health metrics automatically.
130108

131109
## Verify Your Setup
132110

‎docs/platforms/javascript/guides/bun/index.mdx‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -91,40 +91,18 @@ bun --preload ./instrument.js dist/app.js
9191

9292
## Send Logs
9393

94-
Use `Sentry.logger` to send logs at different levels, such as `info`, `warn`, or `error`. You can pass attributes to search or filter by later.
94+
<PlatformContent includePath="getting-started-logs" />
9595

9696
If you're already logging with another library, use an integration to capture those logs as Sentry Logs automatically:
9797
- <PlatformLink to="/logs/#console-integration">`consoleLoggingIntegration`</PlatformLink> for `console` calls
9898
- <PlatformLink to="/logs/#console-integration">Consola</PlatformLink>
9999
- <PlatformLink to="/configuration/integrations/pino/">Pino</PlatformLink>
100100

101-
See <PlatformLink to="/logs/">Set Up Logs</PlatformLink> for logging methods and message formatting.
102-
103-
```javascript
104-
Sentry.logger.info("User example action completed");
105-
106-
Sentry.logger.warn("Slow operation detected", { operation: "data_fetch", duration: 3500 });
107-
108-
Sentry.logger.error("Validation failed", { form_field: "email", reason: "Invalid email" });
109-
```
110-
111101
## Send Application Metrics <FeatureBadge type="new" />
112102

113-
Use `Sentry.metrics` to send counters, gauges, and distributions from your application to Sentry. You can pass attributes to search or filter by later.
114-
For Bun, <PlatformLink to="/configuration/integrations/bunruntimemetrics/">`bunRuntimeMetricsIntegration`</PlatformLink> also collects runtime health metrics automatically.
115-
116-
See <PlatformLink to="/metrics/">Set Up Metrics</PlatformLink> for metric types and configuration options.
117-
118-
```javascript
119-
Sentry.metrics.count("checkout.failed", 1);
120-
121-
Sentry.metrics.gauge("time_since_refresh", 4, { unit: "hour" });
103+
<PlatformContent includePath="getting-started-metrics" />
122104

123-
Sentry.metrics.distribution("api_latency", 187, {
124-
unit: "millisecond",
125-
attributes: { endpoint: "/api/orders" },
126-
});
127-
```
105+
For Bun, <PlatformLink to="/configuration/integrations/bunruntimemetrics/">`bunRuntimeMetricsIntegration`</PlatformLink> also collects runtime health metrics automatically.
128106

129107
## Verify Your Setup
130108

‎docs/platforms/javascript/guides/capacitor/index.mdx‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -388,26 +388,10 @@ You need to provide debug information to Sentry to make the stack-trace informat
388388

389389
## Send Logs
390390

391-
Use `Sentry.logger` to send logs at different levels, such as `info`, `warn`, or `error`. You can add searchable attributes to each log.
391+
<PlatformContent includePath="getting-started-logs" />
392392

393393
If you already use `console`, capture those calls as Sentry Logs with <PlatformLink to="/logs/#console-integration">`consoleLoggingIntegration`</PlatformLink>.
394394

395-
See <PlatformLink to="/logs/">Set Up Logs</PlatformLink> for all available logging methods and message formatting options.
396-
397-
```javascript
398-
Sentry.logger.info("User example action completed");
399-
400-
Sentry.logger.warn("Slow operation detected", {
401-
operation: "data_fetch",
402-
duration: 3500,
403-
});
404-
405-
Sentry.logger.error("Validation failed", {
406-
form_field: "email",
407-
reason: "Invalid email",
408-
});
409-
```
410-
411395
## Verify Your Setup
412396

413397
Let's test your setup and confirm that Sentry is working correctly and sending data to your Sentry project.

‎docs/platforms/javascript/guides/cloudflare/index.mdx‎

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -135,36 +135,13 @@ This is expected behavior in the Cloudflare Workers environment and affects all
135135

136136
## Send Logs
137137

138-
Use `Sentry.logger` to send logs at different levels, such as `info`, `warn`, or `error`. If you're already logging with `console` or Consola, you can capture those logs with <PlatformLink to="/logs/#console-integration">our console integrations</PlatformLink>.
138+
<PlatformContent includePath="getting-started-logs" />
139139

140-
See <PlatformLink to="/logs/">Set Up Logs</PlatformLink> for logging methods and message formatting.
141-
142-
```javascript
143-
import * as Sentry from "@sentry/cloudflare";
144-
145-
Sentry.logger.info("User example action completed");
146-
147-
Sentry.logger.warn("Slow operation detected", { operation: "data_fetch", duration: 3500 });
148-
149-
Sentry.logger.error("Validation failed", { form_field: "email", reason: "Invalid email" });
150-
```
140+
If you're already logging with `console` or Consola, you can capture those logs with <PlatformLink to="/logs/#console-integration">our console integrations</PlatformLink>.
151141

152142
## Send Application Metrics <FeatureBadge type="new" />
153143

154-
Use `Sentry.metrics` to send counters, gauges, and distributions from your application to Sentry. You can pass attributes to search or filter by later.
155-
156-
See <PlatformLink to="/metrics/">Set Up Metrics</PlatformLink> for metric types and configuration options.
157-
158-
```javascript
159-
Sentry.metrics.count("checkout.failed", 1);
160-
161-
Sentry.metrics.gauge("time_since_refresh", 4, { unit: "hour" });
162-
163-
Sentry.metrics.distribution("api_latency", 187, {
164-
unit: "millisecond",
165-
attributes: { endpoint: "/api/orders" },
166-
});
167-
```
144+
<PlatformContent includePath="getting-started-metrics" />
168145

169146
## Verify Your Setup
170147

‎docs/platforms/javascript/guides/deno/index.mdx‎

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -107,36 +107,15 @@ If you omit `--allow-read` or `--allow-sys`, the SDK sends events without that d
107107

108108
## Send Logs
109109

110-
Use `Sentry.logger` to send logs at different levels, such as `info`, `warn`, or `error`. You can pass attributes to search or filter by later.
111-
If you're already logging with `console` or Consola, you can capture those logs with <PlatformLink to="/logs/#console-integration">our console integrations</PlatformLink>.
112-
113-
See <PlatformLink to="/logs/">Set Up Logs</PlatformLink> for logging methods and message formatting.
114-
115-
```javascript
116-
Sentry.logger.info("User example action completed");
110+
<PlatformContent includePath="getting-started-logs" />
117111

118-
Sentry.logger.warn("Slow operation detected", { operation: "data_fetch", duration: 3500 });
119-
120-
Sentry.logger.error("Validation failed", { form_field: "email", reason: "Invalid email" });
121-
```
112+
If you're already logging with `console` or Consola, you can capture those logs with <PlatformLink to="/logs/#console-integration">our console integrations</PlatformLink>.
122113

123114
## Send Application Metrics <FeatureBadge type="new" />
124115

125-
Use `Sentry.metrics` to send counters, gauges, and distributions from your application to Sentry. You can pass attributes to search or filter by later.
126-
For Deno, <PlatformLink to="/configuration/integrations/denoruntimemetrics/">`denoRuntimeMetricsIntegration`</PlatformLink> also collects runtime health metrics automatically.
116+
<PlatformContent includePath="getting-started-metrics" />
127117

128-
See <PlatformLink to="/metrics/">Set Up Metrics</PlatformLink> for metric types and configuration options.
129-
130-
```javascript
131-
Sentry.metrics.count("checkout.failed", 1);
132-
133-
Sentry.metrics.gauge("time_since_refresh", 4, { unit: "hour" });
134-
135-
Sentry.metrics.distribution("api_latency", 187, {
136-
unit: "millisecond",
137-
attributes: { endpoint: "/api/orders" },
138-
});
139-
```
118+
For Deno, <PlatformLink to="/configuration/integrations/denoruntimemetrics/">`denoRuntimeMetricsIntegration`</PlatformLink> also collects runtime health metrics automatically.
140119

141120
## Verify Your Setup
142121

‎docs/platforms/javascript/guides/effect/index.mdx‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -215,20 +215,7 @@ const program = Effect.gen(function* () {
215215

216216
## Send Application Metrics <FeatureBadge type="new" />
217217

218-
Use `Sentry.metrics` to send counters, gauges, and distributions from your application to Sentry. You can pass attributes to search or filter by later.
219-
220-
See <PlatformLink to="/metrics/">Set Up Metrics</PlatformLink> for metric types and configuration options.
221-
222-
```javascript
223-
Sentry.metrics.count("checkout.failed", 1);
224-
225-
Sentry.metrics.gauge("time_since_refresh", 4, { unit: "hour" });
226-
227-
Sentry.metrics.distribution("api_latency", 187, {
228-
unit: "millisecond",
229-
attributes: { endpoint: "/api/orders" },
230-
});
231-
```
218+
<PlatformContent includePath="getting-started-metrics" />
232219

233220
## Verify Your Setup
234221

‎docs/platforms/javascript/guides/electron/index.mdx‎

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -168,45 +168,16 @@ init(
168168

169169
## Send Logs
170170

171-
Use `Sentry.logger` to send logs at different levels, such as `info`, `warn`, or `error`. You can add searchable attributes to each log.
171+
<PlatformContent includePath="getting-started-logs" />
172172

173173
If you're already logging with another library, use an integration to capture those logs as Sentry Logs automatically:
174174
- <PlatformLink to="/logs/#console-integration">`consoleLoggingIntegration`</PlatformLink> for `console` calls
175175
- <PlatformLink to="/logs/#console-integration">Consola</PlatformLink>
176176
- <PlatformLink to="/configuration/integrations/pino/">Pino</PlatformLink>
177177

178-
See <PlatformLink to="/logs/">Set Up Logs</PlatformLink> for all available logging methods and message formatting options.
179-
180-
```javascript
181-
Sentry.logger.info("User example action completed");
182-
183-
Sentry.logger.warn("Slow operation detected", {
184-
operation: "data_fetch",
185-
duration: 3500,
186-
});
187-
188-
Sentry.logger.error("Validation failed", {
189-
form_field: "email",
190-
reason: "Invalid email",
191-
});
192-
```
193-
194178
## Send Application Metrics <FeatureBadge type="new" />
195179

196-
Use `Sentry.metrics` to send counters, gauges, and distributions from your app to Sentry. You can add searchable attributes to each metric.
197-
198-
See <PlatformLink to="/metrics/">Set Up Metrics</PlatformLink> for all available metric types and configuration options.
199-
200-
```javascript
201-
Sentry.metrics.count("checkout.failed", 1);
202-
203-
Sentry.metrics.gauge("time_since_refresh", 4, { unit: "hour" });
204-
205-
Sentry.metrics.distribution("api_latency", 187, {
206-
unit: "millisecond",
207-
attributes: { endpoint: "/api/orders" },
208-
});
209-
```
180+
<PlatformContent includePath="getting-started-metrics" />
210181

211182
## Verify Your Setup
212183

‎docs/platforms/javascript/guides/elysia/index.mdx‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -124,35 +124,13 @@ const app = Sentry.withElysia(new Elysia(), {
124124

125125
## Send Logs
126126

127-
Use `Sentry.logger` to send logs at different levels, such as `info`, `warn`, or `error`. You can pass attributes to search or filter by later.
128-
If you're already logging with `console` or Consola, you can capture those logs with <PlatformLink to="/logs/#console-integration">our console integrations</PlatformLink>.
129-
130-
See <PlatformLink to="/logs/">Set Up Logs</PlatformLink> for logging methods and message formatting.
131-
132-
```javascript
133-
Sentry.logger.info("User example action completed");
127+
<PlatformContent includePath="getting-started-logs" />
134128

135-
Sentry.logger.warn("Slow operation detected", { operation: "data_fetch", duration: 3500 });
136-
137-
Sentry.logger.error("Validation failed", { form_field: "email", reason: "Invalid email" });
138-
```
129+
If you're already logging with `console` or Consola, you can capture those logs with <PlatformLink to="/logs/#console-integration">our console integrations</PlatformLink>.
139130

140131
## Send Application Metrics <FeatureBadge type="new" />
141132

142-
Use `Sentry.metrics` to send counters, gauges, and distributions from your application to Sentry. You can pass attributes to search or filter by later.
143-
144-
See <PlatformLink to="/metrics/">Set Up Metrics</PlatformLink> for metric types and configuration options.
145-
146-
```javascript
147-
Sentry.metrics.count("checkout.failed", 1);
148-
149-
Sentry.metrics.gauge("time_since_refresh", 4, { unit: "hour" });
150-
151-
Sentry.metrics.distribution("api_latency", 187, {
152-
unit: "millisecond",
153-
attributes: { endpoint: "/api/orders" },
154-
});
155-
```
133+
<PlatformContent includePath="getting-started-metrics" />
156134

157135
## Verify Your Setup
158136

0 commit comments

Comments
 (0)