Skip to content

Commit 43ceb18

Browse files
authored
feat(pyrra): add Parca Agent write-availability SLO (#443)
1 parent 16ca4d2 commit 43ceb18

1 file changed

Lines changed: 40 additions & 2 deletions

File tree

pyrra/environments/scaleway-parca-demo/main.jsonnet

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,51 @@ local pyrra = p.pyrra({
88
ingressHosts: ['pyrra.parca.dev'],
99
});
1010

11+
// SLO for the Parca Agent writing profiles to the Parca server. This is the
12+
// core data path of the demo: agents continuously push profiles via the
13+
// ProfileStore Write gRPC method, so a high error rate there means the
14+
// user-facing pipeline is broken. The metric comes from the parca-agent
15+
// PodMonitors, which are the only thing this Prometheus currently scrapes.
16+
local writeAvailabilitySLO(name, job, description) = {
17+
local writeMetric = 'grpc_client_handled_total{job="%s",grpc_service="parca.profilestore.v1alpha1.ProfileStoreService",grpc_method="Write"%s}',
18+
apiVersion: 'pyrra.dev/v1alpha1',
19+
kind: 'ServiceLevelObjective',
20+
metadata: {
21+
name: name,
22+
namespace: 'monitoring',
23+
labels: {
24+
'app.kubernetes.io/name': 'pyrra',
25+
'app.kubernetes.io/component': 'slo',
26+
},
27+
},
28+
spec: {
29+
target: '99.9',
30+
window: '4w',
31+
description: description,
32+
indicator: {
33+
ratio: {
34+
errors: { metric: writeMetric % [job, ',grpc_code!="OK"'] },
35+
total: { metric: writeMetric % [job, ''] },
36+
},
37+
},
38+
},
39+
};
40+
41+
local slos = [
42+
writeAvailabilitySLO(
43+
'parca-agent-write-availability',
44+
'parca/parca-agent',
45+
'Parca Agent writes profiles to the Parca server via ProfileStore Write.',
46+
),
47+
];
48+
1149
{
1250
apiVersion: 'v1',
1351
kind: 'List',
1452
items: [
1553
pyrra[name]
1654
for name in std.objectFields(pyrra)
17-
// SLO definitions come later; only ship the Pyrra components for now.
55+
// The upstream example SLOs target cluster components we do not scrape.
1856
if !std.startsWith(name, 'slo-')
19-
],
57+
] + slos,
2058
}

0 commit comments

Comments
 (0)