forked from patil-kshitij/traceSample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
30 lines (26 loc) · 663 Bytes
/
Copy pathmain.go
File metadata and controls
30 lines (26 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"context"
"log"
"time"
"github.com/logicmonitor/lm-telemetry-sdk-go/config"
"github.com/logicmonitor/lm-telemetry-sdk-go/telemetry"
"github.com/patil-kshitij/traceSample/sample"
)
var ()
func main() {
ctx := context.Background()
customAttributes := map[string]string{
"service.namespace": "sample-namespace",
"service.name": "sample-service",
}
err := telemetry.SetupTelemetry(ctx,
config.WithAttributes(customAttributes),
config.WithHTTPTraceEndpoint("localhost:4318"),
)
if err != nil {
log.Fatalf("error in setting up telemetry: %s", err.Error())
}
sample.ParentTrace(ctx)
time.Sleep(30 * time.Second)
}