Repository navigation
Use the analysis template's timeout for metrics queries - #7527
Open
harshrajdebug wants to merge 1 commit into
Open
harshrajdebug wants to merge 1 commit into
harshrajdebug wants to merge 1 commit into
Conversation
Signed-off-by: Harsh Raj <harshrajdebug@gmail.com>
harshrajdebug
requested review from
Warashi,
ffjlabo and
mohammedfirdouss
and
a balanced review from Copilot
and removed request for
Copilot
October 23, 2026 12:03
✅ Deploy Preview for pipecd-site canceled.
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Builds the metrics provider of an ANALYSIS stage from the resolved metrics config, so the
timeoutof a referencedAnalysisTemplateis used.executestage/analysis.gothenewMetricsProviderfunction now takes the*config.AnalysisMetricsvalue returned bygetMetricsConfigand reads the provider name from it.analysisprovider/metrics/factorytheNewProviderfunction takes*config.AnalysisMetricsinstead of the*config.TemplatableAnalysisMetricstype.Why we need it:
The provider was built from the stage's own metrics entry. When that entry only references a template, its
timeoutis the 30s default, so Prometheus and Datadog queries ignored thetimeoutset in the template. Details and the reproduction are in the issue.TestExecutor_newMetricsProvider_timeoutsets a 100ms timeout once inline and once in a template, against a Prometheus server that answers after 1s, and expectscontext deadline exceededin both cases. When I pass the stage entry's timeout to the provider instead, as master does, the template case waits for the 1s response and fails.Which issue(s) this PR fixes:
Fixes #7526
Does this PR introduce a user-facing change?:
AnalysisTemplatenow use thetimeoutset in the template. Atimeoutwritten next totemplatein the stage is no longer used, like the other fields there.Screenshots/Videos (for documentation or website changes):
N/A