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

@azure/eventgrid

Package Overview
Dependencies
Maintainers
6
Versions
327
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/eventgrid - npm Package Compare versions

Comparing version 3.0.0-alpha.20210224.1 to 3.0.0-alpha.20210226.1

26

dist-esm/src/tracing.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { getTracer } from "@azure/core-tracing";
import { SpanKind } from "@opentelemetry/api";
import { createSpanFunction } from "@azure/core-tracing";
/**
* Creates a span using the global tracer.
* @internal
* @param name - The name of the operation being performed.
* @param tracingOptions - The options for the underlying http request.
*/
export function createSpan(operationName, operationOptions) {
const tracer = getTracer();
const tracingOptions = operationOptions.tracingOptions || {};
const spanOptions = Object.assign(Object.assign({}, tracingOptions.spanOptions), { kind: SpanKind.INTERNAL });
const span = tracer.startSpan(`Azure.Data.EventGrid.${operationName}`, spanOptions);
span.setAttribute("az.namespace", "Microsoft.Messaging.EventGrid");
let newSpanOptions = tracingOptions.spanOptions || {};
if (span.isRecording()) {
newSpanOptions = Object.assign(Object.assign({}, tracingOptions.spanOptions), { parent: span.context(), attributes: Object.assign(Object.assign({}, spanOptions.attributes), { "az.namespace": "Microsoft.Data.EventGrid" }) });
}
const newTracingOptions = Object.assign(Object.assign({}, tracingOptions), { spanOptions: newSpanOptions });
const newOperationOptions = Object.assign(Object.assign({}, operationOptions), { tracingOptions: newTracingOptions });
return {
span,
updatedOptions: newOperationOptions
};
}
export const createSpan = createSpanFunction({
packagePrefix: "Azure.Data.EventGrid",
namespace: "Microsoft.Messaging.EventGrid"
});
//# sourceMappingURL=tracing.js.map

2

package.json

@@ -6,3 +6,3 @@ {

"description": "An isomorphic client library for the Azure Event Grid service.",
"version": "3.0.0-alpha.20210224.1",
"version": "3.0.0-alpha.20210226.1",
"keywords": [

@@ -9,0 +9,0 @@ "node",

@@ -226,3 +226,3 @@ # Azure Event Grid client library for JavaScript

`EventGridDeserializer` can be used to deserialize events delivered by Event Grid. When deserializing an event, you need to know the schema used to deliver the event. In this example we have events being delivered to an Azure Service Bus Topic in the Cloud Events schema. Using the Service Bus SDK we can recieve these events from the Service Bus Topic and then deserialize them using `EventGridDeserializer` and use `isSystemEvent` to detect what type of events they are.
`EventGridDeserializer` can be used to deserialize events delivered by Event Grid. When deserializing an event, you need to know the schema used to deliver the event. In this example we have events being delivered to an Azure Service Bus Queue in the Cloud Events schema. Using the Service Bus SDK we can receive these events from the Service Bus Queue and then deserialize them using `EventGridDeserializer` and use `isSystemEvent` to detect what type of events they are.

@@ -243,3 +243,3 @@ ```js

// so we just pluck the first one.
const event = (await consumer.decodeCloudEvents(message.body))[0];
const event = (await consumer.deserializeCloudEvents(message.body))[0];

@@ -246,0 +246,0 @@ if (isSystemEvent("Microsoft.ContainerRegistry.ImagePushed", event)) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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