File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed
Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -88,9 +88,7 @@ type SpanEventConfig struct {
8888 ErrorID AttributeConfig `mapstructure:"error_id"`
8989 ErrorExceptionHandled AttributeConfig `mapstructure:"error_exception_handled"`
9090 ErrorGroupingKey AttributeConfig `mapstructure:"error_grouping_key"`
91-
92- // For no exceptions/errors
93- EventKind AttributeConfig `mapstructure:"event_kind"`
91+ ErrorGroupingName AttributeConfig `mapstructure:"error_grouping_name"`
9492}
9593
9694// AttributeConfig is the configuration options for each attribute.
@@ -141,7 +139,7 @@ func Enabled() Config {
141139 ErrorID : AttributeConfig {Enabled : true },
142140 ErrorExceptionHandled : AttributeConfig {Enabled : true },
143141 ErrorGroupingKey : AttributeConfig {Enabled : true },
144- EventKind : AttributeConfig {Enabled : true },
142+ ErrorGroupingName : AttributeConfig {Enabled : true },
145143 },
146144 }
147145}
Original file line number Diff line number Diff line change @@ -53,4 +53,5 @@ const (
5353 AttributeErrorID = "error.id"
5454 AttributeErrorExceptionHandled = "error.exception.handled"
5555 AttributeErrorGroupingKey = "error.grouping_key"
56+ AttributeErrorGroupingName = "error.grouping_name"
5657)
Original file line number Diff line number Diff line change @@ -491,6 +491,11 @@ func (s *spanEventEnrichmentContext) enrich(
491491 }
492492 se .Attributes ().PutStr (AttributeErrorGroupingKey , hex .EncodeToString (hash .Sum (nil )))
493493 }
494+ if cfg .ErrorGroupingName .Enabled {
495+ if s .exceptionMessage != "" {
496+ se .Attributes ().PutStr (AttributeErrorGroupingName , s .exceptionMessage )
497+ }
498+ }
494499
495500 // Transaction type and sampled are added as span event enrichment only for errors
496501 if parentCtx .isTransaction && s .exception {
Original file line number Diff line number Diff line change @@ -811,6 +811,7 @@ func TestSpanEventEnrich(t *testing.T) {
811811 hash .Write ([]byte ("java.net.ConnectionError" ))
812812 return hex .EncodeToString (hash .Sum (nil ))
813813 }(),
814+ AttributeErrorGroupingName : "something is wrong" ,
814815 AttributeTransactionSampled : true ,
815816 AttributeTransactionType : "unknown" ,
816817 },
@@ -843,6 +844,7 @@ func TestSpanEventEnrich(t *testing.T) {
843844 hash .Write ([]byte ("java.net.ConnectionError" ))
844845 return hex .EncodeToString (hash .Sum (nil ))
845846 }(),
847+ AttributeErrorGroupingName : "something is wrong" ,
846848 },
847849 },
848850 } {
You can’t perform that action at this time.
0 commit comments