Repository navigation
Description
Split from #4141.
Problem or Motivation The duckduckgo engine of SearXNG raises SearxEngineCaptchaException with suspended_time=0. SearXNG does not suspend the engine, so the next query asks it again and gets the CAPTCHA again. The 3-hour log of 2026-11-08 also holds Too many request (suspended_time=180) for superuser, stackoverflow, askubuntu and arxiv, and HTTP 400 from api.stackexchange.com for the three Stack Exchange engines. The cause of the throttle is not proven: the query rate, or a flag on the cluster egress address. ## Why this part is deferred The fix waits on a measure that does not exist yet. The measure needs at least 3 days of real Service traffic in devops_cli_web_searches_total by backend and result, and a person's query from another egress address, to tell the two causes apart. #4141 removes only the three Stack Exchange engines, because they return HTTP 400 on each request without an API key. ## Acceptance Criteria - The issue holds the query rate for each backend and the share of each result, over at least 3 days, split into Service traffic and check or manual traffic. - The issue names the cause: the query rate or the cluster egress address. - A test over the searxng-settings ConfigMap holds the engine set that the measure chooses, and the test fails before the change. - A devops k8s searxng-check run gets at least one hit for the general category. - The settings add no retry loop (#4094).
Alternatives check of 2026-11-20: in-use.
The repository already uses this tool.
Tool: searxng/searxng (https://github.com/searxng/searxng), AGPL-3.0, last activity 2026-11-19, maintained.
Reason: Searches surfaced SearXNG itself as the only per-engine measure: its OpenMetrics endpoint exposes each engine's request, error and reliability counts, so it covers the engine-level throttle measure; the caller split and password handling are integration work.
Covers:
- Per-engine request and error counts
- Engine reliability and suspended-engine state
- Scrapeable OpenMetrics endpoint behind basic auth
Lacks:
- No environment variable for the metrics password
- Cannot split Service from check or manual traffic
- Metric name unverified until the first scrape
Proposed design
Problem statement
The duckduckgo engine of SearXNG answers with a CAPTCHA and suspended_time=0. SearXNG does not suspend the engine, so the next query asks it again. Other engines return Too many request. The cause is not proven: it is the query rate, or a flag on the cluster egress address. The search counter counts a reply by backend and result, so a refused engine hides behind another engine's hits. This change enables the OpenMetrics endpoint of SearXNG and scrapes its per-engine series. A separate item names the cause from that series, and #5595 chooses the engine set.
Acceptance criteria
Requirement: OpenMetrics password placeholder
The searxng-settings ConfigMap SHALL set general.open_metrics to the placeholder ${SEARXNG_METRICS_PASSWORD}, SHALL hold no password, and SHALL add no retry loop.
Scenario: Manifest check passes with the placeholder
- WHEN
uv run devops ci --check --only k8sruns on the branch that holds the newk8s/devops/searxng/configmap.yaml - THEN the check exits 0 and reports no error for
k8s/devops/searxng/configmap.yaml
Requirement: Rendered settings at pod start
The SearXNG Deployment SHALL render /etc/searxng/settings.yml at pod start from the settings ConfigMap and the metrics password Secret.
Scenario: Live check after the rollout
- WHEN
uv run devops k8s searxng-checkruns after the rollout of the new Deployment - THEN the check exits 0 and its
generalrow holds at least one hit, so the pod started on the rendered file
Requirement: Metrics Secret from the keyring
devops k8s push-secrets SHALL write the searxng-metrics-auth basic-auth Secret from the keyring entry searxng_metrics_password.
Scenario: Push table row for the metrics Secret
- WHEN the unit test reads the secret push table of
devops k8s push-secrets - THEN the table holds a row that writes Secret
searxng-metrics-authin namespacedevopswith usernamesearxngand the password from keyring entrysearxng_metrics_password, and the test fails before the change
Requirement: ServiceMonitor scrapes the metrics
A ServiceMonitor SHALL scrape /metrics of the SearXNG Service on its port 8080 with the searxng-metrics-auth basic-auth Secret.
Scenario: Manifest check passes with the new ServiceMonitor
- WHEN
uv run devops ci --check --only k8sruns on the branch that addsk8s/devops/searxng/servicemonitor.yaml - THEN the check exits 0 and reports no error for the new ServiceMonitor
Requirement: Perimeter admits the scrape
The searxng-perimeter-ingress NetworkPolicy SHALL admit the monitoring namespace to TCP port 8080.
Scenario: Manifest check passes with the new ingress peer
- WHEN
uv run devops ci --check --only k8sruns on the branch that changesk8s/devops/searxng/networkpolicy.yaml - THEN the check exits 0 and reports no error for
k8s/devops/searxng/networkpolicy.yaml
Existing Tool Considered
The alternatives check in the issue body records the verdict in-use for searxng/searxng (https://github.com/searxng/searxng), AGPL-3.0, maintained. The block of that check lists what the tool covers and what it lacks. This proposal does what the tool lacks: general.open_metrics reads no environment variable, so an init container renders settings.yml at pod start from the ConfigMap and a keyring-backed Secret. The change builds no tool of its own; the render is one init container of a few shell lines, about 15k tokens to build, about 2k tokens a month to keep and fix, and about 3 hours of elapsed time.
Key questions
- Which measure shows the refusal of each SearXNG engine?: The OpenMetrics endpoint of SearXNG. The settings set
general.open_metrics, and a ServiceMonitor scrapes/metricswith basic auth. (best practice) [sources: k8s/devops/searxng/configmap.yaml, docs/CLUSTER.md:243, docs/TELEMETRY.md]- Chosen: SearXNG OpenMetrics endpoint. It gives the request, error and reliability counts of each engine, and the cluster already scrapes its workloads.
- Rejected:
devops_cli_web_searches_totalby backend and result. A reply with hits from another engine countsok, so a refused engine leaves no trace. - Rejected: A new counter on the web-search chain. It measures the client's view and not the engine's, and it adds code that the project keeps.
- Which settings key enables the endpoint, and does it read an environment variable?:
general.open_metricsholds the password of the/metricsendpoint. It reads no environment variable, so the value stays insettings.ymlas the placeholder${SEARXNG_METRICS_PASSWORD}and an init container writes the Secret value at pod start. (best practice) [sources: k8s/devops/searxng/configmap.yaml, k8s/devops/searxng/deployment.yaml]- Chosen:
general.open_metricswith a rendered placeholder. The key holds the password, the settings stay in git under review, and the Secret stays out of git. - Rejected: An environment variable.
open_metricsreads no environment variable. - Rejected: The whole
settings.ymlin a Secret. The engine set leaves git, and no test can hold it. - Rejected: The password in the ConfigMap. It puts a secret in git.
- Chosen:
- How does the metrics password reach the pod with no secret in git?: A
kubernetes.io/basic-authSecretsearxng-metrics-authholds usernamesearxngand the keyring password, anddevops k8s push-secretswrites it. An init container renderssettings.ymlfrom the ConfigMap and the Secret into anemptyDir, and the SearXNG container mounts that file. (best practice) [sources: src/devops_cli/k8s/cluster_secrets.py, k8s/devops/searxng/deployment.yaml, k8s/README.md]- Chosen: Secret and a render step. The settings stay in git under review, and the password stays in the keyring and the Secret.
- Rejected: The whole
settings.ymlin a Secret. The engine set leaves git, and no test can hold it. - Rejected: The password in the ConfigMap. It puts a secret in git.
- Which port and path does the scrape use?: Port 8080, the SearXNG HTTP port that the container names
http. The Service port that targets it must carry the same name for the ServiceMonitor. The path is/metrics. [sources: k8s/devops/searxng/service.yaml, k8s/devops/searxng/deployment.yaml] - Where does the ServiceMonitor live?: In
k8s/devops/searxng/servicemonitor.yaml, next to the Service, andk8s/devops/searxng/kustomization.yamllists it.k8s/llm/gateway/servicemonitor.yamlis the same pattern for the gateway. [sources: k8s/llm/gateway/servicemonitor.yaml, k8s/devops/searxng/kustomization.yaml, k8s/devops/searxng/service.yaml] - Which namespace does the ingress rule admit for the scrape?: The namespace of the Prometheus stack under
k8s/monitoring/. The rule selects it by the automatic labelkubernetes.io/metadata.nameon that namespace. [sources: k8s/monitoring/prometheus-values.yaml]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 9, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(k8s)scope of the title gives the scope.The fix waits on 3 days of traffic data, so the item is not urgent.The change makes the web search more reliable for the roadmap jobs.The measure needs 3 days of traffic data, and the test needs a new check.Both items address the SearXNG throttle. #4141 removes three engines; the candidate measures the cause and stops the DuckDuckGo CAPTCHA repeat.[-]fix(k8s): measure the SearXNG throttle and stop the duckduckgo CAPTCHA repeat[/-][+]fix(k8s): Measure SearXNG throttle and stop CAPTCHA repeat[/+]devops-cli-service commentedon Nov 9, 2026
The job shortened the title of this item. The summary had 67 characters, and the limit is 60. The type and the scope stay.
fix(k8s): measure the SearXNG throttle and stop the duckduckgo CAPTCHA repeatfix(k8s): Measure SearXNG throttle and stop CAPTCHA repeatdevops-cli-service commentedon Nov 9, 2026
Refine cannot set this item to Ready at 816cfe0 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
dan-petty commentedon Nov 12, 2026
Scope from the cluster integration plan (2026-11-12)
The cluster integration plan #4989 gives this item its measure (rank 14). This issue is now a sub-issue of #4989.
general.open_metricsin the SearXNG settings./metricswith basic auth from a ServiceMonitor.searxng-perimeter.searxng_engines_reliability_totalbelow 50 for 1 h.open_metricsreads no environment variable. Sosettings.ymlmoves to a Secret thatdevops k8s push-secretswrites, or a start step renders it.Owner decision (decision 2 on #4989): the metrics password is a new Secret. The recommended answer is to approve it: push-secrets writes the Secret from the keyring, and a start step renders the password into
settings.yml, sosettings.ymlstays in git with no secret.Why: SearXNG is the only search provider that answers, and a failing engine shows today only as WARNING lines in Loki. This issue must measure the throttle of each engine to choose the engine set; this metric is that measure. About 415 of 629 engine warnings in 24 h come from the Stack Exchange engines that #4141 removes.
24 remaining items
fix(k8s): Measure SearXNG throttle and stop CAPTCHA repeat (#4201)
docs(openspec): archive the change (#4201)
devops-cli-service commentedon Nov 22, 2026
The draft pull request #6755 holds the final title and body. In mode
onofroadmap.fix_checks.mode, the watch row marks it ready when its checks pass, and a fix-checks Job repairs a failed check whose name gives the class test, lint or types. In each other case the watch row stops the item: another failed check, a cancelled check, a conflict, a fix-checks Job that ended with no repair, or another mode.Spend: 253 model requests, 14941595 input tokens, 83676 output tokens.
devops-cli-service commentedon Nov 22, 2026
Released in v0.194.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.194.0
devops-cli-service commentedon Nov 22, 2026
Live since 2026-11-22 13:47 UTC
fix(k8s): Drop throttled Stack Exchange engines from SearXNG (#7053)