Skip to content

Commit 2412b13

Browse files
brettimusBrett Beutell
and
Brett Beutell
authored
Make SLO examples in README clearer (#53)
Co-authored-by: Brett Beutell <[email protected]>
1 parent 16c6d22 commit 2412b13

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,19 @@ To use autometrics SLOs and alerts, create one or multiple `Objective`s based on
6767
from autometrics import autometrics
6868
from autometrics.objectives import Objective, ObjectiveLatency, ObjectivePercentile
6969

70-
API_SLO = Objective(
71-
"My API SLO for High Error Rate",
70+
# Create an objective for a high success rate
71+
API_SLO_HIGH_SUCCESS = Objective(
72+
"My API SLO for High Success Rate (99.9%)",
7273
success_rate=ObjectivePercentile.P99_9,
74+
)
75+
76+
# Or you can also create an objective for low latency
77+
API_SLO_LOW_LATENCY = Objective(
78+
"My API SLO for Low Latency (99th percentile < 250ms)",
7379
latency=(ObjectiveLatency.Ms250, ObjectivePercentile.P99),
7480
)
7581

76-
@autometrics(objective=API_SLO)
82+
@autometrics(objective=API_SLO_HIGH_SUCCESS)
7783
def api_handler():
7884
# ...
7985
```

0 commit comments

Comments
 (0)