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

Improve YAML parsing to handle list sequences within SLI spec #326

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

aaranmcguire
Copy link
Contributor

This PR will allow more YAML configurations within the SLI spec as lists were previously not parsed.

Within my org we're wanting to allow our users to see SLOs by cluster, or server. This is likely niche, but we're doing this by allowing users to define the Prometheus labels to scrape. e.g. sum(http_requests_total{}) by (cluster). To do this we're wanting the spec to look like the following.

indicator:
    spec:
      ratioMetric:
        total:
          metricSource:
            type: Prometheus
            metricSourceRef: thanos
            spec:
              query: http_requests_total{service="example"}
              dimensions:
                - cluster
                - server

This may be niche, but we believe that the spec was written to be open minded regarding the format within the metricSource.spec, so this should be supported.

FYI, the output of this within the Go struct matches the existing format with dimensions being cluster;server

@aaranmcguire aaranmcguire force-pushed the support-lists-in-sli-spec branch 2 times, most recently from 77f00f3 to 47358d8 Compare August 27, 2024 16:42
Copy link
Member

@nieomylnieja nieomylnieja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! Thanks for the contribution :)

@nieomylnieja nieomylnieja merged commit c0c6618 into OpenSLO:main Aug 28, 2024
3 checks passed
@aaranmcguire aaranmcguire deleted the support-lists-in-sli-spec branch August 28, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants