Skip to content

Commit

Permalink
Merge branch 'main' into http-add-custom-metric-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
klippx authored Oct 1, 2023
2 parents 0525942 + c84698d commit 039228a
Show file tree
Hide file tree
Showing 98 changed files with 1,032 additions and 876 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Benchmark Tests

on:
push:
branches: [ main ]

jobs:
benchmark-tests:
strategy:
fail-fast: false
matrix:
node_version:
- "18"
runs-on: self-hosted
timeout-minutes: 10
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}

- run: npm install -g npm@latest

- name: restore lerna
id: cache
uses: actions/cache@v3
with:
path: |
node_modules
package-lock.json
packages/*/node_modules
packages/*/package-lock.json
experimental/packages/*/node_modules
experimental/packages/*/package-lock.json
key: node-tests-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022

- name: Bootstrap
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
- name: Build 🔧
run: |
npm run compile
- name: Benchmark tests
run: |
npm run test:bench
find . -name benchmarks.txt -exec cat {} + > combined_benchmarks.txt
- name: Store benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'benchmarkjs'
output-file-path: combined_benchmarks.txt
gh-pages-branch: gh-pages
github-token: ${{ secrets.GITHUB_TOKEN }}
benchmark-data-dir-path: "benchmarks"
auto-push: true
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
### :bug: (Bug Fix)

* fix(sdk-metrics): allow instrument names to contain '/' [#4155](https://github.com/open-telemetry/opentelemetry-js/pull/4155)
* fix(sdk-metrics): do not report empty scopes and metrics [#4135](https://github.com/open-telemetry/opentelemetry-js/pull/4135) @pichlermarc
* Instruments that were created, but did not have measurements will not be exported anymore
* Meters (Scopes) that were created, but did not have any instruments with measurements under them will not be exported anymore.
* fix(exporter-zipkin): round duration to the nearest int in annotations to be compliant with zipkin protocol [#4167](https://github.com/open-telemetry/opentelemetry-js/pull/4167) @FelipeEmerim

### :books: (Refine Doc)

### :house: (Internal)

* test: added a performance benchmark test for span creation [#4105](https://github.com/open-telemetry/opentelemetry-js/pull/4105)
* test: added a workflow to run performance benchmark tests automatically [#4144](https://github.com/open-telemetry/opentelemetry-js/pull/4144)

## 1.17.0

Expand Down
6 changes: 3 additions & 3 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
"access": "public"
},
"devDependencies": {
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.2",
"@types/node": "18.6.5",
"@types/sinon": "10.0.16",
"@types/webpack": "4.41.33",
"@types/sinon": "10.0.17",
"@types/webpack": "4.41.34",
"@types/webpack-env": "1.16.3",
"codecov": "3.8.3",
"cross-var": "1.1.0",
Expand Down
4 changes: 4 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ All notable changes to experimental packages in this project will be documented
* fix(sdk-node): remove explicit dependency on @opentelemetry/exporter-jaeger
* '@opentelemetry/exporter-jaeger' is no longer be a dependency of this package. To continue using '@opentelemetry/exporter-jaeger', please install it manually.
* NOTE: `@opentelemetry/exporter-jaeger` is deprecated, consider switching to one of the alternatives described [here](https://www.npmjs.com/package/@opentelemetry/exporter-jaeger)
* fix(sdk-logs): hide internal methods with internal shared state [#3865](https://github.com/open-telemetry/opentelemetry-js/pull/3865) @legendecas

### :rocket: (Enhancement)

Expand All @@ -20,6 +21,8 @@ All notable changes to experimental packages in this project will be documented

### :bug: (Bug Fix)

* fix(otlp-exporter-base): replaced usage of window with _globalThis [#4157](https://github.com/open-telemetry/opentelemetry-js/pull/4157) @cristianmadularu

### :books: (Refine Doc)

### :house: (Internal)
Expand Down Expand Up @@ -53,6 +56,7 @@ All notable changes to experimental packages in this project will be documented

### :bug: (Bug Fix)

* fix(otlp-transformer): Avoid precision loss when converting from HrTime to unix nanoseconds. [#4062](https://github.com/open-telemetry/opentelemetry-js/pull/4062)
* fix(exporter-logs-otlp-http): add @opentelemetry/api-logs as dependency

## 0.41.2
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/api-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@opentelemetry/api": "^1.0.0"
},
"devDependencies": {
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.2",
"@types/node": "18.6.5",
"@types/webpack-env": "1.16.3",
"babel-plugin-istanbul": "6.1.1",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/api-logs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@opentelemetry/api": "^1.0.0"
},
"devDependencies": {
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.2",
"@types/node": "18.6.5",
"@types/webpack-env": "1.16.3",
"babel-plugin-istanbul": "6.1.1",
Expand Down
4 changes: 2 additions & 2 deletions experimental/packages/exporter-logs-otlp-grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"@opentelemetry/api-logs": "0.43.0",
"@opentelemetry/otlp-exporter-base": "0.43.0",
"@opentelemetry/resources": "1.17.0",
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.2",
"@types/node": "18.6.5",
"@types/sinon": "10.0.16",
"@types/sinon": "10.0.17",
"codecov": "3.8.3",
"cpx": "1.5.0",
"cross-var": "1.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function ensureExportedLogRecordIsCorrect(logRecord: ILogRecord) {
ensureExportedAttributesAreCorrect(logRecord.attributes);
assert.strictEqual(
logRecord.timeUnixNano,
'1680253513123241728',
'1680253513123241635',
'timeUnixNano is wrong'
);
assert.strictEqual(
Expand Down
4 changes: 2 additions & 2 deletions experimental/packages/exporter-logs-otlp-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@opentelemetry/resources": "1.17.0",
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.2",
"@types/node": "18.6.5",
"@types/sinon": "10.0.16",
"@types/sinon": "10.0.17",
"@types/webpack-env": "1.16.3",
"babel-loader": "8.3.0",
"babel-plugin-istanbul": "6.1.1",
Expand Down
14 changes: 10 additions & 4 deletions experimental/packages/exporter-logs-otlp-http/test/logHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Resource } from '@opentelemetry/resources';
import * as assert from 'assert';
import { VERSION } from '@opentelemetry/core';
import {
hrTimeToFixed64Nanos,
IAnyValue,
IExportLogsServiceRequest,
IKeyValue,
Expand Down Expand Up @@ -76,17 +77,22 @@ export function ensureExportedBodyIsCorrect(body?: IAnyValue) {
);
}

function hrTimeToFixed64(hrTime: HrTime) {
const { low, high } = hrTimeToFixed64Nanos(hrTime);
return { low, high };
}

export function ensureExportedLogRecordIsCorrect(logRecord: ILogRecord) {
ensureExportedBodyIsCorrect(logRecord.body);
ensureExportedAttributesAreCorrect(logRecord.attributes);
assert.strictEqual(
assert.deepStrictEqual(
logRecord.timeUnixNano,
1680253513123241700,
hrTimeToFixed64(mockedReadableLogRecord.hrTime),
'timeUnixNano is wrong'
);
assert.strictEqual(
assert.deepStrictEqual(
logRecord.observedTimeUnixNano,
1680253513123241700,
hrTimeToFixed64(mockedReadableLogRecord.hrTimeObserved),
'observedTimeUnixNano is wrong'
);
assert.strictEqual(
Expand Down
4 changes: 2 additions & 2 deletions experimental/packages/exporter-logs-otlp-proto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
"devDependencies": {
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.2",
"@types/node": "18.6.5",
"@types/sinon": "10.0.16",
"@types/sinon": "10.0.17",
"babel-plugin-istanbul": "6.1.1",
"codecov": "3.8.3",
"cpx": "1.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ export function ensureExportedLogRecordIsCorrect(logRecord: ILogRecord) {
ensureExportedAttributesAreCorrect(logRecord.attributes);
assert.strictEqual(
logRecord.timeUnixNano,
'1680253513123241728',
'1680253513123241635',
'timeUnixNano is wrong'
);
assert.strictEqual(
logRecord.observedTimeUnixNano,
'1680253513123241728',
'1680253513123241635',
'observedTimeUnixNano is wrong'
);
assert.strictEqual(
Expand Down
4 changes: 2 additions & 2 deletions experimental/packages/exporter-trace-otlp-grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"@grpc/proto-loader": "^0.7.3",
"@opentelemetry/api": "1.6.0",
"@opentelemetry/otlp-exporter-base": "0.43.0",
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.2",
"@types/node": "18.6.5",
"@types/sinon": "10.0.16",
"@types/sinon": "10.0.17",
"codecov": "3.8.3",
"cpx": "1.5.0",
"cross-var": "1.1.0",
Expand Down
20 changes: 10 additions & 10 deletions experimental/packages/exporter-trace-otlp-grpc/test/traceHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,49 +114,49 @@ export function ensureExportedEventsAreCorrect(events: IEvent[]) {
[
{
attributes: [],
timeUnixNano: '1574120165429803008',
timeUnixNano: '1574120165429803070',
name: 'fetchStart',
droppedAttributesCount: 0,
},
{
attributes: [],
timeUnixNano: '1574120165429803008',
timeUnixNano: '1574120165429803070',
name: 'domainLookupStart',
droppedAttributesCount: 0,
},
{
attributes: [],
timeUnixNano: '1574120165429803008',
timeUnixNano: '1574120165429803070',
name: 'domainLookupEnd',
droppedAttributesCount: 0,
},
{
attributes: [],
timeUnixNano: '1574120165429803008',
timeUnixNano: '1574120165429803070',
name: 'connectStart',
droppedAttributesCount: 0,
},
{
attributes: [],
timeUnixNano: '1574120165429803008',
timeUnixNano: '1574120165429803070',
name: 'connectEnd',
droppedAttributesCount: 0,
},
{
attributes: [],
timeUnixNano: '1574120165435513088',
timeUnixNano: '1574120165435513070',
name: 'requestStart',
droppedAttributesCount: 0,
},
{
attributes: [],
timeUnixNano: '1574120165436923136',
timeUnixNano: '1574120165436923070',
name: 'responseStart',
droppedAttributesCount: 0,
},
{
attributes: [],
timeUnixNano: '1574120165438688000',
timeUnixNano: '1574120165438688070',
name: 'responseEnd',
droppedAttributesCount: 0,
},
Expand Down Expand Up @@ -235,12 +235,12 @@ export function ensureExportedSpanIsCorrect(span: ISpan) {
assert.strictEqual(span.kind, 'SPAN_KIND_INTERNAL', 'kind is wrong');
assert.strictEqual(
span.startTimeUnixNano,
'1574120165429803008',
'1574120165429803070',
'startTimeUnixNano is wrong'
);
assert.strictEqual(
span.endTimeUnixNano,
'1574120165438688000',
'1574120165438688070',
'endTimeUnixNano is wrong'
);
assert.strictEqual(
Expand Down
4 changes: 2 additions & 2 deletions experimental/packages/exporter-trace-otlp-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
"devDependencies": {
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.2",
"@types/node": "18.6.5",
"@types/sinon": "10.0.16",
"@types/sinon": "10.0.17",
"@types/webpack-env": "1.16.3",
"babel-loader": "8.3.0",
"babel-plugin-istanbul": "6.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ describe('OTLPTraceExporter - node with json over http', () => {

fakeRequest.on('end', () => {
const responseBody = buff.toString();

const json = JSON.parse(responseBody) as IExportTraceServiceRequest;
const span1 = json.resourceSpans?.[0].scopeSpans?.[0].spans?.[0];
assert.ok(typeof span1 !== 'undefined', "span doesn't exist");
Expand Down
Loading

0 comments on commit 039228a

Please sign in to comment.