Skip to content

Opinionated observability helpers for Go (logging, metrics, tracing, config)

License

Notifications You must be signed in to change notification settings

johnitvn/go-observability

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Release Coveralls GitHub License Open in DevContainer

go-observability

Go Observability

Lightweight observability building blocks for Go microservices.

go-observability provides a compact, opinionated set of helpers for:

  • Configuration loading and validation (BaseConfig, environment and LDFlags support)
  • Structured JSON logging powered by Zap
  • OpenTelemetry integration (tracing + metrics) with sensible defaults
  • Gin middleware and gRPC interceptors for tracing, logging and panic recovery

Documentation

Comprehensive documentation and examples are published in the docs/ folder and the project site:

  • Docs folder: docs/index.md
  • Local preview: run task docs-serve (see Taskfile.yml)

Quick start

Install the library and use it in your service by embedding observability.BaseConfig and calling observability.LoadCfg, observability.NewLogger and observability.InitOtel during startup. See full examples in the examples/ directory.

Examples

Hands-on examples are available under examples/:

  • examples/gin-example — Gin middleware demo (route skipping, panic recovery, metrics)
  • examples/gin-service — Simple Gin service
  • examples/grpc-service — gRPC server with interceptors and grpcurl examples
  • examples/simple-service — Minimal example with /ping

Development & docs workflow

Use the provided Taskfile for common tasks:

# Install docs tools locally (recommended: pipx)
task docs-install-pipx

# Serve docs locally
task docs-serve

# Run linters and tests
task lint
task analysis
task test

Contributing

See CONTRIBUTING.md and docs/contributing.md for contribution guidelines, PR templates and code review expectations.

License

This project is licensed under the terms in the LICENSE file.

About

Opinionated observability helpers for Go (logging, metrics, tracing, config)

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 83.1%
  • Shell 15.5%
  • Dockerfile 1.4%