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+
117'use strict' ;
218
319const opentelemetry = require ( '@opentelemetry/api' ) ;
@@ -12,7 +28,9 @@ const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
1228const { SimpleSpanProcessor } = require ( '@opentelemetry/sdk-trace-base' ) ;
1329const { CollectorTraceExporter } = require ( '@opentelemetry/exporter-collector' ) ;
1430
15- const { ConnectInstrumentation } = require ( '@opentelemetry/instrumentation-connect' ) ;
31+ const {
32+ ConnectInstrumentation,
33+ } = require ( '@opentelemetry/instrumentation-connect' ) ;
1634const { HttpInstrumentation } = require ( '@opentelemetry/instrumentation-http' ) ;
1735
1836function log ( ) {
@@ -21,15 +39,13 @@ function log() {
2139 console . log . apply ( this , args ) ;
2240}
2341
24- module . exports = ( serviceName ) => {
42+ module . exports = serviceName => {
2543 const exporter = new CollectorTraceExporter ( ) ;
2644 const provider = new NodeTracerProvider ( {
2745 resource : new Resource ( {
2846 [ ATTR_SERVICE_NAME ] : serviceName ,
2947 } ) ,
30- spanProcessors : [
31- new SimpleSpanProcessor ( exporter ) ,
32- ] ,
48+ spanProcessors : [ new SimpleSpanProcessor ( exporter ) ] ,
3349 } ) ;
3450 const connectInstrumentation = new ConnectInstrumentation ( ) ;
3551 registerInstrumentations ( {
0 commit comments