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 { HostMetrics } = require ( '@opentelemetry/host-metrics' ) ;
420// const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus');
521const { MeterProvider } = require ( '@opentelemetry/sdk-metrics-base' ) ;
6- const { CollectorMetricExporter } = require ( '@opentelemetry/exporter-collector' ) ;
22+ const {
23+ CollectorMetricExporter,
24+ } = require ( '@opentelemetry/exporter-collector' ) ;
725
826const exporter = new CollectorMetricExporter ( {
927 headers : { } ,
@@ -26,10 +44,13 @@ const meterProvider = new MeterProvider({
2644 interval : 2000 ,
2745} ) ;
2846
29- const hostMetrics = new HostMetrics ( { meterProvider, name : 'example-host-metrics' } ) ;
47+ const hostMetrics = new HostMetrics ( {
48+ meterProvider,
49+ name : 'example-host-metrics' ,
50+ } ) ;
3051hostMetrics . start ( ) ;
3152
3253// keep running
3354( function wait ( ) {
3455 setTimeout ( wait , 1000 ) ;
35- } ( ) ) ;
56+ } ) ( ) ;
0 commit comments