mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-20 14:49:20 +08:00
added status code in processor and supervisor
This commit is contained in:
commit
3f901c8692
@ -30,7 +30,8 @@
|
|||||||
"multiValueHandling": "ARRAY"
|
"multiValueHandling": "ARRAY"
|
||||||
},
|
},
|
||||||
{ "name": "DurationNano", "type": "Long" },
|
{ "name": "DurationNano", "type": "Long" },
|
||||||
{ "name": "Kind", "type": "int" }
|
{ "name": "Kind", "type": "int" },
|
||||||
|
{ "name": "StatusCode", "type": "int" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,8 @@ data:
|
|||||||
"multiValueHandling": "ARRAY"
|
"multiValueHandling": "ARRAY"
|
||||||
},
|
},
|
||||||
{ "name": "DurationNano", "type": "Long" },
|
{ "name": "DurationNano", "type": "Long" },
|
||||||
{ "name": "Kind", "type": "int" }
|
{ "name": "Kind", "type": "int" },
|
||||||
|
{ "name": "StatusCode", "type": "int" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ type Span struct {
|
|||||||
StartTimeUnixNano uint64
|
StartTimeUnixNano uint64
|
||||||
ServiceName string
|
ServiceName string
|
||||||
Kind int32
|
Kind int32
|
||||||
|
StatusCode int64
|
||||||
References []OtelSpanRef
|
References []OtelSpanRef
|
||||||
Tags []string
|
Tags []string
|
||||||
TagsKeys []string
|
TagsKeys []string
|
||||||
@ -201,13 +202,25 @@ func newStructuredSpan(otelSpan pdata.Span, ServiceName string) *Span {
|
|||||||
spanID_bytes := otelSpan.SpanID().Bytes()
|
spanID_bytes := otelSpan.SpanID().Bytes()
|
||||||
parentSpanID_bytes := otelSpan.ParentSpanID().Bytes()
|
parentSpanID_bytes := otelSpan.ParentSpanID().Bytes()
|
||||||
|
|
||||||
|
var statusCode int64
|
||||||
|
|
||||||
attributes := otelSpan.Attributes()
|
attributes := otelSpan.Attributes()
|
||||||
|
|
||||||
var tags []string
|
var tags []string
|
||||||
var tagsKeys []string
|
var tagsKeys []string
|
||||||
var tagsValues []string
|
var tagsValues []string
|
||||||
|
var tag string
|
||||||
|
|
||||||
attributes.ForEach(func(k string, v pdata.AttributeValue) {
|
attributes.ForEach(func(k string, v pdata.AttributeValue) {
|
||||||
tag := fmt.Sprintf("%s:%s", k, v.StringVal())
|
if v.Type().String() == "INT" {
|
||||||
|
tag = fmt.Sprintf("%s:%d", k, v.IntVal())
|
||||||
|
} else {
|
||||||
|
tag = fmt.Sprintf("%s:%s", k, v.StringVal())
|
||||||
|
}
|
||||||
|
if k == "http.status_code" {
|
||||||
|
statusCode = v.IntVal()
|
||||||
|
}
|
||||||
|
|
||||||
tags = append(tags, tag)
|
tags = append(tags, tag)
|
||||||
tagsKeys = append(tagsKeys, k)
|
tagsKeys = append(tagsKeys, k)
|
||||||
tagsValues = append(tagsValues, v.StringVal())
|
tagsValues = append(tagsValues, v.StringVal())
|
||||||
@ -224,6 +237,7 @@ func newStructuredSpan(otelSpan pdata.Span, ServiceName string) *Span {
|
|||||||
DurationNano: durationNano,
|
DurationNano: durationNano,
|
||||||
ServiceName: ServiceName,
|
ServiceName: ServiceName,
|
||||||
Kind: int32(otelSpan.Kind()),
|
Kind: int32(otelSpan.Kind()),
|
||||||
|
StatusCode: statusCode,
|
||||||
References: references,
|
References: references,
|
||||||
Tags: tags,
|
Tags: tags,
|
||||||
TagsKeys: tagsKeys,
|
TagsKeys: tagsKeys,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user