Skip to content

Commit

Permalink
add console log export details for go (#4357)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
Co-authored-by: Phillip Carter <pcarter@fastmail.com>
  • Loading branch information
3 people authored Apr 24, 2024
1 parent 8d7c40e commit adb7216
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 20 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: otlpmetric otlpmetricgrpc otlpmetrichttp otlptrace otlptracegrpc otlptracehttp promhttp stdouttrace
cSpell:ignore: otlpmetric otlpmetricgrpc otlpmetrichttp otlptrace otlptracegrpc otlptracehttp promhttp stdoutlog stdouttrace
---

{{% docs/languages/exporters/intro go %}}
Expand Down Expand Up @@ -49,6 +49,25 @@ func newExporter() (metric.Exporter, error) {
}
```

### Console logs (Experimental) {#console-logs}

The
[`go.opentelemetry.io/otel/exporters/stdout/stdoutlog`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/stdout/stdoutlog)
package contains an implementation of the console log exporter.

Here's how you can create an exporter with default configuration:

```go
import (
"go.opentelemetry.io/otel/exporters/stdout/stdoutlog"
"go.opentelemetry.io/otel/sdk/log"
)

func newExporter() (log.Exporter, error) {
return stdoutlog.New()
}
```

## OTLP

To send trace data to an OTLP endpoint (like the [collector](/docs/collector) or
Expand Down
4 changes: 4 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -6875,6 +6875,10 @@
"StatusCode": 200,
"LastSeen": "2024-01-18T19:07:44.890589-05:00"
},
"https://pkg.go.dev/go.opentelemetry.io/otel/exporters/stdout/stdoutlog": {
"StatusCode": 200,
"LastSeen": "2024-04-24T13:46:14.851022-07:00"
},
"https://pkg.go.dev/go.opentelemetry.io/otel/exporters/stdout/stdoutmetric": {
"StatusCode": 200,
"LastSeen": "2024-01-30T15:25:21.196671-05:00"
Expand Down

0 comments on commit adb7216

Please sign in to comment.