Skip to content

Commit

Permalink
feat: new grafana panel for release latency seconds
Browse files Browse the repository at this point in the history
new metric release latency seconds
new grafana panel of same name
measures latency between integration tests
completing and release creation

Signed-off-by: Jennefer Cullinan <[email protected]>
  • Loading branch information
jencull committed Sep 13, 2023
1 parent bec4cb8 commit 36e39be
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
94 changes: 94 additions & 0 deletions config/grafana/dashboards/integration-service-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,100 @@
"timeShift": null
}

{
"id": 28,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 42
},
"type": "graph",
"title": "Latency - Release Created",
"thresholds": [],
"pluginVersion": "9.1.6",
"description": "Track the time between all integration tests passed/snapshot finished testing and when release is created",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"aliasColors": {},
"dashLength": 10,
"fill": 1,
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"pointradius": 2,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"targets": [
{
"exemplar": true,
"expr": "histogram_quantile(0.90, sum(rate(release_latency_seconds_bucket[5m])) by (le))",
"instant": false,
"interval": "",
"legendFormat": "{{ le }}",
"refId": "A",
"editorMode": "code"
}
],
"timeRegions": [],
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
},
"bars": false,
"dashes": false,
"fillGradient": 0,
"hiddenSeries": false,
"percentage": false,
"points": false,
"stack": false,
"steppedLine": false,
"timeFrom": null,
"timeShift": null,
"interval": "5m"
}

],
"schemaVersion": 27,
"style": "dark",
Expand Down
13 changes: 13 additions & 0 deletions metrics/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ var (
},
[]string{"type", "reason"},
)

ReleaseLatencySeconds = prometheus.NewHistogram(
prometheus.HistogramOpts{
Name: "release_latency_seconds",
Help: "Latency between integration tests completion and release creation",
Buckets: []float64{7, 15, 30, 60, 150, 300, 450, 600, 750, 900, 1050},
},
)
)

func RegisterCompletedSnapshot(conditiontype, reason string, startTime metav1.Time, completionTime *metav1.Time) {
Expand Down Expand Up @@ -100,6 +108,10 @@ func RegisterNewIntegrationPipelineRun(snapshotCreatedTime metav1.Time, pipeline
RegisterPipelineRunStarted(snapshotCreatedTime, pipelineRunStartTime)
}

func RegisterReleaseLatency(integrationTestsFinishTime metav1.Time, releaseCreationTime metav1.Time) {
ReleaseLatencySeconds.Observe(releaseCreationTime.Sub(integrationTestsFinishTime.Time).Seconds())

Check warning on line 112 in metrics/integration.go

View check run for this annotation

Codecov / codecov/patch

metrics/integration.go#L111-L112

Added lines #L111 - L112 were not covered by tests
}

func init() {
metrics.Registry.MustRegister(
SnapshotCreatedToPipelineRunStartedSeconds,
Expand All @@ -109,5 +121,6 @@ func init() {
SnapshotDurationSeconds,
SnapshotInvalidTotal,
SnapshotTotal,
ReleaseLatencySeconds,
)
}

0 comments on commit 36e39be

Please sign in to comment.