All Integrations
Standardswrangler.toml + Workers OTel

Cloudflare Integration

Workers execution metrics, cache hit analytics, WAF event monitoring, and edge-to-origin distributed tracing for your Cloudflare infrastructure.

Setup

How It Works

01

Add TigerOps to wrangler.toml

Add the TigerOps OTLP endpoint and API key to your wrangler.toml as environment bindings. The TigerOps Workers SDK uses the Cloudflare OTel library compatible with the Workers runtime.

02

Wrap Your Worker Handler

Import withTigerOps from @tigerops/cloudflare-workers and wrap your fetch handler. The wrapper creates a root trace span per request with request metadata and propagates context downstream.

03

Enable Cloudflare Analytics

Connect TigerOps to Cloudflare via the Cloudflare API key in TigerOps settings. This pulls zone-level analytics: cache ratios, WAF events, DDoS threat scores, and CDN performance by PoP.

04

Edge to Origin Correlation

TigerOps links Cloudflare edge request traces to your origin service traces using the cf-ray trace propagation. See the full path from Cloudflare edge to database query in one trace.

Capabilities

What You Get Out of the Box

Workers Execution Metrics

CPU time, wall time, memory usage, and error count per Cloudflare Worker. TigerOps alerts when Worker CPU limits are approached and identifies which operations are most expensive.

Cache Hit Rate & Analytics

Cache hit ratio, bytes saved, and origin pull rate per Cloudflare zone and per URL pattern. TigerOps tracks cache efficiency trends and alerts on unexpected cache invalidation events.

WAF & Security Events

WAF rule match counts, blocked request rates, bot management scores, and DDoS challenge events. TigerOps correlates security events with backend traffic anomalies.

Edge Request Latency

Request latency per Cloudflare PoP, TTFB distribution, and origin response time vs edge response time. Identify which regions have the highest origin pull rates.

Workers KV & D1 Metrics

Workers KV read/write latency, storage utilization, and D1 database query performance. Monitor all Cloudflare storage primitives alongside your Workers execution metrics.

Durable Objects Telemetry

Durable Object invocation counts, storage read/write operations, and WebSocket connection counts per namespace. Track Durable Object performance under concurrent load.

Configuration

wrangler.toml + Worker Trace Setup

Configure TigerOps in your Cloudflare Workers project and wrap your fetch handler.

wrangler.toml + worker.ts
# wrangler.toml
name = "my-worker"
main = "src/worker.ts"
compatibility_date = "2024-09-23"
compatibility_flags = ["nodejs_compat"]

# TigerOps configuration via environment bindings
[vars]
TIGEROPS_SERVICE_NAME = "my-cloudflare-worker"
TIGEROPS_ENVIRONMENT = "production"

# Set secret via: wrangler secret put TIGEROPS_API_KEY
# (Never commit API keys to wrangler.toml)

---
# src/worker.ts — wrap your handler with TigerOps
import { withTigerOps, instrument } from '@tigerops/cloudflare-workers'

interface Env {
  TIGEROPS_API_KEY: string
  TIGEROPS_SERVICE_NAME: string
  MY_KV: KVNamespace
  MY_D1: D1Database
}

const handler = {
  async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
    const url = new URL(request.url)

    // KV and D1 operations are automatically traced
    const cachedValue = await env.MY_KV.get(url.pathname)
    if (cachedValue) {
      return new Response(cachedValue, {
        headers: { 'content-type': 'application/json' }
      })
    }

    const result = await env.MY_D1
      .prepare('SELECT * FROM products WHERE slug = ?')
      .bind(url.pathname.slice(1))
      .first()

    return Response.json(result)
  }
}

// Wrap with TigerOps — instruments fetch, KV, D1, R2 automatically
export default instrument(handler, {
  serviceName: (env: Env) => env.TIGEROPS_SERVICE_NAME,
  apiKey: (env: Env) => env.TIGEROPS_API_KEY,
})
FAQ

Common Questions

Does TigerOps support the Cloudflare Workers OTel library?

Yes. TigerOps' OTLP endpoint accepts traces from the @microlabs/otel-cf-workers library, which is the standard OTel library for Cloudflare Workers. You can use @tigerops/cloudflare-workers (a thin wrapper) or configure @microlabs/otel-cf-workers directly to export to TigerOps.

How does TigerOps access Cloudflare analytics without the Workers SDK?

TigerOps uses the Cloudflare Analytics GraphQL API to pull zone-level metrics (cache, WAF, DNS) using a read-only Cloudflare API token. No Workers code changes are required for zone-level analytics — only the API token needs to be configured in TigerOps.

Can TigerOps monitor Cloudflare Pages Functions?

Yes. Cloudflare Pages Functions run on the Workers runtime. Wrap your Pages Function handlers with the same withTigerOps wrapper used for Workers. The same environment variable bindings in wrangler.toml apply to Pages projects.

Does TigerOps support Cloudflare R2 and Queue metrics?

Yes. Cloudflare R2 operation metrics (GET/PUT/DELETE rates and latency) and Cloudflare Queues (message throughput, consumer latency, dead letter counts) are available via the Cloudflare Analytics API integration.

How do I trace requests from Cloudflare Workers to my origin server?

TigerOps propagates W3C traceparent headers from the Workers request to your origin. Ensure your Workers code passes the incoming headers to upstream fetch() calls using the TigerOps context propagation helper. The origin server's TigerOps SDK picks up the traceparent and links the spans automatically.

Get Started

Observe Your Entire Cloudflare Edge Stack

Workers traces, cache analytics, WAF events, and edge-to-origin correlation — all in one TigerOps workspace.