Skip to content

Commit

Permalink
docs: Updated formatting of cloud-providers.md (#2538)
Browse files Browse the repository at this point in the history
  • Loading branch information
bizob2828 authored Sep 3, 2024
1 parent 6553807 commit f004ebf
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions documentation/nextjs/faqs/cloud-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,24 @@ npm @opentelemetry/api @opentelemetry/auto-instrumentations-node @opentelemetry/
3. Setup OpenTelemetry configuration in `new-relic-instrumentation.js`
```js
const opentelemetry = require('@opentelemetry/sdk-node');
const {
getNodeAutoInstrumentations,
} = require('@opentelemetry/auto-instrumentations-node');
const {
OTLPTraceExporter,
} = require('@opentelemetry/exporter-trace-otlp-proto');
const {
OTLPMetricExporter,
} = require('@opentelemetry/exporter-metrics-otlp-proto');
const { PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics');
const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api');
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
const opentelemetry = require('@opentelemetry/sdk-node')
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node')
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-proto')
const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-proto')
const { PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics')
const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api')
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO)
const sdk = new opentelemetry.NodeSDK({
traceExporter: new OTLPTraceExporter(),
metricReader: new PeriodicExportingMetricReader({
exporter: new OTLPMetricExporter(),
}),
instrumentations: [getNodeAutoInstrumentations()],
});
instrumentations: [getNodeAutoInstrumentations()]
})
sdk.start();
sdk.start()
```
4. Add the following to `instrumentation.ts` in the root of your Next.js project:
Expand Down

0 comments on commit f004ebf

Please sign in to comment.