Skip to content

Commit

Permalink
use level attribute on logs as the severity
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadman97 committed Mar 12, 2024
1 parent e39781d commit 0463bb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/otel/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ func extractFields(ctx context.Context, params extractFieldsParams) (*extractedF
delete(fields.attrs, highlight.RequestIDAttribute)
}

if val, ok := fields.attrs[highlight.LogSeverityDefaultAttribute]; ok {
fields.logSeverity = val
delete(fields.attrs, highlight.LogSeverityDefaultAttribute)
}
if val, ok := fields.attrs[highlight.LogSeverityAttribute]; ok {
fields.logSeverity = val
delete(fields.attrs, highlight.LogSeverityAttribute)
Expand Down
1 change: 1 addition & 0 deletions sdk/highlight-go/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const TraceKeyAttribute = "highlight.key"
const LogEvent = "log"
const LogSeverityAttribute = "log.severity"
const LogMessageAttribute = "log.message"
const LogSeverityDefaultAttribute = "level"

const MetricEvent = "metric"
const MetricSpanName = "highlight-metric"
Expand Down

0 comments on commit 0463bb8

Please sign in to comment.