|
| 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 | 19 | const opentelemetry = require('@opentelemetry/api'); |
4 | 20 | const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); |
5 | 21 | const { SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base'); |
6 | 22 | const { JaegerExporter } = require('@opentelemetry/exporter-jaeger'); |
7 | | -const { IORedisInstrumentation } = require('@opentelemetry/instrumentation-ioredis'); |
| 23 | +const { |
| 24 | + IORedisInstrumentation, |
| 25 | +} = require('@opentelemetry/instrumentation-ioredis'); |
8 | 26 | const { registerInstrumentations } = require('@opentelemetry/instrumentation'); |
9 | 27 |
|
10 | 28 | const exporter = new JaegerExporter({ serviceName: 'ioredis-example' }); |
11 | 29 |
|
12 | 30 | const provider = new NodeTracerProvider({ |
13 | | - spanProcessors: [ |
14 | | - new SimpleSpanProcessor(exporter), |
15 | | - ], |
| 31 | + spanProcessors: [new SimpleSpanProcessor(exporter)], |
16 | 32 | }); |
17 | 33 |
|
18 | 34 | // Initialize the OpenTelemetry APIs to use the BasicTracer bindings |
19 | 35 | provider.register(); |
20 | 36 |
|
21 | 37 | registerInstrumentations({ |
22 | | - instrumentations: [ |
23 | | - new IORedisInstrumentation(), |
24 | | - ], |
| 38 | + instrumentations: [new IORedisInstrumentation()], |
25 | 39 | tracerProvider: provider, |
26 | 40 | }); |
27 | 41 |
|
|
0 commit comments