Skip to content

Commit

Permalink
Add Go OTLP over gRPC exporter section (#5104)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Dame <[email protected]>
Co-authored-by: Tiffany Hrabusa <[email protected]>
Co-authored-by: opentelemetrybot <[email protected]>
Co-authored-by: Phillip Carter <[email protected]>
  • Loading branch information
5 people authored Aug 26, 2024
1 parent 93e799d commit bf25ed0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
22 changes: 21 additions & 1 deletion content/en/docs/languages/go/exporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}}
Expand Down Expand Up @@ -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)
}
```
4 changes: 4 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bf25ed0

Please sign in to comment.