Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mralias/collex

Use OpenTelemetry Collector Factories to Export with OpenTelemetry Go
https://github.com/mralias/collex

go golang opentelemetry opentelemetry-go otel tracing

Last synced: 21 days ago
JSON representation

Use OpenTelemetry Collector Factories to Export with OpenTelemetry Go

Awesome Lists containing this project

README

        

# collex

Use [OpenTelemetry Collector] Exporters with [OpenTelemetry Go]

:warning:
This project is a work in progress :construction:.
Breaking changes may be introduced.
:warning:

## Getting Started

OpenTelemetry Collector exporters are generated from [ExporterFactory]s.
First wrap this facotry with `collex`.

```go
factory, err := collex.NewFactory(your.NewFactory(), nil)
if err != nil {
// Handle error appropiately.
}
```

### Tracing

Generate a [SpanExporter] from your `collex.Factory`.

```go
exp, err := factory.SpanExporter(context.Background(), nil)
if err != nil {
// Handle error appropiately.
}
provider := trace.NewTracerProvider(trace.WithBatcher(exp))
```

Use `provider` as any other OpenTelemetry Go [TracerProvider] to generate tracing telemetry.

[OpenTelemetry Collector]: https://github.com/open-telemetry/opentelemetry-collector
[OpenTelemetry Go]: https://github.com/open-telemetry/opentelemetry-go
[ExporterFactory]: https://pkg.go.dev/go.opentelemetry.io/[email protected]/component#ExporterFactory
[SpanExporter]: https://pkg.go.dev/go.opentelemetry.io/otel/[email protected]/trace#SpanExporter
[TracerProvider]: https://pkg.go.dev/go.opentelemetry.io/otel/[email protected]/trace#TracerProvider