|
| 1 | +/* |
| 2 | + * Copyright The OpenTelemetry Authors |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
1 | 17 | 'use strict'; |
2 | 18 |
|
3 | | -const { |
4 | | - diag, |
5 | | - DiagConsoleLogger, |
6 | | - DiagLogLevel, |
7 | | -} = require('@opentelemetry/api'); |
| 19 | +const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api'); |
8 | 20 |
|
9 | 21 | diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.WARN); |
10 | 22 |
|
11 | 23 | const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http'); |
12 | | -const { FastifyInstrumentation } = require('@opentelemetry/instrumentation-fastify'); |
| 24 | +const { |
| 25 | + FastifyInstrumentation, |
| 26 | +} = require('@opentelemetry/instrumentation-fastify'); |
13 | 27 |
|
14 | | -const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-proto'); |
15 | | -const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-proto'); |
| 28 | +const { |
| 29 | + OTLPTraceExporter, |
| 30 | +} = require('@opentelemetry/exporter-trace-otlp-proto'); |
| 31 | +const { |
| 32 | + OTLPMetricExporter, |
| 33 | +} = require('@opentelemetry/exporter-metrics-otlp-proto'); |
16 | 34 | const { NodeSDK, metrics } = require('@opentelemetry/sdk-node'); |
17 | 35 |
|
18 | 36 | const sdk = new NodeSDK({ |
19 | | - instrumentations: [ |
20 | | - HttpInstrumentation, |
21 | | - new FastifyInstrumentation(), |
22 | | - ], |
| 37 | + instrumentations: [HttpInstrumentation, new FastifyInstrumentation()], |
23 | 38 | traceExporter: new OTLPTraceExporter(), |
24 | 39 | metricReader: new metrics.PeriodicExportingMetricReader({ |
25 | 40 | exporter: new OTLPMetricExporter(), |
|
0 commit comments