Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fs-promises
Browse files Browse the repository at this point in the history
  • Loading branch information
mhassan1 committed Feb 17, 2023
2 parents 2e6a40b + ee0a59a commit 5601545
Show file tree
Hide file tree
Showing 34 changed files with 338 additions and 384 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.4","detectors/node/opentelemetry-resource-detector-aws":"1.2.2","detectors/node/opentelemetry-resource-detector-container":"0.2.2","detectors/node/opentelemetry-resource-detector-gcp":"0.28.0","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.1","metapackages/auto-instrumentations-node":"0.36.2","metapackages/auto-instrumentations-web":"0.31.1","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.2","packages/opentelemetry-redis-common":"0.34.0","packages/opentelemetry-test-utils":"0.33.1","plugins/node/instrumentation-amqplib":"0.32.1","plugins/node/instrumentation-dataloader":"0.3.1","plugins/node/instrumentation-fs":"0.7.0","plugins/node/instrumentation-lru-memoizer":"0.32.1","plugins/node/instrumentation-mongoose":"0.32.1","plugins/node/instrumentation-socket.io":"0.33.1","plugins/node/instrumentation-tedious":"0.5.1","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.35.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.34.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.1","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.1","plugins/node/opentelemetry-instrumentation-connect":"0.31.1","plugins/node/opentelemetry-instrumentation-dns":"0.31.1","plugins/node/opentelemetry-instrumentation-express":"0.32.1","plugins/node/opentelemetry-instrumentation-fastify":"0.31.1","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.1","plugins/node/opentelemetry-instrumentation-graphql":"0.33.1","plugins/node/opentelemetry-instrumentation-hapi":"0.31.1","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.2","plugins/node/opentelemetry-instrumentation-knex":"0.31.1","plugins/node/opentelemetry-instrumentation-koa":"0.34.1","plugins/node/opentelemetry-instrumentation-memcached":"0.31.1","plugins/node/opentelemetry-instrumentation-mongodb":"0.34.1","plugins/node/opentelemetry-instrumentation-mysql":"0.33.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.1","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.1","plugins/node/opentelemetry-instrumentation-net":"0.31.1","plugins/node/opentelemetry-instrumentation-pg":"0.34.1","plugins/node/opentelemetry-instrumentation-pino":"0.33.1","plugins/node/opentelemetry-instrumentation-redis":"0.34.2","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.2","plugins/node/opentelemetry-instrumentation-restify":"0.32.1","plugins/node/opentelemetry-instrumentation-router":"0.32.1","plugins/node/opentelemetry-instrumentation-winston":"0.31.1","plugins/web/opentelemetry-instrumentation-document-load":"0.31.1","plugins/web/opentelemetry-instrumentation-long-task":"0.32.1","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.1","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.2.0","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"}
{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.4","detectors/node/opentelemetry-resource-detector-aws":"1.2.2","detectors/node/opentelemetry-resource-detector-container":"0.2.2","detectors/node/opentelemetry-resource-detector-gcp":"0.28.0","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.1","metapackages/auto-instrumentations-node":"0.36.3","metapackages/auto-instrumentations-web":"0.31.1","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.2","packages/opentelemetry-redis-common":"0.34.0","packages/opentelemetry-test-utils":"0.33.1","plugins/node/instrumentation-amqplib":"0.32.2","plugins/node/instrumentation-dataloader":"0.4.0","plugins/node/instrumentation-fs":"0.7.0","plugins/node/instrumentation-lru-memoizer":"0.32.1","plugins/node/instrumentation-mongoose":"0.32.1","plugins/node/instrumentation-socket.io":"0.33.1","plugins/node/instrumentation-tedious":"0.5.1","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.35.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.34.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.1","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.1","plugins/node/opentelemetry-instrumentation-connect":"0.31.1","plugins/node/opentelemetry-instrumentation-dns":"0.31.2","plugins/node/opentelemetry-instrumentation-express":"0.32.1","plugins/node/opentelemetry-instrumentation-fastify":"0.31.1","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.1","plugins/node/opentelemetry-instrumentation-graphql":"0.33.1","plugins/node/opentelemetry-instrumentation-hapi":"0.31.1","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.2","plugins/node/opentelemetry-instrumentation-knex":"0.31.1","plugins/node/opentelemetry-instrumentation-koa":"0.34.1","plugins/node/opentelemetry-instrumentation-memcached":"0.31.1","plugins/node/opentelemetry-instrumentation-mongodb":"0.34.1","plugins/node/opentelemetry-instrumentation-mysql":"0.33.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.1","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.2","plugins/node/opentelemetry-instrumentation-net":"0.31.1","plugins/node/opentelemetry-instrumentation-pg":"0.34.1","plugins/node/opentelemetry-instrumentation-pino":"0.33.1","plugins/node/opentelemetry-instrumentation-redis":"0.34.2","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.2","plugins/node/opentelemetry-instrumentation-restify":"0.32.1","plugins/node/opentelemetry-instrumentation-router":"0.32.1","plugins/node/opentelemetry-instrumentation-winston":"0.31.1","plugins/web/opentelemetry-instrumentation-document-load":"0.31.1","plugins/web/opentelemetry-instrumentation-long-task":"0.32.1","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.1","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.2.0","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"}
9 changes: 9 additions & 0 deletions metapackages/auto-instrumentations-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
* dependencies
* @opentelemetry/instrumentation-aws-lambda bumped from ^0.34.1 to ^0.35.0

### Dependencies

* The following workspace dependencies were updated
* dependencies
* @opentelemetry/instrumentation-amqplib bumped from ^0.32.1 to ^0.32.2
* @opentelemetry/instrumentation-dataloader bumped from ^0.3.1 to ^0.4.0
* @opentelemetry/instrumentation-dns bumped from ^0.31.1 to ^0.31.2
* @opentelemetry/instrumentation-nestjs-core bumped from ^0.32.1 to ^0.32.2

## [0.36.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/auto-instrumentations-node-v0.36.0...auto-instrumentations-node-v0.36.1) (2023-02-07)


Expand Down
10 changes: 5 additions & 5 deletions metapackages/auto-instrumentations-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/auto-instrumentations-node",
"version": "0.36.2",
"version": "0.36.3",
"description": "Metapackage which bundles opentelemetry node core and contrib instrumentations",
"author": "OpenTelemetry Authors",
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node#readme",
Expand Down Expand Up @@ -47,14 +47,14 @@
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.35.1",
"@opentelemetry/instrumentation-amqplib": "^0.32.1",
"@opentelemetry/instrumentation-amqplib": "^0.32.2",
"@opentelemetry/instrumentation-aws-lambda": "^0.35.0",
"@opentelemetry/instrumentation-aws-sdk": "^0.34.0",
"@opentelemetry/instrumentation-bunyan": "^0.31.1",
"@opentelemetry/instrumentation-cassandra-driver": "^0.32.1",
"@opentelemetry/instrumentation-connect": "^0.31.1",
"@opentelemetry/instrumentation-dataloader": "^0.3.1",
"@opentelemetry/instrumentation-dns": "^0.31.1",
"@opentelemetry/instrumentation-dataloader": "^0.4.0",
"@opentelemetry/instrumentation-dns": "^0.31.2",
"@opentelemetry/instrumentation-express": "^0.32.1",
"@opentelemetry/instrumentation-fs": "^0.7.0",
"@opentelemetry/instrumentation-fastify": "^0.31.1",
Expand All @@ -72,7 +72,7 @@
"@opentelemetry/instrumentation-mongoose": "^0.32.1",
"@opentelemetry/instrumentation-mysql": "^0.33.0",
"@opentelemetry/instrumentation-mysql2": "^0.33.1",
"@opentelemetry/instrumentation-nestjs-core": "^0.32.1",
"@opentelemetry/instrumentation-nestjs-core": "^0.32.2",
"@opentelemetry/instrumentation-net": "^0.31.1",
"@opentelemetry/instrumentation-pg": "^0.34.1",
"@opentelemetry/instrumentation-pino": "^0.33.1",
Expand Down
7 changes: 7 additions & 0 deletions plugins/node/instrumentation-amqplib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.32.2](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-amqplib-v0.32.1...instrumentation-amqplib-v0.32.2) (2023-02-14)


### Bug Fixes

* **amqplib:** stop importing from `amqplib` directly in compiled types ([#1394](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1394)) ([9d0198c](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/9d0198ca104a34726a7b41dd910df275e0c5336d))

## [0.32.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-amqplib-v0.32.0...instrumentation-amqplib-v0.32.1) (2023-02-07)


Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-amqplib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/instrumentation-amqplib",
"version": "0.32.1",
"version": "0.32.2",
"description": "OpenTelemetry automatic instrumentation for the `amqplib` package",
"keywords": [
"amqplib",
Expand Down
16 changes: 9 additions & 7 deletions plugins/node/instrumentation-amqplib/src/amqplib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ import {
MessagingOperationValues,
MessagingDestinationKindValues,
} from '@opentelemetry/semantic-conventions';
import {
AmqplibInstrumentationConfig,
import type {
Connection,
ConsumeMessage,
DEFAULT_CONFIG,
EndOperation,
Message,
Options,
Replies,
} from 'amqplib';
import {
AmqplibInstrumentationConfig,
DEFAULT_CONFIG,
EndOperation,
} from './types';
import {
CHANNEL_CONSUME_TIMEOUT_TIMER,
Expand Down Expand Up @@ -368,7 +370,7 @@ export class AmqplibInstrumentation extends InstrumentationBase {
};
}

protected getConsumePatch(
private getConsumePatch(
moduleVersion: string | undefined,
original: Function
) {
Expand Down Expand Up @@ -466,7 +468,7 @@ export class AmqplibInstrumentation extends InstrumentationBase {
};
}

protected getConfirmedPublishPatch(
private getConfirmedPublishPatch(
moduleVersion: string | undefined,
original: Function
) {
Expand Down Expand Up @@ -563,7 +565,7 @@ export class AmqplibInstrumentation extends InstrumentationBase {
};
}

protected getPublishPatch(
private getPublishPatch(
moduleVersion: string | undefined,
original: Function
) {
Expand Down
219 changes: 24 additions & 195 deletions plugins/node/instrumentation-amqplib/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface PublishInfo {
exchange: string;
routingKey: string;
content: Buffer;
options?: Options.Publish;
options?: AmqplibPublishOptions;
isConfirmChannel?: boolean;
}

Expand Down Expand Up @@ -104,192 +104,29 @@ export const DEFAULT_CONFIG: AmqplibInstrumentationConfig = {

// The following types are vendored from `@types/amqplib@0.10.1` - commit SHA: 4205e03127692a40b4871709a7134fe4e2ed5510

// Vendored from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4205e03127692a40b4871709a7134fe4e2ed5510/types/amqplib/properties.d.ts#LL23C18-L23C25
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Options {
export interface Connect {
/**
* The to be used protocol
*
* Default value: 'amqp'
*/
protocol?: string;
/**
* Hostname used for connecting to the server.
*
* Default value: 'localhost'
*/
hostname?: string;
/**
* Port used for connecting to the server.
*
* Default value: 5672
*/
port?: number;
/**
* Username used for authenticating against the server.
*
* Default value: 'guest'
*/
username?: string;
/**
* Password used for authenticating against the server.
*
* Default value: 'guest'
*/
password?: string;
/**
* The desired locale for error messages. RabbitMQ only ever uses en_US
*
* Default value: 'en_US'
*/
locale?: string;
/**
* The size in bytes of the maximum frame allowed over the connection. 0 means
* no limit (but since frames have a size field which is an unsigned 32 bit integer, it’s perforce 2^32 - 1).
*
* Default value: 0x1000 (4kb) - That's the allowed minimum, it will fit many purposes
*/
frameMax?: number;
/**
* The period of the connection heartbeat in seconds.
*
* Default value: 0
*/
heartbeat?: number;
/**
* What VHost shall be used.
*
* Default value: '/'
*/
vhost?: string;
}

export interface AssertQueue {
exclusive?: boolean;
durable?: boolean;
autoDelete?: boolean;
arguments?: any;
messageTtl?: number;
expires?: number;
deadLetterExchange?: string;
deadLetterRoutingKey?: string;
maxLength?: number;
maxPriority?: number;
}
export interface DeleteQueue {
ifUnused?: boolean;
ifEmpty?: boolean;
}
export interface AssertExchange {
durable?: boolean;
internal?: boolean;
autoDelete?: boolean;
alternateExchange?: string;
arguments?: any;
}
export interface DeleteExchange {
ifUnused?: boolean;
}
export interface Publish {
expiration?: string | number;
userId?: string;
CC?: string | string[];

mandatory?: boolean;
persistent?: boolean;
deliveryMode?: boolean | number;
BCC?: string | string[];

contentType?: string;
contentEncoding?: string;
headers?: any;
priority?: number;
correlationId?: string;
replyTo?: string;
messageId?: string;
timestamp?: number;
type?: string;
appId?: string;
}

export interface Consume {
consumerTag?: string;
noLocal?: boolean;
noAck?: boolean;
exclusive?: boolean;
priority?: number;
arguments?: any;
}

export interface Get {
noAck?: boolean;
}
}

// Vendored from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4205e03127692a40b4871709a7134fe4e2ed5510/types/amqplib/properties.d.ts#L214
interface ServerProperties {
host: string;
product: string;
version: string;
platform: string;
copyright?: string;
information: string;
[key: string]: string | undefined;
}

// Vendored from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4205e03127692a40b4871709a7134fe4e2ed5510/types/amqplib/properties.d.ts#L1
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Replies {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Empty {}

export interface AssertQueue {
queue: string;
messageCount: number;
consumerCount: number;
}
export interface PurgeQueue {
messageCount: number;
}
export interface DeleteQueue {
messageCount: number;
}
export interface AssertExchange {
exchange: string;
}
export interface Consume {
consumerTag: string;
}
}

// Vendored from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4205e03127692a40b4871709a7134fe4e2ed5510/types/amqplib/callback_api.d.ts#L55
export interface ConfirmChannel {
publish(
exchange: string,
routingKey: string,
content: Buffer,
options?: Options.Publish,
callback?: (err: any, ok: Replies.Empty) => void
): boolean;
sendToQueue(
queue: string,
content: Buffer,
options?: Options.Publish,
callback?: (err: any, ok: Replies.Empty) => void
): boolean;

waitForConfirms(): Promise<void>;
}

// Vendored from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4205e03127692a40b4871709a7134fe4e2ed5510/types/amqplib/callback_api.d.ts#L5
export interface Connection {
close(): Promise<void>;
createChannel(): Promise<any>;
createConfirmChannel(): Promise<ConfirmChannel>;
connection: {
serverProperties: ServerProperties;
};
// Vendored from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4205e03127692a40b4871709a7134fe4e2ed5510/types/amqplib/properties.d.ts#L108
// This exists in `@types/amqplib` as `Options.Publish`. We're renaming things
// here to avoid importing the whole Options namespace.
export interface AmqplibPublishOptions {
expiration?: string | number;
userId?: string;
CC?: string | string[];

mandatory?: boolean;
persistent?: boolean;
deliveryMode?: boolean | number;
BCC?: string | string[];

contentType?: string;
contentEncoding?: string;
headers?: any;
priority?: number;
correlationId?: string;
replyTo?: string;
messageId?: string;
timestamp?: number;
type?: string;
appId?: string;
}

// Vendored from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4205e03127692a40b4871709a7134fe4e2ed5510/types/amqplib/properties.d.ts#L142
Expand All @@ -299,10 +136,6 @@ export interface Message {
properties: MessageProperties;
}

export interface GetMessage extends Message {
fields: GetMessageFields;
}

export interface ConsumeMessage extends Message {
fields: ConsumeMessageFields;
}
Expand All @@ -319,10 +152,6 @@ export interface MessageFields extends CommonMessageFields {
consumerTag?: string;
}

export interface GetMessageFields extends CommonMessageFields {
messageCount: number;
}

export interface ConsumeMessageFields extends CommonMessageFields {
deliveryTag: number;
}
Expand Down
7 changes: 7 additions & 0 deletions plugins/node/instrumentation-dataloader/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.4.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-dataloader-v0.3.1...instrumentation-dataloader-v0.4.0) (2023-02-14)


### Features

* **instrumentation-dataloader:** add dataloader name to span names ([#1345](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1345)) ([712b559](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/712b559416e0d86ef29ed06d46c180ef8360b411))

## [0.3.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-dataloader-v0.3.0...instrumentation-dataloader-v0.3.1) (2023-02-07)


Expand Down
2 changes: 1 addition & 1 deletion plugins/node/instrumentation-dataloader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/instrumentation-dataloader",
"version": "0.3.1",
"version": "0.4.0",
"description": "OpenTelemetry instrumentation for dataloader",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand Down
Loading

0 comments on commit 5601545

Please sign in to comment.