Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import "fmt"
type Span struct {
Service string
Action string
}
func createSpan(service string, action string) Span {
return Span{
Service: service,
Action: action,
}
}
func main() {
trace := []Span{
createSpan("API Gateway", "Receive Request"),
createSpan("User Service", "Fetch User"),
createSpan("Database", "Query User"),
}
fmt.Println("Distributed Trace")
for _, span := range trace {
fmt.Println(span.Service, "-", span.Action)
}
fmt.Println("Trace exported to Jaeger")
}Coding works best on desktop or with an external keyboard.