Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* [ENHANCEMENT] Enforce max trace size on the trace by id path. [#2935](https://github.com/grafana/tempo/issues/2935) (@joe-elliott)
* [ENHANCEMENT] Add `target_info_excluded_dimensions` to user-config api [#2945](https://github.com/grafana/tempo/pull/2945) (@ie-pham)
* [ENHANCEMENT] User-configurable overrides: add scope query parameter to return merged overrides for tenant [#2915](https://github.com/grafana/tempo/pull/2915) (@kvrhdn)
* [ENHANCEMENT] Add histogram buckets to metrics-generator config in user-configurable overrides [#2928](https://github.com/grafana/tempo/pull/2928) (@mar4uk)
* [BUGFIX] Fix panic in metrics summary api [#2738](https://github.com/grafana/tempo/pull/2738) (@mdisibio)
* [BUGFIX] Fix rare deadlock when uploading blocks to Azure Blob Storage [#2129](https://github.com/grafana/tempo/issues/2129) (@LasseHels)
* [BUGFIX] Only search ingester blocks that fall within the request time range. [#2783](https://github.com/grafana/tempo/pull/2783) (@joe-elliott)
Expand Down
14 changes: 14 additions & 0 deletions modules/overrides/user_configurable_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ func (o *userConfigurableOverridesManager) MetricsGeneratorProcessorServiceGraph
return o.Interface.MetricsGeneratorProcessorServiceGraphsPeerAttributes(userID)
}

func (o *userConfigurableOverridesManager) MetricsGeneratorProcessorServiceGraphsHistogramBuckets(userID string) []float64 {
if histogramBuckets, ok := o.getTenantLimits(userID).GetMetricsGenerator().GetProcessor().GetServiceGraphs().GetHistogramBuckets(); ok {
return histogramBuckets
}
return o.Interface.MetricsGeneratorProcessorServiceGraphsHistogramBuckets(userID)
}

func (o *userConfigurableOverridesManager) MetricsGeneratorProcessorSpanMetricsDimensions(userID string) []string {
if dimensions, ok := o.getTenantLimits(userID).GetMetricsGenerator().GetProcessor().GetSpanMetrics().GetDimensions(); ok {
return dimensions
Expand All @@ -264,6 +271,13 @@ func (o *userConfigurableOverridesManager) MetricsGeneratorProcessorSpanMetricsF
return o.Interface.MetricsGeneratorProcessorSpanMetricsFilterPolicies(userID)
}

func (o *userConfigurableOverridesManager) MetricsGeneratorProcessorSpanMetricsHistogramBuckets(userID string) []float64 {
if histogramBuckets, ok := o.getTenantLimits(userID).GetMetricsGenerator().GetProcessor().GetSpanMetrics().GetHistogramBuckets(); ok {
return histogramBuckets
}
return o.Interface.MetricsGeneratorProcessorSpanMetricsHistogramBuckets(userID)
}

func (o *userConfigurableOverridesManager) MetricsGeneratorProcessorSpanMetricsTargetInfoExcludedDimensions(userID string) []string {
if targetInfoExcludedDimensions, ok := o.getTenantLimits(userID).GetMetricsGenerator().GetProcessor().GetSpanMetrics().GetTargetInfoExcludedDimensions(); ok {
return targetInfoExcludedDimensions
Expand Down
6 changes: 6 additions & 0 deletions modules/overrides/user_configurable_overrides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ func TestUserConfigOverridesManager_allFields(t *testing.T) {
assert.Empty(t, mgr.MetricsGeneratorProcessorServiceGraphsDimensions(tenant1))
assert.Empty(t, false, mgr.MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix(tenant1))
assert.Empty(t, mgr.MetricsGeneratorProcessorServiceGraphsPeerAttributes(tenant1))
assert.Empty(t, mgr.MetricsGeneratorProcessorServiceGraphsHistogramBuckets(tenant1))
assert.Empty(t, mgr.MetricsGeneratorProcessorSpanMetricsDimensions(tenant1))
assert.Equal(t, false, mgr.MetricsGeneratorProcessorSpanMetricsEnableTargetInfo(tenant1))
assert.Empty(t, mgr.MetricsGeneratorProcessorSpanMetricsFilterPolicies(tenant1))
assert.Empty(t, mgr.MetricsGeneratorProcessorSpanMetricsHistogramBuckets(tenant1))
assert.Empty(t, mgr.MetricsGeneratorProcessorSpanMetricsTargetInfoExcludedDimensions(tenant1))

// Inject user-configurable overrides
Expand All @@ -94,6 +96,7 @@ func TestUserConfigOverridesManager_allFields(t *testing.T) {
Dimensions: &[]string{"sg-dimension"},
EnableClientServerPrefix: boolPtr(true),
PeerAttributes: &[]string{"attribute"},
HistogramBuckets: &[]float64{1, 2, 3, 4, 5},
},
SpanMetrics: &userconfigurableoverrides.LimitsMetricsGeneratorProcessorSpanMetrics{
Dimensions: &[]string{"sm-dimension"},
Expand All @@ -120,6 +123,7 @@ func TestUserConfigOverridesManager_allFields(t *testing.T) {
},
},
},
HistogramBuckets: &[]float64{10, 20, 30, 40, 50},
TargetInfoExcludedDimensions: &[]string{"some-label"},
},
},
Expand All @@ -134,8 +138,10 @@ func TestUserConfigOverridesManager_allFields(t *testing.T) {
assert.Equal(t, 60*time.Second, mgr.MetricsGeneratorCollectionInterval(tenant1))
assert.Equal(t, true, mgr.MetricsGeneratorProcessorServiceGraphsEnableClientServerPrefix(tenant1))
assert.Equal(t, []string{"attribute"}, mgr.MetricsGeneratorProcessorServiceGraphsPeerAttributes(tenant1))
assert.Equal(t, []float64{1, 2, 3, 4, 5}, mgr.MetricsGeneratorProcessorServiceGraphsHistogramBuckets(tenant1))
assert.Equal(t, []string{"sm-dimension"}, mgr.MetricsGeneratorProcessorSpanMetricsDimensions(tenant1))
assert.Equal(t, true, mgr.MetricsGeneratorProcessorSpanMetricsEnableTargetInfo(tenant1))
assert.Equal(t, []float64{10, 20, 30, 40, 50}, mgr.MetricsGeneratorProcessorSpanMetricsHistogramBuckets(tenant1))
assert.Equal(t, []string{"some-label"}, mgr.MetricsGeneratorProcessorSpanMetricsTargetInfoExcludedDimensions(tenant1))

filterPolicies := mgr.MetricsGeneratorProcessorSpanMetricsFilterPolicies(tenant1)
Expand Down
22 changes: 19 additions & 3 deletions modules/overrides/userconfigurable/client/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ func (l *LimitsMetricsGeneratorProcessor) GetSpanMetrics() *LimitsMetricsGenerat
}

type LimitsMetricsGeneratorProcessorServiceGraphs struct {
Dimensions *[]string `json:"dimensions,omitempty"`
EnableClientServerPrefix *bool `json:"enable_client_server_prefix,omitempty"`
PeerAttributes *[]string `json:"peer_attributes,omitempty"`
Dimensions *[]string `json:"dimensions,omitempty"`
EnableClientServerPrefix *bool `json:"enable_client_server_prefix,omitempty"`
PeerAttributes *[]string `json:"peer_attributes,omitempty"`
HistogramBuckets *[]float64 `json:"histogram_buckets,omitempty"`
}

func (l *LimitsMetricsGeneratorProcessorServiceGraphs) GetDimensions() ([]string, bool) {
Expand All @@ -109,10 +110,18 @@ func (l *LimitsMetricsGeneratorProcessorServiceGraphs) GetPeerAttributes() ([]st
return nil, false
}

func (l *LimitsMetricsGeneratorProcessorServiceGraphs) GetHistogramBuckets() ([]float64, bool) {
if l != nil && l.HistogramBuckets != nil {
return *l.HistogramBuckets, true
}
return nil, false
}

type LimitsMetricsGeneratorProcessorSpanMetrics struct {
Dimensions *[]string `json:"dimensions,omitempty"`
EnableTargetInfo *bool `json:"enable_target_info,omitempty"`
FilterPolicies *[]filterconfig.FilterPolicy `json:"filter_policies,omitempty"`
HistogramBuckets *[]float64 `json:"histogram_buckets,omitempty"`
TargetInfoExcludedDimensions *[]string `json:"target_info_excluded_dimensions,omitempty"`
}

Expand All @@ -137,6 +146,13 @@ func (l *LimitsMetricsGeneratorProcessorSpanMetrics) GetFilterPolicies() ([]filt
return nil, true
}

func (l *LimitsMetricsGeneratorProcessorSpanMetrics) GetHistogramBuckets() ([]float64, bool) {
if l != nil && l.HistogramBuckets != nil {
return *l.HistogramBuckets, true
}
return nil, false
}

func (l *LimitsMetricsGeneratorProcessorSpanMetrics) GetTargetInfoExcludedDimensions() ([]string, bool) {
if l != nil && l.TargetInfoExcludedDimensions != nil {
return *l.TargetInfoExcludedDimensions, true
Expand Down