Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

make ruler json again #8

Merged
merged 2 commits into from
Feb 19, 2021
Merged

make ruler json again #8

merged 2 commits into from
Feb 19, 2021

Conversation

domasx2
Copy link
Collaborator

@domasx2 domasx2 commented Feb 19, 2021

No description provided.

pkg/api/cortex-ruler.go Outdated Show resolved Hide resolved
pkg/api/cortex-ruler.go Show resolved Hide resolved
Comment on lines +102 to +104
Record string `yaml:"record,omitempty" json:"record,omitempty"`
Alert string `yaml:"alert,omitempty" json:"alert,omitempty"`
Expr string `yaml:"expr" json:"expr"`
Copy link
Collaborator

@papagian papagian Feb 19, 2021

Choose a reason for hiding this comment

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

Suggested change
Record string `yaml:"record,omitempty" json:"record,omitempty"`
Alert string `yaml:"alert,omitempty" json:"alert,omitempty"`
Expr string `yaml:"expr" json:"expr"`
Record interface{} `yaml:"record,omitempty" json:"record,omitempty"`
Alert interface{} `yaml:"alert,omitempty" json:"alert,omitempty"`
Expr interface{} `yaml:"expr" json:"expr"`

I think it's better to use interface{} to denote that it's not just a string but a YAML or JSON formatted string
but I'm fine also with the string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what do you mean by YAML or JSON formatted string?

afaik recrod and alert are rule names, and expr is a promql query

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll merge it for now, but let's discuss later

Copy link
Collaborator

Choose a reason for hiding this comment

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

afaik recrod and alert are rule names, and expr is a promql query
my bad; I got it wrong

@domasx2 domasx2 merged commit 0ceb066 into master Feb 19, 2021
@owen-d owen-d deleted the domas/ruler-json branch March 4, 2021 12:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants