http_server

command
v0.0.0-...-80aead2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 16 Imported by: 0

README

HTTP Server with OpenTelemetry Example

This guide explains how to run the example Go application, which is instrumented with OpenTelemetry to send traces to a Jaeger UI via the OpenTelemetry Collector.

Prerequisites
  • Go (1.18+)
  • Docker & Docker Compose
Running the Example

1. Start Backend Services

Run the OpenTelemetry Collector and Jaeger using Docker Compose. In your terminal, execute:

  docker-compose up -d

This will start the necessary services in the background.

2. Run the HTTP Server

In a new terminal window, run the Go application:

  go run main.go

You should see the message: Server with Otel is ready.

3. Send a Test Request

To generate a trace, send an HTTP request to the instrumented endpoint:

  curl http://localhost:8080/ping-otel

4. View the Trace in Jaeger

Open your web browser and navigate to the Jaeger UI: http://localhost:16686

In the UI:

  • Select the httpserver service from the dropdown menu.
  • Click the "Find Traces" button.
  • You will see a trace for the /ping-otel request. Click on it to view the detailed waterfall diagram.
Cleanup

To stop and remove the Docker containers after you are finished, run:

  docker-compose down -v

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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