https://github.com/fortio/otel-sample-app
Simple in/out app to demonstrate Open Telemetry tracing in and out
https://github.com/fortio/otel-sample-app
Last synced: 4 months ago
JSON representation
Simple in/out app to demonstrate Open Telemetry tracing in and out
- Host: GitHub
- URL: https://github.com/fortio/otel-sample-app
- Owner: fortio
- License: apache-2.0
- Created: 2022-12-29T22:33:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-22T03:54:07.000Z (5 months ago)
- Last Synced: 2025-05-22T17:32:04.465Z (5 months ago)
- Language: Go
- Size: 7.4 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Open Telemetry (OTEL) Sample App
# Install
using golang 1.18+
Locally
```shell
go install fortio.org/otel-sample-app@latest
```Or Docker - optimized for istio kubernetes cluster
# Testing:
Start a local jaeger with otel receiver:
```
docker run -p 16686:16686 -p 4317:4317 jaegertracing/all-in-one:latest --collector.otlp.enabled=true
``````
fortio server & # echo/debug server
OTEL_SERVICE_NAME=local-test go run . -b3multi -listen :8000 -url http://localhost:8080/debug &
curl -v localhost:8000
```Get traces: http://localhost:16686/search
See also [Makefile](Makefile) for examples.
The [Dockerfile](Dockerfile) is setup for istio/envoy 1.15.x config with `b3` multi headers (what istio envoy uses by default).
# Documentation
Initially loosely based on
https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/net/http/httptrace/otelhttptrace
and
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/net/http/otelhttp/example/client/client.go
and
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/net/http/otelhttp/example/server/server.go
all combined
(which doesn't work without an outer span setup first in the context, see [fortio/fortiotel/simple](https://github.com/fortio/fortiotel/blob/main/simple/otel_httptrace_simple.go))