diff --git a/examples/getting-started/go/main.go.txt b/examples/getting-started/go/main.go.txt deleted file mode 100644 index bdc96029fc..0000000000 --- a/examples/getting-started/go/main.go.txt +++ /dev/null @@ -1,89 +0,0 @@ -// package main - -// import ( -// "context" -// "fmt" -// "io" -// "log" -// "net/http" - -// "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" -// "go.opentelemetry.io/otel" -// "go.opentelemetry.io/otel/baggage" -// "go.opentelemetry.io/otel/exporters/otlp/otlptrace" -// "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" -// "go.opentelemetry.io/otel/propagation" -// sdktrace "go.opentelemetry.io/otel/sdk/trace" -// "go.opentelemetry.io/otel/trace" -// ) - -// var tracer trace.Tracer - -// func initTracer() { -// ctx := context.Background() - -// client := otlptracehttp.NewClient() - -// otlpTraceExporter, err := otlptrace.New(ctx, client) -// if err != nil { -// log.Fatal(err) -// } - -// batchSpanProcessor := sdktrace.NewBatchSpanProcessor(otlpTraceExporter) - -// tracerProvider := sdktrace.NewTracerProvider( -// sdktrace.WithSpanProcessor(batchSpanProcessor), -// ) - -// defer func() { _ = tracerProvider.Shutdown(ctx) }() - -// otel.SetTracerProvider(tracerProvider) -// otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator( -// propagation.TraceContext{}, propagation.Baggage{})) -// } - -// func ping(w http.ResponseWriter, r *http.Request) { -// client := http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)} -// ctx := baggage.ContextWithoutBaggage(context.Background()) - -// req, _ := http.NewRequestWithContext(ctx, "GET", "http://tracetest.io", nil) - -// fmt.Printf("Sending request...\n") -// res, err := client.Do(req) -// if err != nil { -// panic(err) -// } -// fmt.Printf("Response status code: %v\n", res.Status) -// fmt.Printf("Waiting for few seconds to export spans ...\n\n") - -// resp := "Waiting for few seconds to export spans ..." -// if _, err := io.WriteString(w, resp); err != nil { -// log.Printf("Write failed: %v\n", err) -// } -// } - -// func main() { -// // Initialize tracer -// initTracer() - -// // Get a tracer -// tracer := otel.Tracer("example-tracer") - -// // Start a span -// ctx, span := tracer.Start(context.Background(), "example-operation") -// defer span.End() - -// // Example function work -// fmt.Println("Tracing in action!") - -// // Add an event to the span -// span.AddEvent("Example event") - -// // Example of creating a child span -// _, childSpan := tracer.Start(ctx, "example-child-operation") -// defer childSpan.End() - -// http.HandleFunc("/", ping) - -// log.Fatal(http.ListenAndServe(":8080", nil)) -// } \ No newline at end of file