Skip to content

Commit 7ecc8e7

Browse files
authored
chore(examples): lint examples/fastify using shared top-level eslint config (#2896)
Also drop having a package-lock.json to align with the other examples packages. Refs: #2891
1 parent 3d10620 commit 7ecc8e7

File tree

7 files changed

+98
-4097
lines changed

7 files changed

+98
-4097
lines changed

examples/fastify/.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
17+
'use strict';
18+
19+
const baseConfig = require('../../eslint.config');
20+
21+
module.exports = {
22+
...baseConfig,
23+
env: {
24+
node: true,
25+
},
26+
};

examples/fastify/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

examples/fastify/client.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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

319
const api = require('@opentelemetry/api');

examples/fastify/opentelemetry.js

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
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

3-
const {
4-
diag,
5-
DiagConsoleLogger,
6-
DiagLogLevel,
7-
} = require('@opentelemetry/api');
19+
const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api');
820

921
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.WARN);
1022

1123
const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http');
12-
const { FastifyInstrumentation } = require('@opentelemetry/instrumentation-fastify');
24+
const {
25+
FastifyInstrumentation,
26+
} = require('@opentelemetry/instrumentation-fastify');
1327

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');
1634
const { NodeSDK, metrics } = require('@opentelemetry/sdk-node');
1735

1836
const sdk = new NodeSDK({
19-
instrumentations: [
20-
HttpInstrumentation,
21-
new FastifyInstrumentation(),
22-
],
37+
instrumentations: [HttpInstrumentation, new FastifyInstrumentation()],
2338
traceExporter: new OTLPTraceExporter(),
2439
metricReader: new metrics.PeriodicExportingMetricReader({
2540
exporter: new OTLPMetricExporter(),

0 commit comments

Comments
 (0)