Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/targc/otelinit
A Go implementation for easily bootstrapping the OpenTelemetry (OTEL) SDK.
https://github.com/targc/otelinit
opentelemetry opentelemetry-go
Last synced: about 19 hours ago
JSON representation
A Go implementation for easily bootstrapping the OpenTelemetry (OTEL) SDK.
- Host: GitHub
- URL: https://github.com/targc/otelinit
- Owner: targc
- Created: 2024-09-25T09:39:24.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-25T11:42:41.000Z (5 months ago)
- Last Synced: 2025-02-08T07:29:07.899Z (1 day ago)
- Topics: opentelemetry, opentelemetry-go
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bootstrap OTEL Go client
This package aim to simplify and reduce line of code to integrate with OTEL lib.
## Usage
```go
...import (
"context"
"github.com/5ylar/otelinit"
)func main() {
ctx := context.Background()
shutdown := otelinit.Init(ctx)
defer shutdown(ctx)...
ctx, span := otelinit.Tracer.Start(ctx, "test span name")
defer span.End()...
}
```We can configure behavior of OTEL client via environment variables. For example:
```
OTEL_RESOURCE_ATTRIBUTES=service.name=example,example.name=basic
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
OTEL_TRACES_SAMPLER=parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG=1.0
OTEL_BSP_SCHEDULE_DELAY=2000
```