Awesome Open Source
Awesome Open Source

Loki: Simple Distributed Tracing

Loki is a distributed tracing system inspired by Zipkin and Prometheus.

  • Pull Based: a central Loki app pull traces from your instrumented applications
  • Service Discover: using Prometheus' Service Discovery frameworks allows Loki to discover your app within many popular orchestrators (Kubernetes, Mesos etc) or service discovery systems (Consul, DNS etc)

Loki consists of:

  • A OpenTracing compatible tracer
  • The Loki app

Internally Loki is really just an opinionated reimplementation of OpenZipkin.

Instrumenting your app

Instrument you go application according to OpenTracing

import (
    "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
    "github.com/weaveworks-experiments/pkg/loki/client"
)

func main() {
    // Create a Loki tracer
    tracer, err := loki.NewTracer(loki.DefaultConfig)

  	// explicitly set our tracer to be the default tracer.
  	opentracing.InitGlobalTracer(tracer)

    // Create an instrumented gRPC server
    s := grpc.NewServer(
        grpc.UnaryInterceptor(
            otgrpc.OpenTracingServerInterceptor(tracer),
        ),
    )

    // Register a http handler for Loki
    http.Handle("/traces", loki.Handler())
    log.Fatal(http.ListenAndServe(":8080", nil))
}
Alternatives To Loki
Select To Compare


Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Go (163,841
Prometheus (6,055
Discovery (4,973
Tracing (3,585
Zipkin (986
Opentracing (713
Distributed Tracing (325
Openzipkin (63