Skip to main content

Service Annotations

Adds detail about the service that owns the SLOs being defined. The following is an example of what the in-code annotations defining a simple service would look like:

// @sloth service chat-gpt
// @sloth version prometheus/v1
// @sloth labels tier ml-application
// @sloth labels environment staging

Running sloscribe with the above annotations will generate the following sloth specification:

version: prometheus/v1
service: chatgpt
labels:
tier: ml-application
environment: staging

Table of Annotations​

AnnotationDescriptionExample
serviceRequired. The name of the service the definitions refer to.@sloth service chat-gpt
versionThe version of the Sloth specification.@sloth version prometheus/v1
labelsThe labels associated to the Sloth service.@sloth labels foo bar @sloth labels test slo