Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/instrumentation-amqplib

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation-amqplib - npm Package Compare versions

Comparing version 0.36.0 to 0.37.0

2

build/src/amqplib.d.ts

@@ -7,3 +7,3 @@ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';

setConfig(config?: AmqplibInstrumentationConfig): void;
protected init(): InstrumentationNodeModuleDefinition<unknown>;
protected init(): InstrumentationNodeModuleDefinition;
private patchConnect;

@@ -10,0 +10,0 @@ private unpatchConnect;

@@ -208,3 +208,3 @@ "use strict";

kind: api_1.SpanKind.CONSUMER,
attributes: Object.assign(Object.assign({}, (_c = channel === null || channel === void 0 ? void 0 : channel.connection) === null || _c === void 0 ? void 0 : _c[utils_1.CONNECTION_ATTRIBUTES]), { [semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION]: exchange, [semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MessagingDestinationKindValues.TOPIC, [semantic_conventions_1.SemanticAttributes.MESSAGING_RABBITMQ_ROUTING_KEY]: (_d = msg.fields) === null || _d === void 0 ? void 0 : _d.routingKey, [semantic_conventions_1.SemanticAttributes.MESSAGING_OPERATION]: semantic_conventions_1.MessagingOperationValues.PROCESS, [semantic_conventions_1.SemanticAttributes.MESSAGING_MESSAGE_ID]: msg === null || msg === void 0 ? void 0 : msg.properties.messageId, [semantic_conventions_1.SemanticAttributes.MESSAGING_CONVERSATION_ID]: msg === null || msg === void 0 ? void 0 : msg.properties.correlationId }),
attributes: Object.assign(Object.assign({}, (_c = channel === null || channel === void 0 ? void 0 : channel.connection) === null || _c === void 0 ? void 0 : _c[utils_1.CONNECTION_ATTRIBUTES]), { [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: exchange, [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MESSAGINGDESTINATIONKINDVALUES_TOPIC, [semantic_conventions_1.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]: (_d = msg.fields) === null || _d === void 0 ? void 0 : _d.routingKey, [semantic_conventions_1.SEMATTRS_MESSAGING_OPERATION]: semantic_conventions_1.MESSAGINGOPERATIONVALUES_PROCESS, [semantic_conventions_1.SEMATTRS_MESSAGING_MESSAGE_ID]: msg === null || msg === void 0 ? void 0 : msg.properties.messageId, [semantic_conventions_1.SEMATTRS_MESSAGING_CONVERSATION_ID]: msg === null || msg === void 0 ? void 0 : msg.properties.correlationId }),
}, parentContext);

@@ -335,3 +335,3 @@ if (self._config.consumeHook) {

kind: api_1.SpanKind.PRODUCER,
attributes: Object.assign(Object.assign({}, channel.connection[utils_1.CONNECTION_ATTRIBUTES]), { [semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION]: exchange, [semantic_conventions_1.SemanticAttributes.MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MessagingDestinationKindValues.TOPIC, [semantic_conventions_1.SemanticAttributes.MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey, [semantic_conventions_1.SemanticAttributes.MESSAGING_MESSAGE_ID]: options === null || options === void 0 ? void 0 : options.messageId, [semantic_conventions_1.SemanticAttributes.MESSAGING_CONVERSATION_ID]: options === null || options === void 0 ? void 0 : options.correlationId }),
attributes: Object.assign(Object.assign({}, channel.connection[utils_1.CONNECTION_ATTRIBUTES]), { [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: exchange, [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MESSAGINGDESTINATIONKINDVALUES_TOPIC, [semantic_conventions_1.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey, [semantic_conventions_1.SEMATTRS_MESSAGING_MESSAGE_ID]: options === null || options === void 0 ? void 0 : options.messageId, [semantic_conventions_1.SEMATTRS_MESSAGING_CONVERSATION_ID]: options === null || options === void 0 ? void 0 : options.correlationId }),
});

@@ -338,0 +338,0 @@ const modifiedOptions = options !== null && options !== void 0 ? options : {};

/// <reference types="node" />
import { Context, HrTime, Span, SpanAttributes } from '@opentelemetry/api';
import { Context, HrTime, Span, Attributes } from '@opentelemetry/api';
import type * as amqp from 'amqplib';

@@ -10,3 +10,3 @@ export declare const MESSAGE_STORED_SPAN: unique symbol;

connection: {
[CONNECTION_ATTRIBUTES]: SpanAttributes;
[CONNECTION_ATTRIBUTES]: Attributes;
};

@@ -16,3 +16,3 @@ };

connection: {
[CONNECTION_ATTRIBUTES]: SpanAttributes;
[CONNECTION_ATTRIBUTES]: Attributes;
};

@@ -29,4 +29,4 @@ [CHANNEL_SPANS_NOT_ENDED]?: {

export declare const normalizeExchange: (exchangeName: string) => string;
export declare const getConnectionAttributesFromServer: (conn: amqp.Connection['connection']) => SpanAttributes;
export declare const getConnectionAttributesFromUrl: (url: string | amqp.Options.Connect) => SpanAttributes;
export declare const getConnectionAttributesFromServer: (conn: amqp.Connection['connection']) => Attributes;
export declare const getConnectionAttributesFromUrl: (url: string | amqp.Options.Connect) => Attributes;
export declare const markConfirmChannelTracing: (context: Context) => Context;

@@ -33,0 +33,0 @@ export declare const unmarkConfirmChannelTracing: (context: Context) => Context;

@@ -66,3 +66,3 @@ "use strict";

return {
[semantic_conventions_1.SemanticAttributes.MESSAGING_SYSTEM]: product,
[semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: product,
};

@@ -77,3 +77,3 @@ }

const attributes = {
[semantic_conventions_1.SemanticAttributes.MESSAGING_PROTOCOL_VERSION]: '0.9.1', // this is the only protocol supported by the instrumented library
[semantic_conventions_1.SEMATTRS_MESSAGING_PROTOCOL_VERSION]: '0.9.1', // this is the only protocol supported by the instrumented library
};

@@ -84,19 +84,19 @@ url = url || 'amqp://localhost';

const protocol = getProtocol(connectOptions === null || connectOptions === void 0 ? void 0 : connectOptions.protocol);
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SemanticAttributes.MESSAGING_PROTOCOL, protocol, 'protocol')));
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SEMATTRS_MESSAGING_PROTOCOL, protocol, 'protocol')));
const hostname = getHostname(connectOptions === null || connectOptions === void 0 ? void 0 : connectOptions.hostname);
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SemanticAttributes.NET_PEER_NAME, hostname, 'hostname')));
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SEMATTRS_NET_PEER_NAME, hostname, 'hostname')));
const port = getPort(connectOptions.port, protocol);
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SemanticAttributes.NET_PEER_PORT, port, 'port')));
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SEMATTRS_NET_PEER_PORT, port, 'port')));
}
else {
const censoredUrl = censorPassword(url);
attributes[semantic_conventions_1.SemanticAttributes.MESSAGING_URL] = censoredUrl;
attributes[semantic_conventions_1.SEMATTRS_MESSAGING_URL] = censoredUrl;
try {
const urlParts = new URL(censoredUrl);
const protocol = getProtocol(urlParts.protocol);
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SemanticAttributes.MESSAGING_PROTOCOL, protocol, 'protocol')));
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SEMATTRS_MESSAGING_PROTOCOL, protocol, 'protocol')));
const hostname = getHostname(urlParts.hostname);
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SemanticAttributes.NET_PEER_NAME, hostname, 'hostname')));
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SEMATTRS_NET_PEER_NAME, hostname, 'hostname')));
const port = getPort(urlParts.port ? parseInt(urlParts.port) : undefined, protocol);
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SemanticAttributes.NET_PEER_PORT, port, 'port')));
Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SEMATTRS_NET_PEER_PORT, port, 'port')));
}

