http-trace-span-propagation

command
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package http-trace-span-propagation demonstrates trace span propagation across HTTP, forge, and file I/O layers using the observer pattern.

Scenario:

  1. HTTP POST with JSON body {"name":"Alice"} to a greeting service.
  2. Server decodes JSON, calls a forge computation function.
  3. Forge writes the result to a temp file for persistence.
  4. Server returns the JSON greeting.

A single stats.NewFanout value wires a demo tracer, metrics, and structured logging. The tracer records parent→child span names to prove context propagation works through every layer.

Run with: go run ./examples/http-trace-span-propagation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL