_example

command
v0.0.0-...-a0b1be5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT, MIT Imports: 7 Imported by: 0

README

tracing

Go Report Card GoDoc

A simple implementation of the api gateway, server1, server2 and server3 examples.

To build:

go build api_gateway.go
go build server1.go
go build server2.go
go build server3.go

To run, open four terminals, and execute the following:

./api_gateway
./server1
./server2
./server3

To test:

curl -X POST http://localhost:8000/service1 -v
curl -X POST http://localhost:8000/service2 -v

Header information is printed to stdout. You should see headers propagated from service to service.

On the API gateway:

Incoming Headers
User-Agent: [curl/7.47.0]
Accept: [*/*]
Outgoing Headers
X-B3-Traceid: [34a0552a76c40432]
X-B3-Spanid: [34a0552a76c40432]
X-B3-Sampled: [1]

On service1:

Incoming headers
User-Agent: [Go-http-client/1.1]
Content-Length: [0]
X-B3-Sampled: [1]
X-B3-Spanid: [65025274cfd25c6b]
X-B3-Traceid: [65025274cfd25c6b]
Accept-Encoding: [gzip]
Outgoing headers
X-B3-Traceid: [65025274cfd25c6b]
X-B3-Parentspanid: [65025274cfd25c6b]
X-B3-Spanid: [f8ef4e9c50cad67]
X-B3-Sampled: [1]

On service3:

Incoming Headers
X-B3-Spanid: [aa66150e951c54c]
X-B3-Traceid: [10386b198f22ca04]
Accept-Encoding: [gzip]
User-Agent: [Go-http-client/1.1]
Content-Length: [0]
X-B3-Parentspanid: [10386b198f22ca04]
X-B3-Sampled: [1]

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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