
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@highlight-run/opentelemetry-sdk-workers
Advanced tools
Open Telemetry Cloudflare Workers Library. Provides a basic sdk for instrumenting workers.
A WIP library for adding tracing (and soon, logging) to Cloudflare Workers.
npm i opentelemetry-sdk-workers
A basic implementation looks like this:
/* Required to patch missing performance API in Cloudflare Workers. */
import "opentelemetry-sdk-workers/performance";
import { WorkersSDK } from "opentelemetry-sdk-workers";
export interface Env {
OTLP_ENDPOINT: string;
}
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
const sdk = new WorkersSDK(request, ctx, {
service: "worker",
/* The OTLP/HTTP JSON Endpoint to send traces */
endpoint: env.OTLP_ENDPOINT
});
return sdk.sendResponse(new Response("Hello World!"));
},
};
This SDK does not automatically track fetch requests. In order to fetch, you must do so via the fetch method exposed by the trace sdk.
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
const sdk = new WorkersSDK(request, ctx, {
/* This is the service.name */
service: "worker",
/* The OTLP/HTTP JSON Endpoint to send traces */
endpoint: env.OTLP_ENDPOINT
});
try {
const response = await sdk.fetch("https://httpbin.org/headers/");
return sdk.sendResponse(response);
} catch (ex) {
sdk.captureException(ex);
}
},
};
This library exposes a basic logger based on maraisr/diary via sdk.log. By default, however, this logger only logs out to console. To enable support logging exports, you'll need to explicitly add the log exporter:
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
const sdk = new WorkersSDK(request, ctx, {
/* This is the service.name */
service: "worker",
/* The OTLP/HTTP JSON Endpoint to send traces */
endpoint: env.OTLP_ENDPOINT,
logExporter: new OTLPJsonLogExporter({
url: env.OTLP_ENDPOINT
}),
});
try {
sdk.log.info("Test Log!");
const response = await sdk.fetch("https://httpbin.org/headers/");
return sdk.sendResponse(response);
} catch (ex) {
sdk.captureException(ex);
}
},
};
By default this library uses OTLP/HTTP JSON both for size and simplicity reasons. However, this may not be supported by an import or you might the encoded format. If so, you can import and use the protobuf exporter like so:
import "opentelemetry-sdk-workers/performance";
import { WorkersSDK } from "opentelemetry-sdk-workers";
/** The proto exporter is packaged seperately due to it's size */
import { OTLPProtoTraceExporter } from "opentelemetry-sdk-workers/exporters/OTLPProtoTraceExporter";
export interface Env {
OTLP_ENDPOINT: string;
}
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
const sdk = new WorkersSDK(request, ctx, {
service: "sample-worker",
traceExporter: new OTLPProtoTraceExporter({
url: env.OTLP_ENDPOINT
})
});
const url = new URL(request.url);
const response = await sdk.fetch(`https://httpbin.org${url.pathname}`);
return sdk.res(response);
},
};
FAQs
Open Telemetry Cloudflare Workers Library. Provides a basic sdk for instrumenting workers.
The npm package @highlight-run/opentelemetry-sdk-workers receives a total of 2,195 weekly downloads. As such, @highlight-run/opentelemetry-sdk-workers popularity was classified as popular.
We found that @highlight-run/opentelemetry-sdk-workers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.