Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/mralias/collex
- Owner: MrAlias
- License: apache-2.0
- Created: 2022-09-09T22:52:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-31T15:16:04.000Z (9 months ago)
- Last Synced: 2024-03-31T16:26:19.519Z (9 months ago)
- Topics: go, golang, opentelemetry, opentelemetry-go, otel, tracing
- Language: Go
- Homepage:
- Size: 116 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
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