SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
added statusCode field in spans
Ankit Nayane9d403493fed
diff --git a/pkg/processors/flattener/main.go b/pkg/processors/flattener/main.goindex ecbaa7af65..493a6bcb17 100644--- a/pkg/processors/flattener/main.go+++ b/pkg/processors/flattener/main.go@@ -50,6 +50,7 @@ type Span struct {StartTimeUnixNano uint64ServiceName stringKind int32+ StatusCode int64References []OtelSpanRefTags []stringTagsKeys []string@@ -201,13 +202,25 @@ func newStructuredSpan(otelSpan pdata.Span, ServiceName string) *Span {spanID_bytes := otelSpan.SpanID().Bytes()parentSpanID_bytes := otelSpan.ParentSpanID().Bytes()+ var statusCode int64+attributes := otelSpan.Attributes()var tags []stringvar tagsKeys []stringvar tagsValues []string+ var tag string+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)tagsKeys = append(tagsKeys, k)tagsValues = append(tagsValues, v.StringVal())@@ -224,6 +237,7 @@ func newStructuredSpan(otelSpan pdata.Span, ServiceName string) *Span {DurationNano: durationNano,ServiceName: ServiceName,Kind: int32(otelSpan.Kind()),+ StatusCode: statusCode,References: references,Tags: tags,TagsKeys: tagsKeys,