bygui86 / go-traces

Go sample project to expose traces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go traces

Description

Some simple applications to explore how to push traces in various context:

  • http
  • grpc
  • broker

This is still a work-in-progress, here the TODO list.


TODOs

  • vector

    • internal grafana dashboard
    • host grafana dashboard
  • add k8s probes on each app

Apps

App code metrics logs traces dockerfile k8s manifests k8s probes status
standalone ok ok ok ok ok ok todo ready
grpc-server ok ok ok ok ok ok todo ready
grpc-client ok ok ok ok ok ok todo ready
http-server-db ok ok ok ok ok ok todo ready
http-server ok ok ok ok ok ok todo ready
http-client ok ok ok ok ok ok todo ready
kubemq-producer ok ok ok ok ok ok todo ready
kubemq-consumer ok ok ok ok ok ok todo ready
kafka-producer ok ok ok ok ok ok todo ready
kafka-consumer ok ok ok ok ok ok todo ready

How to start

1. Kubernetes cluster (Minikube)

make start-minikube

2. Infrastructure

make deploy-all-infra

3. Applications

make deploy-all-apps

4. Observe

In a terminal port-forward Grafana

make port-forw-grafana

Go to http://localhost:3000 in the browser to access Grafana dashboards

Credentials:

username: admin password: secret

5. Generate HTTP applications traces

  1. Open port forwarding to http-client

  2. Use the Postman provided to make some REST requests

6. Cleanup

make stop-minikube delete-minikube

Observability

Tracing

Tracing technologies:

  • Jaeger, working as expected
  • Zipkin, tested only locally, not in Kubernetes
  • GrafanaTempo, not able to receive traces from same applications using Jaeger library

All applications support both Jaeger and Zipkin.

Tracing configurations can be set through environment variables:

EnvVar Default Available values
ENABLE_TRACING true true, false

All default Jaeger environment variables are fully supported transparently.

Monitoring

Monitoring technologies:

  • node-exporter
  • kube-state-metrics
  • prometheus-adapter
  • Prometheus
  • Grafana

All applications expose :9090/metrics endpoint.

Monitoring configurations can be set through environment variables:

EnvVar Default Available values
ENABLE_MONITORING true true, false
MONITOR_HOST 0.0.0.0 -
MONITOR_PORT 9090 -

Logging

Logging technologies:

  • (TBD) Promtail or Vector
  • GrafanaLoki

All applications use go.uber.org/zap as logging library.

All applications log per default to stdout.

Logging configurations can be set through environment variables:

EnvVar Default Available values
LOG_ENCODING console console, json
LOG_LEVEL info trace, debug, info, warn, error, fatal

Links

OpenCensus

OpenTracing

OpenTelemetry

Jaeger

Zipkin

Internal propagation

Grafana Tempo

DB

HTTP tracing

gRPC tracing

Broker tracing

Kafka
KubeMQ

Kubernetes

Tools

Grafana

Integrate Loki with Jaeger (logs -> traces)

Integrate Jaeger with Loki (traces -> logs)

About

Go sample project to expose traces

License:Apache License 2.0


Languages

Language:Go 85.8%Language:Makefile 9.0%Language:Shell 3.1%Language:Dockerfile 2.1%