@@ -60,6 +60,8 @@ func registerReceive(m map[string]setupFunc, app *kingpin.Application, name stri
60
60
61
61
replicationFactor := cmd .Flag ("receive.replication-factor" , "How many times to replicate incoming write requests." ).Default ("1" ).Uint64 ()
62
62
63
+ tsdbBlockDuration := modelDuration (cmd .Flag ("tsdb.block-duration" , "Duration for local TSDB blocks" ).Default ("2h" ).Hidden ())
64
+
63
65
m [name ] = func (g * run.Group , logger log.Logger , reg * prometheus.Registry , tracer opentracing.Tracer , _ bool ) error {
64
66
lset , err := parseFlagLabels (* labelStrs )
65
67
if err != nil {
@@ -106,6 +108,7 @@ func registerReceive(m map[string]setupFunc, app *kingpin.Application, name stri
106
108
* tenantHeader ,
107
109
* replicaHeader ,
108
110
* replicationFactor ,
111
+ * tsdbBlockDuration ,
109
112
)
110
113
}
111
114
}
@@ -130,15 +133,17 @@ func runReceive(
130
133
tenantHeader string ,
131
134
replicaHeader string ,
132
135
replicationFactor uint64 ,
136
+ tsdbBlockDuration model.Duration ,
133
137
) error {
134
138
logger = log .With (logger , "component" , "receive" )
135
139
level .Warn (logger ).Log ("msg" , "setting up receive; the Thanos receive component is EXPERIMENTAL, it may break significantly without notice" )
136
140
137
141
tsdbCfg := & tsdb.Options {
138
142
RetentionDuration : retention ,
139
143
NoLockfile : true ,
140
- MinBlockDuration : model .Duration (time .Hour * 2 ),
141
- MaxBlockDuration : model .Duration (time .Hour * 2 ),
144
+ MinBlockDuration : tsdbBlockDuration ,
145
+ MaxBlockDuration : tsdbBlockDuration ,
146
+ WALCompression : true ,
142
147
}
143
148
144
149
localStorage := & tsdb.ReadyStorage {}
0 commit comments