MCPcopy
hub / github.com/grafana/tempo / RegisterFlagsAndApplyDefaults

Method RegisterFlagsAndApplyDefaults

modules/frontend/config.go:90–151  ·  view source on GitHub ↗
(prefix string, f *flag.FlagSet)

Source from the content-addressed store, hash-verified

88}
89
90func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet) {
91 slo := SLOConfig{
92 DurationSLO: 0,
93 ThroughputBytesSLO: 0,
94 }
95
96 cfg.Config.MaxOutstandingPerTenant = 2000
97 cfg.Config.MaxBatchSize = 7
98 cfg.MaxRetries = 2
99 cfg.ResponseConsumers = 10
100 cfg.MaxGRPCStreamingPacketSize = 2 * 1024 * 1024 // 2MB
101 cfg.Search = SearchConfig{
102 Sharder: SearchSharderConfig{
103 QueryBackendAfter: 15 * time.Minute,
104 DefaultLimit: 20,
105 MaxLimit: 256 * 1024,
106 MaxDuration: 168 * time.Hour, // 1 week
107 ConcurrentRequests: defaultConcurrentRequests,
108 TargetBytesPerRequest: defaultTargetBytesPerRequest,
109 MostRecentShards: defaultMostRecentShards,
110 IngesterShards: 3,
111 DefaultSpansPerSpanSet: 3,
112 MaxSpansPerSpanSet: 100,
113 },
114 SLO: slo,
115 }
116 cfg.TraceByID = TraceByIDConfig{
117 QueryShards: 50,
118 SLO: slo,
119 }
120 cfg.Metrics = MetricsConfig{
121 Sharder: QueryRangeSharderConfig{
122 MaxDuration: 24 * time.Hour,
123 QueryBackendAfter: 15 * time.Minute,
124 ConcurrentRequests: defaultConcurrentRequests,
125 TargetBytesPerRequest: defaultTargetBytesPerRequest,
126 Interval: 5 * time.Minute,
127 MaxExemplars: 100,
128 MaxResponseSeries: 0,
129 StreamingShards: defaultStreamingShards,
130 },
131 SLO: slo,
132 }
133 cfg.Weights = pipeline.WeightsConfig{
134 RequestWithWeights: true,
135 RetryWithWeights: true,
136 MaxRegexConditions: 1,
137 MaxTraceQLConditions: 4,
138 }
139
140 // set default max query size to 128 KiB, queries larger than this will be rejected
141 cfg.MaxQueryExpressionSizeBytes = 128 * 1024
142 // enable multi tenant queries by default
143 cfg.MultiTenantQueriesEnabled = true
144 cfg.Metrics.MaxIntervals = 10_000
145
146 cfg.QueryEndCutoff = 30 * time.Second
147

Callers 2

TestMCPServerEnabledFunction · 0.95

Calls 1

PrefixConfigFunction · 0.92

Tested by 2

TestMCPServerEnabledFunction · 0.76