Skip to content

Commit dd2828e

Browse files
Merge pull request #13 from throw-if-null/feature/T000-2-otel-init
T000-2: add OpenTelemetry init package
2 parents 5f6a63e + 6888ae1 commit dd2828e

File tree

5 files changed

+632
-0
lines changed

5 files changed

+632
-0
lines changed

cmd/molecular/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ import (
1212
"path/filepath"
1313
"time"
1414

15+
"github.com/joho/godotenv"
1516
"github.com/throw-if-null/molecular/internal/api"
1617
"github.com/throw-if-null/molecular/internal/version"
1718
)
1819

1920
func main() {
21+
if err := godotenv.Load(); err != nil {
22+
fmt.Fprintf(os.Stderr, "warning: loading .env: %v\n", err)
23+
}
24+
2025
client := &http.Client{Timeout: 30 * time.Second}
2126
baseURL := fmt.Sprintf("http://%s:%d", api.DefaultHost, api.DefaultPort)
2227
os.Exit(run(os.Args[1:], client, baseURL, os.Stdout, os.Stderr))

go.mod

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
11
module github.com/throw-if-null/molecular
22

33
go 1.24.0
4+
5+
require (
6+
github.com/joho/godotenv v1.5.1
7+
go.opentelemetry.io/otel v1.13.0
8+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.13.0
9+
go.opentelemetry.io/otel/sdk v1.13.0
10+
)
11+
12+
require (
13+
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
14+
github.com/go-logr/logr v1.2.3 // indirect
15+
github.com/go-logr/stdr v1.2.2 // indirect
16+
github.com/golang/protobuf v1.5.2 // indirect
17+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
18+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.13.0 // indirect
19+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.13.0 // indirect
20+
go.opentelemetry.io/otel/trace v1.13.0 // indirect
21+
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
22+
golang.org/x/net v0.4.0 // indirect
23+
golang.org/x/sys v0.3.0 // indirect
24+
golang.org/x/text v0.5.0 // indirect
25+
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect
26+
google.golang.org/grpc v1.52.3 // indirect
27+
google.golang.org/protobuf v1.28.1 // indirect
28+
)

0 commit comments

Comments
 (0)