Last active
September 18, 2024 14:02
-
-
Save joelrebel/5bcd4cc0e3c734a291899587727ed00a to your computer and use it in GitHub Desktop.
otel test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "time" | |
| "github.com/equinix-labs/otel-init-go/otelinit" | |
| "go.opentelemetry.io/otel" | |
| ) | |
| func main() { | |
| ctx, otelShutdown := otelinit.InitOpenTelemetry(context.Background(), "otel-tester") | |
| defer otelShutdown(ctx) | |
| ctx, span := otel.Tracer("main").Start( | |
| ctx, | |
| "main", | |
| ) | |
| time.Sleep(5 * time.Second) | |
| defer span.End() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment