@google-cloud/pubsub
Advanced tools
Comparing version
@@ -96,4 +96,4 @@ "use strict"; | ||
// - `attributes` that are not empty | ||
if (data && !(data instanceof Buffer)) { | ||
throw new TypeError('Data must be in the form of a Buffer.'); | ||
if (data && !(data instanceof Uint8Array)) { | ||
throw new TypeError('Data must be in the form of a Buffer or Uint8Array.'); | ||
} | ||
@@ -100,0 +100,0 @@ const keys = Object.keys(attributes); |
@@ -260,3 +260,3 @@ "use strict"; | ||
// Add Opentelemetry semantic convention attributes to the span, based on: | ||
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.1.0/specification/trace/semantic_conventions/messaging.md | ||
// https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/messaging/messaging-spans.md | ||
['messaging.system']: 'gcp_pubsub', | ||
@@ -303,2 +303,3 @@ ['messaging.destination.name']: destinationId !== null && destinationId !== void 0 ? destinationId : destinationName, | ||
span.updateName(`${topicInfo.topicId} create`); | ||
span.setAttribute('messaging.operation', 'create'); | ||
span.setAttribute('messaging.destination.name', topicInfo.topicId); | ||
@@ -331,2 +332,3 @@ } | ||
attributes['messaging.destination.name'] = subInfo.subId; | ||
attributes['messaging.operation'] = 'receive'; | ||
} | ||
@@ -410,2 +412,3 @@ if (api_1.context) { | ||
span === null || span === void 0 ? void 0 : span.setAttribute('messaging.batch.message_count', messageSpans.length); | ||
span === null || span === void 0 ? void 0 : span.setAttribute('messaging.operation', 'receive'); | ||
if (span) { | ||
@@ -438,2 +441,3 @@ // Also attempt to link from the subscribe span(s) back to the publish RPC span. | ||
span === null || span === void 0 ? void 0 : span.setAttribute('messaging.batch.message_count', messageSpans.length); | ||
span === null || span === void 0 ? void 0 : span.setAttribute('messaging.operation', 'receive'); | ||
if (span) { | ||
@@ -467,3 +471,3 @@ // Also attempt to link from the subscribe span(s) back to the publish RPC span. | ||
static setReceiveProcessResult(span, isAck) { | ||
span.setAttribute('messaging.gcp_pubsub.result', isAck ? 'ack' : 'nack'); | ||
span === null || span === void 0 ? void 0 : span.setAttribute('messaging.gcp_pubsub.result', isAck ? 'ack' : 'nack'); | ||
} | ||
@@ -470,0 +474,0 @@ } |
{ | ||
"name": "@google-cloud/pubsub", | ||
"description": "Cloud Pub/Sub Client Library for Node.js", | ||
"version": "4.10.0", | ||
"version": "4.11.0", | ||
"license": "Apache-2.0", | ||
@@ -56,5 +56,5 @@ "author": "Google Inc.", | ||
"@google-cloud/projectify": "^4.0.0", | ||
"@google-cloud/promisify": "^4.0.0", | ||
"@google-cloud/promisify": "~4.0.0", | ||
"@opentelemetry/api": "~1.9.0", | ||
"@opentelemetry/semantic-conventions": "~1.28.0", | ||
"@opentelemetry/semantic-conventions": "~1.30.0", | ||
"arrify": "^2.0.0", | ||
@@ -61,0 +61,0 @@ "extend": "^3.0.2", |
@@ -141,3 +141,6 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
| Create Topic | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopic.js,samples/README.md) | | ||
| Create Topic With AWS MSK Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithAwsMskIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithAwsMskIngestion.js,samples/README.md) | | ||
| Create Topic With Azure Event Hubs Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithAzureEventHubsIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithAzureEventHubsIngestion.js,samples/README.md) | | ||
| Create Topic With Cloud Storage Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithCloudStorageIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithCloudStorageIngestion.js,samples/README.md) | | ||
| Create Topic With Confluent Cloud Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithConfluentCloudIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithConfluentCloudIngestion.js,samples/README.md) | | ||
| Create Topic With Kinesis Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithKinesisIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithKinesisIngestion.js,samples/README.md) | | ||
@@ -144,0 +147,0 @@ | Create Topic With Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithSchema.js,samples/README.md) | |
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 too big to display
4740943
0.06%78437
0.01%268
1.13%+ Added
+ Added
- Removed
- Removed