Categorygithub.com/bygui86/go-traces
repository
0.0.0-20210730120257-16b6e5ba9c99
Repository: https://github.com/bygui86/go-traces.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

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

Appcodemetricslogstracesdockerfilek8s manifestsk8s probesstatus
standaloneokokokokokoktodoready
grpc-serverokokokokokoktodoready
grpc-clientokokokokokoktodoready
http-server-dbokokokokokoktodoready
http-serverokokokokokoktodoready
http-clientokokokokokoktodoready
kubemq-producerokokokokokoktodoready
kubemq-consumerokokokokokoktodoready
kafka-producerokokokokokoktodoready
kafka-consumerokokokokokoktodoready

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:

EnvVarDefaultAvailable values
ENABLE_TRACINGtruetrue, 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:

EnvVarDefaultAvailable values
ENABLE_MONITORINGtruetrue, false
MONITOR_HOST0.0.0.0-
MONITOR_PORT9090-

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:

EnvVarDefaultAvailable values
LOG_ENCODINGconsoleconsole, json
LOG_LEVELinfotrace, 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)