open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/docs/languages/go
Apache License 2.0
5.29k stars 1.08k forks source link

OTEL log sample for GO SDK #5980

Closed alexFilichkin closed 3 hours ago

alexFilichkin commented 4 hours ago

I need to write logs from a Golang app to OTEL Collector. I cannot find an example of using the OTEL SDK for Go for logging. I know it's in beta, but we should have some samples anyway.

pellared commented 4 hours ago

I cannot find an example of using the OTEL SDK for Go for logging.

How long have you been trying? I hope that they are pretty accessible in multiple places.

From https://github.com/open-telemetry/opentelemetry-go:

The examples are a good way to see some practical uses of this process.

You can there find:

Under https://opentelemetry.io/docs/languages/go/ we have:

We have also an example in Go Logs SDK package docs: