Skip to content
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

Make AnalysisTemplate more configurable #825

Closed
nestorsokil opened this issue Nov 8, 2020 · 2 comments · Fixed by #901
Closed

Make AnalysisTemplate more configurable #825

nestorsokil opened this issue Nov 8, 2020 · 2 comments · Fixed by #901
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@nestorsokil
Copy link

Summary

There are a number of fields in AnalysisTemplate/ClusterAnalysisTemplate that are static (consecutiveErrorLimit, interval, count, etc). It would mean a lot of practical benefits to make them dynamically configurable.

Use Cases

Having a single AnalysisTemplate you could define different threasholds for different applications (since they may have different tolerance to failures). The preferred experience IMO would be something like

postPromotionAnalysis:
    templates:
    - templateName: error-rate
      failureLimit: 3
      interval: 5m
      count: 10

Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

@nestorsokil nestorsokil added the enhancement New feature or request label Nov 8, 2020
@jessesuen jessesuen added this to the v0.11 milestone Nov 18, 2020
@jessesuen
Copy link
Member

jessesuen commented Dec 2, 2020

Rather than add the values in the template reference, I think we should support these are arguments to the AnalysisTemplate. e.g.:

apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
  name: error-rate
spec:
  args:
  - name: interval
  - name: count
  metrics:
  - name: error-rate
    provider:
      prometheus:
        interval: "{{args.interval}}"
        count: "{{args.count}}"

and just use normal arg substitution to handle this. We'll need to switch the type to use the intstr.IntOrString kubernetes type to support this. Currently I think they are all *int32

@zimmertr
Copy link

zimmertr commented Oct 9, 2024

Rather than add the values in the template reference, I think we should support these are arguments to the AnalysisTemplate. e.g.:

apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
  name: error-rate
spec:
  args:
  - name: interval
  - name: count
  metrics:
  - name: error-rate
    provider:
      prometheus:
        interval: "{{args.interval}}"
        count: "{{args.count}}"

and just use normal arg substitution to handle this. We'll need to switch the type to use the intstr.IntOrString kubernetes type to support this. Currently I think they are all *int32

Does this actually work?


With Quotes:

apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
  name: ...
spec:
  args:
    - name: count
       value: 5
       ...
  metrics:
      ...
      count: "{{ args.count }}"

one or more objects failed to apply, reason: error when patching "/dev/shm/2225555538": AnalysisTemplate.argoproj.io "..." is invalid: spec.args[0].value: Invalid value: "integer": spec.args[0].value in body must be of type string: "integer".


Without Quotes:

apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
  name: ...
spec:
  args:
    - name: count
       value: 5
       ...
  metrics:
      ...
      count: {{ args.count }}

Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = kustomize build <path to cached source>/.../.../... --enable-helm --load-restrictor=LoadRestrictionsNone failed exit status 1: Error: map[string]interface {}(nil): yaml: invalid map key: map[string]interface {}{"args.count":""}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants