Zum Inhalt springen
NEUMarktplatz und dein Team: Verkaufe, was du baust, und bekomm Pläne und Änderungen, die getestet sind, bevor du sie siehst. Neuigkeiten ansehen

Bibliothek / Monitoring, Betrieb & Störungen

Monitoring, Betrieb & Störungen

Trace simulated card charges with OpenTelemetry and Jaeger

When an API call/webhook arrives, it monitors systems.

Was sie bewirkt

## Trace a simulated charge workflow with OpenTelemetry and Jaeger ### Quick overview This workflow simulates a card charge so you can send n8n's OpenTelemetry spans to a local Jaeger collector and compare a successful run with a deliberate failure. It needs no LLM credential and calls no payment provider. It is the Exercise 3 template from the n8n Production AI Playbook post on Audit & Trace. OpenTelemetry tracing in n8n is in Preview. ### How it works 1. Receives a POST webhook request with a requestId and amount. 2. Validate Amount (If) sends invalid amounts to Reject Request (Stop and Error). 3. Normalize Request (Edit Fields) converts the amount to cents. 4. Charge Card (If) routes requests with trigger_failure to Decline Charge, a Stop and Error node that fails with card_declined. 5. Capture Charge records the successful charge and Respond returns it. ### Setup 1. Run Jaeger locally (image jaegertracing/jaeger:2.20.0 with ports 16686 and 4318) and expose port 4318 with cloudflared tunnel --url http://localhost:4318. 2. As an instance owner or admin, open Settings > OpenTelemetry, enter the tunnel URL as the OTLP endpoint, set the sample rate to 1, turn off Track published workflows only, and enable tracing. 3. Select Execute workflow and POST {"requestId":"REQ-3001","amount":49.99}, then {"requestId":"REQ-3002","amount":49.99,"trigger_failure":true}. 4. In Jaeger, search the tag n8n.execution.id with each execution ID and inspect the spans.

Die Schritte

  1. Webhook - Charge Request
  2. Respond
  3. Validate Amount
  4. Reject Request
  5. Normalize Request
  6. Charge Card
  7. Decline Charge
  8. Capture Charge

Ähnliche Automatisierungen