Skip to content

Commit

Permalink
Disable the stream_unique metric attribute at Detailed level (#119)
Browse files Browse the repository at this point in the history
This field has caused a (predictable) cardinality explosion in our
internal pipeline monitoring setup. This leaves the feature in but
disabled at Detailed level. While the collectorconfig package won't
parse a value greater than Detailed, callers can still pass `Detailed+1`
to enable.
  • Loading branch information
jmacd authored Dec 12, 2023
1 parent e1954fd commit b7ed304
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/otel/arrow_record/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ type Consumer struct {
memoryCounter metric.Int64UpDownCounter

// uniqueAttr is set to an 8-byte hex digit string with
// 32-bits of randomness, applied to all metric events.
// 32-bits of randomness, applied to all metric events
// when MetricsLevel is > Detailed (i.e., above detailed).
uniqueAttr attribute.KeyValue
}

Expand Down Expand Up @@ -191,7 +192,7 @@ func (c *Consumer) metricOpts(kvs ...attribute.KeyValue) []metric.AddOption {
if c.metricsLevel < configtelemetry.LevelNormal {
return nil
}
if c.metricsLevel == configtelemetry.LevelDetailed {
if c.metricsLevel > configtelemetry.LevelDetailed {
kvs = append(kvs, c.uniqueAttr)
}
return []metric.AddOption{
Expand Down

0 comments on commit b7ed304

Please sign in to comment.