From bf25ed0e8f4152c7cc72ee5a04c48aa59c5e579b Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Mon, 26 Aug 2024 16:49:50 -0700 Subject: [PATCH] Add Go OTLP over gRPC exporter section (#5104) Co-authored-by: Mike Dame Co-authored-by: Tiffany Hrabusa <30397949+tiffany76@users.noreply.github.com> Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com> Co-authored-by: Phillip Carter --- content/en/docs/languages/go/exporters.md | 22 +++++++++++++++++++++- static/refcache.json | 4 ++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/content/en/docs/languages/go/exporters.md b/content/en/docs/languages/go/exporters.md index bb948c41b50f..1bf33529e974 100644 --- a/content/en/docs/languages/go/exporters.md +++ b/content/en/docs/languages/go/exporters.md @@ -3,7 +3,7 @@ title: Exporters aliases: [exporting_data] weight: 50 # prettier-ignore -cSpell:ignore: otlplog otlploghttp otlpmetric otlpmetricgrpc otlpmetrichttp otlptrace otlptracegrpc otlptracehttp promhttp stdoutlog stdouttrace +cSpell:ignore: otlplog otlploggrpc otlploghttp otlpmetric otlpmetricgrpc otlpmetrichttp otlptrace otlptracegrpc otlptracehttp promhttp stdoutlog stdouttrace --- {{% docs/languages/exporters/intro go %}} @@ -222,3 +222,23 @@ func newExporter(ctx context.Context) (log.Exporter, error) { return otlploghttp.New(ctx) } ``` + +### OTLP logs over gRPC (Experimental) + +[`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc) +contains an implementation of OTLP logs exporter using gRPC. + +Here's how you can create an exporter with default configuration: + +```go +import ( + "context" + + "go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc" + "go.opentelemetry.io/otel/sdk/log" +) + +func newExporter(ctx context.Context) (log.Exporter, error) { + return otlploggrpc.New(ctx) +} +``` diff --git a/static/refcache.json b/static/refcache.json index 0e1f0b96b00b..905432935966 100644 --- a/static/refcache.json +++ b/static/refcache.json @@ -8167,6 +8167,10 @@ "StatusCode": 200, "LastSeen": "2024-01-18T19:10:29.862565-05:00" }, + "https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc": { + "StatusCode": 200, + "LastSeen": "2024-08-26T18:58:45.152084327Z" + }, "https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp": { "StatusCode": 200, "LastSeen": "2024-04-25T07:21:16.712986-07:00"