Skip to content

Commit

Permalink
Merge pull request open-telemetry#195 from opentelemetrybot/opentelem…
Browse files Browse the repository at this point in the history
…etrybot/merge-main

[AutoMerge][Main] Merging staged change(s) to main
  • Loading branch information
MSNev committed Sep 29, 2023
2 parents 7cbfbe5 + acf0985 commit 08a7478
Show file tree
Hide file tree
Showing 101 changed files with 1,778 additions and 1,044 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@opentelemetry/contrib-test-utils": "^0.34.1",
"@types/mocha": "8.2.3",
"@types/node": "18.6.5",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"mocha": "7.2.0",
"nock": "13.3.3",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@opentelemetry/sdk-node": "^0.43.0",
"@types/mocha": "8.2.3",
"@types/node": "18.6.5",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"mocha": "7.2.0",
"nock": "13.3.3",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ export function startDocker(db: keyof typeof dockerRunCmds) {

export function cleanUpDocker(db: keyof typeof dockerRunCmds) {
run(`docker stop otel-${db}`);
run(`docker rm otel-${db}`);
}

function run(cmd: string) {
try {
const proc = childProcess.spawnSync(cmd, {
shell: true,
});
const output = Buffer.concat(
proc.output.filter(c => c) as Buffer[]
).toString('utf8');
if (proc.status !== 0) {
console.error('Failed run command:', cmd);
console.error(proc.output);
console.error(output);
}
return {
code: proc.status,
output: proc.output
.map(v => String.fromCharCode.apply(null, v as any))
.join(''),
output,
};
} catch (e) {
console.log(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/contrib-test-utils": "^0.34.1",
"@types/amqplib": "^0.5.17",
"@types/lodash": "4.14.198",
"@types/lodash": "4.14.199",
"@types/mocha": "8.2.3",
"@types/sinon": "10.0.16",
"@types/node": "18.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@opentelemetry/sdk-trace-base": "^1.3.1",
"@opentelemetry/sdk-trace-node": "^1.3.1",
"@types/mocha": "7.0.2",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"@types/shimmer": "1.0.2",
"@types/sinon": "10.0.16",
"mocha": "7.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@opentelemetry/propagator-aws-xray": "^1.3.1",
"@opentelemetry/resources": "^1.8.0",
"@opentelemetry/semantic-conventions": "^1.0.0",
"@types/aws-lambda": "8.10.119"
"@types/aws-lambda": "8.10.122"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-aws-lambda#readme"
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.43.0",
"@types/bunyan": "1.8.8"
"@types/bunyan": "1.8.9"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-bunyan#readme"
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@types/mocha": "7.0.2",
"@types/node": "18.6.5",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"@types/sinon": "10.0.16",
"cassandra-driver": "4.6.4",
"mocha": "7.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@types/mocha": "7.0.2",
"@types/node": "18.6.5",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"@types/shimmer": "1.0.2",
"@types/sinon": "10.0.16",
"mocha": "7.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.43.0",
"@opentelemetry/semantic-conventions": "^1.0.0",
"@types/express": "4.17.17"
"@types/express": "4.17.18"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-express#readme"
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@opentelemetry/instrumentation-http": "0.43.0",
"@opentelemetry/sdk-trace-base": "^1.8.0",
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@types/express": "4.17.17",
"@types/express": "4.17.18",
"@types/mocha": "7.0.2",
"@types/node": "18.6.5",
"fastify": "4.18.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,8 @@ export class FastifyInstrumentation extends InstrumentationBase {
return original.apply(this, args);
}

const spanName = `${FastifyNames.MIDDLEWARE} - ${
original.name || ANONYMOUS_NAME
}`;
const name = original.name || pluginName || ANONYMOUS_NAME;
const spanName = `${FastifyNames.MIDDLEWARE} - ${name}`;

const reply = args[1] as PluginFastifyReply;

Expand Down Expand Up @@ -263,7 +262,7 @@ export class FastifyInstrumentation extends InstrumentationBase {
const requestContext = (request as any).context || {};
const handlerName = (requestContext.handler?.name || '').substr(6);
const spanName = `${FastifyNames.REQUEST_HANDLER} - ${
handlerName || ANONYMOUS_NAME
handlerName || this.pluginName || ANONYMOUS_NAME
}`;

const spanAttributes: SpanAttributes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
import { Span } from '@opentelemetry/api';
import * as http from 'http';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { ANONYMOUS_NAME } from '../src/instrumentation';
import { AttributeNames, FastifyInstrumentation } from '../src';
import { FastifyRequestInfo } from '../src/types';

Expand Down Expand Up @@ -152,7 +151,10 @@ describe('fastify', () => {
'plugin.name': 'fastify -> @fastify/express',
[SemanticAttributes.HTTP_ROUTE]: '/test',
});
assert.strictEqual(span.name, `request handler - ${ANONYMOUS_NAME}`);
assert.strictEqual(
span.name,
'request handler - fastify -> @fastify/express'
);
const baseSpan = spans[1];
assert.strictEqual(span.parentSpanId, baseSpan.spanContext().spanId);
});
Expand Down Expand Up @@ -290,7 +292,7 @@ describe('fastify', () => {
assert.strictEqual(spans.length, 6);
const baseSpan = spans[1];
const span = spans[2];
assert.strictEqual(span.name, `middleware - ${ANONYMOUS_NAME}`);
assert.strictEqual(span.name, 'middleware - subsystem');
assert.deepStrictEqual(span.attributes, {
'fastify.type': 'middleware',
'plugin.name': 'subsystem',
Expand All @@ -307,7 +309,7 @@ describe('fastify', () => {

assert.strictEqual(spans.length, 6);
const span = spans[3];
assert.strictEqual(span.name, 'request handler - anonymous');
assert.strictEqual(span.name, 'request handler - subsystem');
assert.deepStrictEqual(span.status, {
code: SpanStatusCode.ERROR,
message: 'foo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@types/generic-pool": "^3.1.9",
"@types/mocha": "7.0.2",
"@types/node": "18.6.5",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"generic-pool": "3.8.2",
"mocha": "7.2.0",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.43.0",
"@opentelemetry/semantic-conventions": "^1.0.0",
"@types/koa": "2.13.8",
"@types/koa__router": "8.0.11"
"@types/koa": "2.13.9",
"@types/koa__router": "12.0.1"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-koa#readme"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ import {
} from '@opentelemetry/instrumentation';

import type * as koa from 'koa';
import {
KoaMiddleware,
KoaContext,
KoaLayerType,
KoaInstrumentationConfig,
} from './types';
import { KoaContext, KoaLayerType, KoaInstrumentationConfig } from './types';
import { VERSION } from './version';
import { getMiddlewareMetadata, isLayerIgnored } from './utils';
import { getRPCMetadata, RPCType } from '@opentelemetry/core';
import { kLayerPatched, KoaPatchedMiddleware } from './internal-types';
import {
kLayerPatched,
KoaMiddleware,
KoaPatchedMiddleware,
} from './internal-types';

/** Koa instrumentation for OpenTelemetry */
export class KoaInstrumentation extends InstrumentationBase<typeof koa> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { KoaMiddleware } from './types';
import type { Middleware, DefaultState } from 'koa';
import { KoaContext } from './types';
import type * as Router from '@koa/router';

export type KoaMiddleware = Middleware<DefaultState, KoaContext> & {
router?: Router;
};

/**
* This symbol is used to mark a Koa layer as being already instrumented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
import type { Middleware, ParameterizedContext, DefaultState } from 'koa';
import type { RouterParamContext } from '@koa/router';
import type * as Router from '@koa/router';
import { Span } from '@opentelemetry/api';
import { InstrumentationConfig } from '@opentelemetry/instrumentation';

Expand All @@ -26,10 +25,6 @@ export enum KoaLayerType {

export type KoaContext = ParameterizedContext<DefaultState, RouterParamContext>;

export type KoaMiddleware = Middleware<DefaultState, KoaContext> & {
router?: Router;
};

export type KoaRequestInfo = {
context: KoaContext;
middlewareLayer: Middleware<DefaultState, KoaContext>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
KoaContext,
KoaMiddleware,
KoaLayerType,
KoaInstrumentationConfig,
} from './types';
import { KoaContext, KoaLayerType, KoaInstrumentationConfig } from './types';
import { KoaMiddleware } from './internal-types';
import { AttributeNames } from './enums/AttributeNames';
import { SpanAttributes } from '@opentelemetry/api';
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@types/mocha": "7.0.2",
"@types/mysql2": "github:types/mysql2",
"@types/node": "18.6.5",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"mocha": "7.2.0",
"mysql2": "2.3.3",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@types/mocha": "7.0.2",
"@types/node": "18.6.5",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"cross-env": "7.0.3",
"mocha": "7.2.0",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ function createWrapCreateHandler(tracer: api.Tracer, moduleVersion?: string) {
[AttributeNames.TYPE]: NestType.REQUEST_CONTEXT,
[SemanticAttributes.HTTP_METHOD]: req.method,
[SemanticAttributes.HTTP_URL]: req.originalUrl || req.url,
[SemanticAttributes.HTTP_ROUTE]: req.route?.path || req.routerPath,
[SemanticAttributes.HTTP_ROUTE]:
req.route?.path || req.routeOptions?.url || req.routerPath,
[AttributeNames.CONTROLLER]: instanceName,
[AttributeNames.CALLBACK]: callbackName,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"@opentelemetry/semantic-conventions": "^1.0.0",
"@opentelemetry/sql-common": "^0.40.0",
"@types/pg": "8.6.1",
"@types/pg-pool": "2.0.3"
"@types/pg-pool": "2.0.4"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pg#readme"
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@types/mocha": "7.0.2",
"@types/node": "18.6.5",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"@types/sinon": "10.0.16",
"mocha": "7.2.0",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@types/mocha": "7.0.2",
"@types/node": "18.6.5",
"@types/restify": "4.3.9",
"@types/semver": "7.5.1",
"@types/semver": "7.5.2",
"mocha": "7.2.0",
"nyc": "15.1.0",
"restify": "11.1.0",
Expand Down
6 changes: 6 additions & 0 deletions auto-merge/js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ 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)
Expand Down
4 changes: 4 additions & 0 deletions auto-merge/js/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
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
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
Loading

0 comments on commit 08a7478

Please sign in to comment.