Skip to content

Commit 8bec678

Browse files
authored
Merge pull request #4 from muhammadn/cleanups
Cleanups
2 parents 1125d54 + 68d72ae commit 8bec678

File tree

4 files changed

+111
-7
lines changed

4 files changed

+111
-7
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
cmd/jaeger-pg-store/jaeger-pg-*
2-
jaeger-pg-store
3-
41
# Binaries for programs and plugins
52
*.exe
63
*.exe~
@@ -15,4 +12,4 @@ jaeger-pg-store
1512
*.out
1613

1714
# Dependency directories (remove the comment below to include it)
18-
# vendor/
15+
# vendor/

cmd/jaeger-pg-store/main.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package main
2+
3+
import (
4+
"os"
5+
6+
"github.com/hashicorp/go-hclog"
7+
"jaeger-postgresql/pgstore"
8+
"github.com/jaegertracing/jaeger/plugin/storage/grpc"
9+
"github.com/jaegertracing/jaeger/plugin/storage/grpc/shared"
10+
)
11+
12+
func main() {
13+
logger := hclog.New(&hclog.LoggerOptions{
14+
Name: "jaeger-postgresql",
15+
Level: hclog.Warn, // Jaeger only captures >= Warn, so don't bother logging below Warn
16+
})
17+
18+
var store shared.StoragePlugin
19+
var closeStore func() error
20+
var err error
21+
22+
conf := pgstore.Configuration{}
23+
24+
store, closeStore, err = pgstore.NewStore(&conf, logger)
25+
26+
grpc.Serve(store)
27+
28+
if err = closeStore(); err != nil {
29+
logger.Error("failed to close store", "error", err)
30+
os.Exit(1)
31+
}
32+
}

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
module github.com/innovatrics/jaeger-postgresql
1+
module jaeger-postgresql
22

33
go 1.12
44

55
require (
6+
github.com/go-pg/pg/v9 v9.2.0
7+
github.com/go-pg/urlstruct v0.2.8 // indirect
68
github.com/gogo/googleapis v1.2.0 // indirect
79
github.com/hashicorp/go-hclog v0.9.0
810
github.com/jaegertracing/jaeger v1.17.1
11+
github.com/lib/pq v1.3.0
912
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
1013
github.com/modern-go/reflect2 v1.0.1 // indirect
1114
github.com/pkg/errors v0.9.1
1215
github.com/spf13/viper v1.6.2
13-
github.com/lib/pq v1.3.0
14-
github.com/go-pg/pg v0.0.0-20200411070146-66252e11b106
1516
)

0 commit comments

Comments
 (0)