Skip to content

Commit 1cd8ff3

Browse files
authored
Merge branch 'main' into docs-add-docker-compose-to-run-prometheus-for-experiemental-example
2 parents 92fff02 + f2b447d commit 1cd8ff3

File tree

13 files changed

+149
-40
lines changed

13 files changed

+149
-40
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
1515

1616
### :house: (Internal)
1717

18+
* chore: type reference on zone.js [#4257](https://github.com/open-telemetry/opentelemetry-js/pull/4257) @legendecas
19+
* chore: no need for 'packages' in lerna.json [#4264](https://github.com/open-telemetry/opentelemetry-js/pull/4264) @trentm
20+
21+
### :bug: (Bug Fix)
22+
1823
## 1.18.1
1924

2025
### :bug: (Bug Fix)

experimental/packages/otlp-transformer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"tdd": "npm run test -- --watch-extensions ts --watch",
2222
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
2323
"test:browser": "karma start --single-run",
24+
"test:bench": "node test/performance/benchmark/index.js | tee .benchmark-results.txt",
2425
"prewatch": "node ../../../scripts/version-update.js",
2526
"watch": "tsc --build -w tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
2627
"peer-api-check": "node ../../../scripts/peer-api-check.js",
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
const Benchmark = require('benchmark');
18+
const { createExportTraceServiceRequest } = require('../../../build/src');
19+
const { BasicTracerProvider } = require('@opentelemetry/sdk-trace-base');
20+
21+
const tracerProvider = new BasicTracerProvider();
22+
const tracer = tracerProvider.getTracer('test')
23+
24+
const suite = new Benchmark.Suite();
25+
26+
const span = createSpan();
27+
const spans = [];
28+
for (let i = 0; i < 100; i++) {
29+
spans.push(createSpan());
30+
}
31+
32+
suite.on('cycle', event => {
33+
console.log(String(event.target));
34+
});
35+
36+
suite.add('transform 1 span', function() {
37+
createExportTraceServiceRequest([span]);
38+
});
39+
40+
suite.add('transform 100 spans', function() {
41+
createExportTraceServiceRequest(spans);
42+
});
43+
44+
suite.run();
45+
46+
function createSpan() {
47+
const span = tracer.startSpan('span');
48+
span.setAttribute('aaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaa');
49+
span.setAttribute('bbbbbbbbbbbbbbbbbbbb', 'bbbbbbbbbbbbbbbbbbbb');
50+
span.setAttribute('cccccccccccccccccccc', 'cccccccccccccccccccc');
51+
span.setAttribute('dddddddddddddddddddd', 'dddddddddddddddddddd');
52+
span.setAttribute('eeeeeeeeeeeeeeeeeeee', 'eeeeeeeeeeeeeeeeeeee');
53+
span.setAttribute('ffffffffffffffffffff', 'ffffffffffffffffffff');
54+
span.setAttribute('gggggggggggggggggggg', 'gggggggggggggggggggg');
55+
span.setAttribute('hhhhhhhhhhhhhhhhhhhh', 'hhhhhhhhhhhhhhhhhhhh');
56+
span.setAttribute('iiiiiiiiiiiiiiiiiiii', 'iiiiiiiiiiiiiiiiiiii');
57+
span.setAttribute('jjjjjjjjjjjjjjjjjjjj', 'jjjjjjjjjjjjjjjjjjjj');
58+
span.end();
59+
60+
return span;
61+
}

lerna.json

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
{
22
"version": "independent",
33
"npmClient": "npm",
4-
"useWorkspaces": true,
5-
"// packages": "Please sync with package.json#workspaces",
6-
"packages": [
7-
"api",
8-
"packages/*",
9-
"experimental/packages/*",
10-
"experimental/examples/*",
11-
"experimental/backwards-compatibility/*",
12-
"integration-tests/*",
13-
"selenium-tests",
14-
"examples/otlp-exporter-node",
15-
"examples/opentelemetry-web",
16-
"examples/http",
17-
"examples/https",
18-
"examples/esm-http-ts"
19-
]
4+
"useWorkspaces": true
205
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@
102102
},
103103
"cacheDir": ".changelog"
104104
},
105-
"// workspaces": "Please sync with lerna.json#packages",
106105
"workspaces": [
107106
"api",
108107
"packages/*",

packages/opentelemetry-context-zone-peer-dep/src/ZoneContextManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
/// <reference types="zone.js" />
1718
import { Context, ContextManager, ROOT_CONTEXT } from '@opentelemetry/api';
1819
import { TargetWithEvents } from './types';
1920
import { isListenerObject } from './util';

packages/opentelemetry-context-zone-peer-dep/tsconfig.esm.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"rootDir": "src",
66
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo"
77
},
8-
"files": [
9-
"node_modules/zone.js/dist/zone.js.d.ts"
10-
],
118
"include": [
129
"src/**/*.ts"
1310
],

packages/opentelemetry-context-zone-peer-dep/tsconfig.esnext.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"rootDir": "src",
66
"tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo"
77
},
8-
"files": [
9-
"node_modules/zone.js/dist/zone.js.d.ts"
10-
],
118
"include": [
129
"src/**/*.ts"
1310
],

