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

New line inserted in the generated files #970

Open
jmichalek132 opened this issue Nov 2, 2023 · 1 comment
Open

New line inserted in the generated files #970

jmichalek132 opened this issue Nov 2, 2023 · 1 comment

Comments

@jmichalek132
Copy link

We we define an SLO

apiVersion: pyrra.dev/v1alpha1
kind: ServiceLevelObjective
metadata:
  name: grafana-requests-availability
  labels:
    pyrra.dev/owner: op
  annotations:
    pyrra.dev/dashboard_url: https://ffffffffffffffffffffffffffffffffff/d/ccssRIenz/slo-detail-pyrra?var-slo={{ $labels.slo }}
    pyrra.dev/message: "{{ $labels.slo }} has either high burn rate or missing SLO metric"
spec:
  target: '99.9'
  window: 28d
  indicator:
    ratio:
      errors:
        metric: grafana_http_request_duration_seconds_count{deployment_environment=~"prod", service_name="grafana", status_code=~"5.*"}
      total:
        metric: grafana_http_request_duration_seconds_count{deployment_environment="prod", service_name="grafana"}

and for e.g. add long enough annotation new line is inserted in the generated yaml file:

  - alert: SLOMetricAbsent
    annotations:
      dashboard_url: https://ffffffffffffffffffffffffffffffffff/d/ccssRIenz/slo-detail-pyrra?var-slo={{
        $labels.slo }}

Seems to be caused by go-yaml/yaml#348 (comment).
It doesn't seem to break anything but it does suprise people. WIll later look into what needs to be done to avoid this happening, seems the fix should be just upgrading the dependcy for yaml.

@metalmatze
Copy link
Member

Makes sense. Good it doesn't break anything.
This dependency is indirect and should update through these direct dependencies:

go mod why gopkg.in/yaml.v3

# gopkg.in/yaml.v3
github.com/pyrra-dev/pyrra
k8s.io/apimachinery/pkg/runtime
k8s.io/apimachinery/pkg/runtime.test
github.com/stretchr/testify/assert
gopkg.in/yaml.v3

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

No branches or pull requests

2 participants