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.
-
vector
- internal grafana dashboard
- host grafana dashboard
-
add k8s probes on each app
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 |
make start-minikube
make deploy-all-infra
make deploy-all-apps
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
make stop-minikube delete-minikube
Tracing technologies:
Jaeger
, working as expectedZipkin
, tested only locally, not in KubernetesGrafanaTempo
, 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 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 technologies:
- (
TBD
)Promtail
orVector
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 |
- https://github.com/opencensus-integrations/ocsql
- https://opencensus.io/stats/
- https://opencensus.io/exporters/supported-exporters/go/prometheus/
- https://opentracing.io/
- https://opentracing.io/guides/golang/
- https://github.com/opentracing/opentracing-go
- https://github.com/opentracing-contrib/examples/
- https://www.reddit.com/r/golang/comments/cyahcp/help_wanted_with_opentracing_inject_extract_using/
- https://opentelemetry.io/
- https://github.com/open-telemetry/opentelemetry-go
- https://github.com/open-telemetry/opentelemetry-collector
- https://www.jaegertracing.io/
- https://www.jaegertracing.io/docs/1.21/troubleshooting/
- https://github.com/jaegertracing/jaeger-client-go
- https://github.com/openzipkin/zipkin-go
- https://github.com/openzipkin/zipkin-go/blob/master/example_httpserver_test.go
- https://github.com/openzipkin-contrib/zipkin-go-opentracing
- https://github.com/openzipkin/zipkin-dependencies
- https://medium.com/devthoughts/instrumenting-a-go-application-with-zipkin-b79cc858ac3e
- https://github.com/ExpansiveWorlds/instrumentedsql -
ADOPTED SOLUTION
- https://medium.com/@bas.vanbeek/opencensus-and-go-database-sql-322a26be5cc5
- https://opencensus.io/codelabs/gosqlguide/#0
- https://github.com/opencensus-integrations/ocsql -
NOT WORKING
- https://github.com/gchaincl/sqlhooks -
NOT TESTED
- https://github.com/luna-duclos/instrumentedsql -
NOT TESTED
- https://docs.lightstep.com/docs/go-add-spans
- https://github.com/alextanhongpin/go-jaeger-trace
- https://medium.com/opentracing/tracing-http-request-latency-in-go-with-opentracing-7cc1282a100a
- https://medium.com/@marcus.olsson/writing-a-go-client-for-your-restful-api-c193a2f4998c
- https://medium.com/@marcus.olsson/adding-context-and-options-to-your-go-client-package-244c4ad1231b
- https://medium.com/swlh/distributed-tracing-for-go-microservice-with-opentracing-1fc1aec76b3e
- https://github.com/jfeng45/grpcservice
- https://github.com/opentracing-contrib/go-grpc
- https://github.com/confluentinc/confluent-kafka-go
- https://github.com/jaegertracing/jaeger/blob/master/pkg/kafka/producer/config.go (shopify/sarama kafka library)
- https://github.com/kubemq-io/kubemq-go
- https://github.com/kubemq-io/kubemq-go/blob/master/event_store.go
- https://github.com/kubemq-io/kubemq-go/blob/master/trace.go
- https://grafana.com/blog/2019/11/22/kubecon-demo-a-preview-of-grafana-jaeger/
- https://grafana.com/go/introduction-to-distributed-tracing