{"repo":"evanderkoogh/otel-cf-workers","free":true,"listed":false,"github":"https://github.com/evanderkoogh/otel-cf-workers","clone":"git clone https://github.com/evanderkoogh/otel-cf-workers.git","description":"An OpenTelemetry compatible library for instrumenting and exporting traces for Cloudflare Workers","language":"TypeScript","stars":395,"topics":["cloudflare","observability","otel","workers"],"license":"BSD-3-Clause","category":"analytics","readme_excerpt":"otel-cf-workers An OpenTelemetry compatible library for instrumenting and exporting traces from Cloudflare Workers. [!IMPORTANT] I have not been able to keep up with maintaining this library as much as I should have, but most importantly, a lot of the functionality in this package is now part of the Cloudflare Workers platform. You should always first try to use Workers Tracing — the OTEL tracing that is built into the Cloudflare Workers runtime, which automatically instruments your code and provides APIs to write custom spans, and export traces to external destinations, with or without persisting data to Cloudflare. bash npm install @microlabs/otel-cf-workers @opentelemetry/api json compatibility flags = [ \"nodejs compat\" ] typescript import { trace } from '@opentelemetry/api' import { instrument, ResolveConfigFn } from '@microlabs/otel-cf-workers' export interface Env { HONEYCOMB API KEY: string OTEL TEST: KVNamespace } const handler = { async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise { await fetch('https://cloudflare.com') const greeting = \"G'day World\" trace.getActiveSpan()?.setAttribute('greeting', greeting) ctx.waitUntil(fetch('https://workers.dev')) return new Response( ${greeting}! ) }, } const config: ResolveConfigFn = (env: Env, trigger) = { return { exporter: { url: 'https://api.honeycomb.io/v1/traces', headers: { 'x-honeycomb-team': env.HONEYCOMB API KEY }, }, service: { name: 'greetings' }, } } export default instrument(handler, config) ty","default_branch":null,"files":null,"tree":[],"storefront":"/r/evanderkoogh","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/evanderkoogh/otel-cf-workers/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}