Skip to content

Commit 68d72ae

Browse files
committed
commit jaeger-pg
1 parent 9dd1306 commit 68d72ae

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
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+
}

0 commit comments

Comments
 (0)