examples/

directory
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: GPL-3.0

README

Examples

This directory contains various usage examples for the initial-config-go library.

Available Examples

1. Basic

A minimal example showing how to initialize the library with default settings and perform basic logging.

2. Custom Configuration

Shows how to:

  • Define custom configuration keys and default values.
  • Use WithProps for manual property setting.
  • Set a custom environment variable prefix.
  • Overwrite values via environment variables.
3. HTTP Client

Demonstrates the use of the instrumented HTTP client, which provides:

  • Automatic request/response logging.
  • Trace propagation (when telemetry is enabled).
4. Redaction

Shows how to configure and use the log redaction feature to protect sensitive data (e.g., passwords, API keys) from being leaked into logs.

5. Telemetry

A comprehensive example showing full OpenTelemetry integration (Traces, Metrics, and Logs) with a Grafana LGTM stack.

Running the Examples

Each example has a Makefile for convenience. Navigate to the example directory and run:

make run

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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