-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Distributor usage trackers (#4162)
* First working draft of cost attribution usage tracker * Add missing tracker name label, more efficient batch proportioning, cleanup * Reduce series hashing * Fix user-configurable overrides tests for new json element * lint * Add per-tenant override for max cardinality * lint, review feedback * Default to not enabled, cleanup test config * Explicitly check for usage_metrics handler * review feedback * Update tracker to support many-to-one mapping with relabel * lint * New behavior for missing and overflow * Fix issue where subsequent spans would incorrectly reuse the series of the previous span if they were missing values * Revert maps back to slices now that we can depend on a dimension always having a value * Please ignore benchmark profiles * Tweak config to have specific cost attribution tracker section. Update manifest and config index * lint * changelog * Update api docs for new endpoint * Review feedback * review feedback * Swap loop order for a tad more performance
- Loading branch information
Showing
19 changed files
with
903 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
.idea | ||
.vscode | ||
*.test | ||
*.out | ||
*.pprof | ||
/bin | ||
/cmd/tempo-cli/tempo-cli | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package usage | ||
|
||
import ( | ||
"flag" | ||
"time" | ||
) | ||
|
||
const ( | ||
defaultMaxCardinality = uint64(10000) | ||
defaultStaleDuration = 15 * time.Minute | ||
defaultPurgePeriod = time.Minute | ||
) | ||
|
||
type PerTrackerConfig struct { | ||
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"` | ||
MaxCardinality uint64 `yaml:"max_cardinality,omitempty" json:"max_cardinality,omitempty"` | ||
StaleDuration time.Duration `yaml:"stale_duration,omitempty" json:"stale_duration,omitempty"` | ||
} | ||
|
||
type Config struct { | ||
CostAttribution PerTrackerConfig `yaml:"cost_attribution,omitempty" json:"cost_attribution,omitempty"` | ||
} | ||
|
||
func (c *Config) RegisterFlagsAndApplyDefaults(_ string, _ *flag.FlagSet) { | ||
c.CostAttribution = PerTrackerConfig{ | ||
Enabled: false, | ||
MaxCardinality: defaultMaxCardinality, | ||
StaleDuration: defaultStaleDuration, | ||
} | ||
} |
Oops, something went wrong.