packages/opentelemetry-context-zone-peer-dep/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
"outDir": "build",
55
"rootDir": "."
66
},
7-
"files": [
8-
"node_modules/zone.js/dist/zone.js.d.ts"
9-
],
107
"include": [
118
"src/**/*.ts",
129
"test/**/*.ts"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
const Benchmark = require('benchmark');
18+
const { BasicTracerProvider, BatchSpanProcessor } = require('../../../build/src');
19+
const { ExportResultCode } = require('@opentelemetry/core');
20+
21+
class NoopExporter {
22+
export(spans, resultCallback) {
23+
setTimeout(() => resultCallback({ code: ExportResultCode.SUCCESS }), 0);
24+
}
25+
26+
shutdown() {
27+
return this.forceFlush();
28+
}
29+
30+
forceFlush() {
31+
return Promise.resolve();
32+
}
33+
}
34+
35+
function createSpan() {
36+
const span = tracer.startSpan('span');
37+
span.setAttribute('aaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaa');
38+
span.setAttribute('bbbbbbbbbbbbbbbbbbbb', 'aaaaaaaaaaaaaaaaaaaa');
39+
span.setAttribute('cccccccccccccccccccc', 'aaaaaaaaaaaaaaaaaaaa');
40+
span.setAttribute('dddddddddddddddddddd', 'aaaaaaaaaaaaaaaaaaaa');
41+
span.setAttribute('eeeeeeeeeeeeeeeeeeee', 'aaaaaaaaaaaaaaaaaaaa');
42+
span.setAttribute('ffffffffffffffffffff', 'aaaaaaaaaaaaaaaaaaaa');
43+
span.setAttribute('gggggggggggggggggggg', 'aaaaaaaaaaaaaaaaaaaa');
44+
span.setAttribute('hhhhhhhhhhhhhhhhhhhh', 'aaaaaaaaaaaaaaaaaaaa');
45+
span.setAttribute('iiiiiiiiiiiiiiiiiiii', 'aaaaaaaaaaaaaaaaaaaa');
46+
span.setAttribute('jjjjjjjjjjjjjjjjjjjj', 'aaaaaaaaaaaaaaaaaaaa');
47+
span.end();
48+
}
49+
50+
const tracerProvider = new BasicTracerProvider();
51+
tracerProvider.addSpanProcessor(new BatchSpanProcessor(new NoopExporter()));
52+
const tracer = tracerProvider.getTracer('test')
53+
54+
const suite = new Benchmark.Suite('BatchSpanProcessor');
55+
56+
suite.on('cycle', event => {
57+
console.log(String(event.target));
58+
});
59+
60+
suite.add('BatchSpanProcessor process span', function() {
61+
createSpan();
62+
});
63+
64+
suite.run();

0 commit comments

Comments
 (0)