Commit 10c844eb authored by xiaoguang.xu's avatar xiaoguang.xu

msg 转移到field

parent cd30e705
File deleted
...@@ -46,18 +46,17 @@ func msgInfluxProcess(traceMsgs []TraceMsg) { ...@@ -46,18 +46,17 @@ func msgInfluxProcess(traceMsgs []TraceMsg) {
fields := make(map[string]interface{}) fields := make(map[string]interface{})
fields["duration"] = traceMsg.Duration / 1000 fields["duration"] = traceMsg.Duration / 1000
fields["traceId"] = traceMsg.TraceId fields["traceId"] = traceMsg.TraceId
bytes, err := json.Marshal(traceMsg)
msg := string(bytes)
fields["msg"] = msg
tags := make(map[string]string, ) tags := make(map[string]string, )
tags["sys_name"] = sysName tags["sys_name"] = sysName
tags["path"] = path tags["path"] = path
tags["host"] = traceMsg.LocalEndpoint.Ipv4 tags["host"] = traceMsg.LocalEndpoint.Ipv4
tags["kind"] = traceMsg.Kind
tags["duration_tag"] = strconv.Itoa(traceMsg.Duration)
bytes, err := json.Marshal(traceMsg)
msg := string(bytes)
tags["msg"] = msg
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
...@@ -86,6 +85,7 @@ func batchWrite(pointArray []*client.Point) { ...@@ -86,6 +85,7 @@ func batchWrite(pointArray []*client.Point) {
points, err := client.NewBatchPoints(client.BatchPointsConfig{ points, err := client.NewBatchPoints(client.BatchPointsConfig{
Database: "monitor", Database: "monitor",
//Precision : "ms",
}) })
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment