go-trace

module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2023 License: Apache-2.0

README

go-trace

Lint CI Coverage Status Vulnerability Check Go Report Card

GitHub tag (latest by date) Go Reference license

Logging & tracing utilities for micro services.

Based on:

  • go.uber.org/zap
  • go.opencensus.io/trace

Tested to be compatible wih Datadog tracing.

Logging

The main idea is to unify logging and tracing, and insulate the app layer from the intricacies of tracing.

This repo provides a few wrappers around a zap.Logger:

  • a logger factory based on zap logger, with a convenient builder to link logs to trace spans
  • a logger builder, e.g. to initialize a root logger for your service
  • a simple middleware to trace a http.Handler
Exporters

Various opencensus exporters.

  • influxdb: export opencensus metrics to an influxdb sink
  • amplitude (experimental): propagate trace event to the amplitude API

TODOs:

  • [] opentelemetry/opentracing

Tracing

Simple utilities to instrument tracing inside apps.

Example Usage

Credits

Much inspired by prior art from @casualjim. Thanks so much.

Directories

Path Synopsis
log
exporters
Package exporter provides extra trace span exporters, which may be added to some standard exporter such as jaeger or datadog.
Package exporter provides extra trace span exporters, which may be added to some standard exporter such as jaeger or datadog.
exporters/amplitude
Package amplitude exposes an exporter to route span traces to the Amplitude API.
Package amplitude exposes an exporter to route span traces to the Amplitude API.
exporters/influxdb
Package influxdb exposes an opencensus stats exporter for influxdb.
Package influxdb exposes an opencensus stats exporter for influxdb.
exporters/opentelemetry
Package opentelemetry should export traces produced by opencensus package to an opentelemetry backend.
Package opentelemetry should export traces produced by opencensus package to an opentelemetry backend.
Package tracer starts an opencensus span with a logger automatically signed with the current calling function.
Package tracer starts an opencensus span with a logger automatically signed with the current calling function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL