-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add query frontend to the quickstart script #3372
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,9 @@ MC_EXECUTABLE=${MC_EXECUTABLE:-"mc"} | |
PROMETHEUS_EXECUTABLE=${PROMETHEUS_EXECUTABLE:-"prometheus"} | ||
THANOS_EXECUTABLE=${THANOS_EXECUTABLE:-"thanos"} | ||
S3_ENDPOINT="" | ||
QUERY_FRONTEND_CACHE_MAX_SIZE=${QUERY_FRONTEND_CACHE_MAX_SIZE:-""} | ||
QUERY_FRONTEND_CACHE_MAX_SIZE_ITEMS=${QUERY_FRONTEND_CACHE_MAX_SIZE_ITEMS:-0} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's set this to 2048 |
||
QUERY_FRONTEND_CACHE_VALIDITY=${QUERY_FRONTEND_CACHE_VALIDITY:-"0s"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use |
||
|
||
if [ ! $(command -v "$PROMETHEUS_EXECUTABLE") ]; then | ||
echo "Cannot find or execute Prometheus binary $PROMETHEUS_EXECUTABLE, you can override it by setting the PROMETHEUS_EXECUTABLE env variable" | ||
|
@@ -249,7 +252,28 @@ QUERIER_JAEGER_CONFIG=$( | |
EOF | ||
) | ||
|
||
# Start two query nodes. | ||
QUERY_FRONTEND_JAEGER_CONFIG=$( | ||
cat <<-EOF | ||
type: JAEGER | ||
config: | ||
service_name: thanos-query-frontend | ||
sampler_type: ratelimiting | ||
sampler_param: 2 | ||
EOF | ||
) | ||
|
||
QUERY_FRONTEND_CACHE_CONFIG=$( | ||
cat <<-EOF | ||
type: IN-MEMORY | ||
config: | ||
max_size: "${QUERY_FRONTEND_CACHE_MAX_SIZE}" | ||
max_size_items: ${QUERY_FRONTEND_CACHE_MAX_SIZE_ITEMS} | ||
validity: ${QUERY_FRONTEND_CACHE_VALIDITY} | ||
EOF | ||
) | ||
echo ${QUERY_FRONTEND_CACHE_CONFIG} | ||
|
||
# Start two query nodes with respective query-frontends. | ||
for i in $(seq 0 1); do | ||
${THANOS_EXECUTABLE} query \ | ||
--debug.name query-"${i}" \ | ||
|
@@ -262,6 +286,16 @@ for i in $(seq 0 1); do | |
--tracing.config="${QUERIER_JAEGER_CONFIG}" \ | ||
--query.replica-label receive_replica \ | ||
${STORES} & | ||
|
||
sleep 0.5 | ||
|
||
${THANOS_EXECUTABLE} query-frontend \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not how it suppose to work, unfortunately. Those replicas have to be separate for better horizontal scalability. This means there should be a load balancing in between - ideally round robin load balancer for better distribution. We can add some nginx for it, but ideally, we could work towards this: #3373 Let me know if this makes sense 🤗 |
||
--debug.name query-frontend-"${i}" \ | ||
--log.level debug \ | ||
--http-address 0.0.0.0:2000"${i}" \ | ||
--query-frontend.downstream-url http://127.0.0.1:109"${i}"4 \ | ||
--tracing.config="${QUERY_FRONTEND_JAEGER_CONFIG}" \ | ||
--query-range.response-cache-config="${QUERY_FRONTEND_CACHE_CONFIG}" & | ||
done | ||
|
||
sleep 0.5 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's set this to
"0"