Merge pull request #680 from ipfs/fix/tracing-service-name
make tracing service name unique
This commit is contained in:
commit
d125f697bc
|
@ -95,6 +95,8 @@ func propagateTracingConfig(cfgs *cfgs, tracingFlag bool) *cfgs {
|
|||
tracingValue = cfgs.tracingCfg.EnableTracing
|
||||
}
|
||||
// propagate to any other interested configuration
|
||||
cfgs.tracingCfg.ClusterID = cfgs.clusterCfg.ID.Pretty()
|
||||
cfgs.tracingCfg.ClusterPeername = cfgs.clusterCfg.Peername
|
||||
cfgs.tracingCfg.EnableTracing = tracingValue
|
||||
cfgs.clusterCfg.Tracing = tracingValue
|
||||
cfgs.consensusCfg.Tracing = tracingValue
|
||||
|
|
|
@ -8,8 +8,9 @@ import (
|
|||
|
||||
"github.com/kelseyhightower/envconfig"
|
||||
|
||||
"github.com/ipfs/ipfs-cluster/config"
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
|
||||
"github.com/ipfs/ipfs-cluster/config"
|
||||
)
|
||||
|
||||
const metricsConfigKey = "metrics"
|
||||
|
@ -151,6 +152,8 @@ type TracingConfig struct {
|
|||
JaegerAgentEndpoint ma.Multiaddr
|
||||
SamplingProb float64
|
||||
ServiceName string
|
||||
ClusterID string
|
||||
ClusterPeername string
|
||||
}
|
||||
|
||||
type jsonTracingConfig struct {
|
||||
|
|
|
@ -142,7 +142,10 @@ func setupTracing(cfg *TracingConfig) (*jaeger.Exporter, error) {
|
|||
je, err := jaeger.NewExporter(jaeger.Options{
|
||||
AgentEndpoint: agentAddr,
|
||||
Process: jaeger.Process{
|
||||
ServiceName: cfg.ServiceName,
|
||||
ServiceName: cfg.ServiceName + "-" + cfg.ClusterPeername,
|
||||
Tags: []jaeger.Tag{
|
||||
jaeger.StringTag("cluster_id", cfg.ClusterID),
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user