Categorygithub.com/twistingmercury/telemetry

# README

CodeQL Run Tests codecov

Telemetry Package

This package was created to help me reduce a bunch of repetitive tasks in creating a Go application. All of the apps and services need logging, distributed tracing, and metrics.

Features

  • Logging: The package provides a logging system built on top of the zerolog library. It supports various log levels (debug, info, warn, error, fatal, panic) and allows adding custom key-value pairs to log messages. The logging system also integrates with OpenTelemetry tracing to include trace and span information in log messages.

  • Metrics: The package utilizes Prometheus to collect metrics. It provides a simple way to initialize a metrics collector, which can be used to record metrics throughout the application.

  • Tracing: The package integrates with OpenTelemetry tracing to collect and export trace data. It provides functions to initialize a tracer provider, extract trace context from incoming requests, and start new spans for outgoing requests or internal operations. The package allows configuring the batching duration for the tracing batch processor.

Installation

To install the Telemetry package, use the following command:

go get github.com/twistingmercury/telemetry

Usage and examples

A make file exists in the _example directory where by you can run the examples.

Logging

Metrics

Tracing

A complete example of using all three at once can be found here: Complete Example

Contributing

Contributions to the Telemetry package are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

The Telemetry package is open-source and released under the MIT License.

# Packages

No description provided by the author