@@ -103,0 +103,0 @@ catch (err) {

@@ -1,2 +0,2 @@

export declare const VERSION = "0.36.0";
export declare const VERSION = "0.37.0";
//# sourceMappingURL=version.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.36.0';
exports.VERSION = '0.37.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/instrumentation-amqplib",
"version": "0.36.0",
"version": "0.37.0",
"description": "OpenTelemetry automatic instrumentation for the `amqplib` package",

@@ -48,8 +48,8 @@ "keywords": [

"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.50.0",
"@opentelemetry/semantic-conventions": "^1.0.0"
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/semantic-conventions": "^1.22.0"
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/contrib-test-utils": "^0.38.0",
"@opentelemetry/contrib-test-utils": "^0.39.0",
"@types/amqplib": "^0.5.17",

@@ -73,3 +73,3 @@ "@types/lodash": "4.14.199",

},
"gitHead": "17a0bc1da3baa472ba9b867eee3c60730cc130fb"
"gitHead": "96a87b48934f0afcf1fe637eed6704f35bd8e973"
}

@@ -84,2 +84,23 @@ # OpenTelemetry Amqplib (RabbitMQ) Instrumentation for Node.js

## Semantic Conventions
This package uses `@opentelemetry/semantic-conventions` version `1.22+`, which implements Semantic Convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md)
Attributes collected:
| Attribute | Short Description |
| -------------------------------- | ---------------------------------------------------------------------- |
| `messaging.destination` | The message destination name. |
| `messaging.destination_kind` | The kind of message destination. |
| `messaging.rabbitmq.routing_key` | RabbitMQ message routing key. |
| `messaging.operation` | A string identifying the kind of message consumption. |
| `messaging.message_id` | A value used by the messaging system as an identifier for the message. |
| `messaging.conversation_id` | The ID identifying the conversation to which the message belongs. |
| `messaging.protocol` | The name of the transport protocol. |
| `messaging.protocol_version` | The version of the transport protocol. |
| `messaging.system` | A string identifying the messaging system. |
| `messaging.url` | The connection string. |
| `net.peer.name` | Remote hostname or similar. |
| `net.peer.port` | Remote port number. |
## Useful links

@@ -86,0 +107,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc