Skip to content

Conversation

@akselleirv
Copy link
Contributor

  • Adds the .spec.description to pyrra_objective
  • Adds a prom label to pyrra_objective named info which adds helpful metadata information about the SLO. Inspired from how the Pyrra UI adds latency information which makes it easier to understand what the latency SLO is measuring.

Example of using the new metadata labels in the Grafana dashboard:
image

Relates to #745

@akselleirv akselleirv force-pushed the feat/add-generic-metadata branch from 046d5f0 to a9ee92b Compare May 31, 2023 07:00
@svyatoslavmo
Copy link

@metalmatze Hello! Any chance to get it merged?

Copy link
Member

@metalmatze metalmatze left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!
Sorry for the late reply. I was busy organizing PromCon, speaking at SRECon and afterward moving house.

if matcher.Name == "le" {
d, err := time.ParseDuration(matcher.Value + "s") // assume that the value is always in seconds
if err == nil {
labels["info"] = fmt.Sprintf("%.3f%% in %s must be faster than %s", o.Target*100, o.Window, d.String())
Copy link
Member

Choose a reason for hiding this comment

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

Using %.3f%% formats the float using the 3 decimals. Maybe we can use strconv.FormatFloat(o.Target * 100, 'f', -1, 64) at the end and then use its string in the fmt.Sprintf.

}
}
case Ratio:
labels["info"] = fmt.Sprintf("%.3f%% in %s", o.Target*100, o.Window)
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

@ArthurSens
Copy link
Contributor

You can already add labels to pyrra_objective by adding pyrra.dev/your-label: label value to the SLO definition... isn't the use case already covered here? 🤔

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.

4 participants