Skip to content

Commit

Permalink
Remove unused implementation of thanos_sidecar_last_heartbeat_success…
Browse files Browse the repository at this point in the history
…_time_seconds metric

Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
  • Loading branch information
arajkumar committed Sep 20, 2021
1 parent b0aa4c3 commit ab4be6b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

### Fixed

- [#4508](https://github.com/thanos-io/thanos/pull/4508) Adjust and rename `ThanosSidecarUnhealthy` to `ThanosSidecarNoConnectionToStartedPrometheus`; Remove `ThanosSidecarPrometheusDown` alert; Remove unused `thanos_sidecar_last_heartbeat_success_time_seconds` metrics.
- [#4468](https://github.com/thanos-io/thanos/pull/4468) Rule: Fix temporary rule filename composition issue.
- [#4476](https://github.com/thanos-io/thanos/pull/4476) UI: fix incorrect html escape sequence used for '>' symbol.
- [#4532](https://github.com/thanos-io/thanos/pull/4532) Mixin: Fixed "all jobs" selector in thanos mixin dashboards.
- [#4607](https://github.com/thanos-io/thanos/pull/4607) Azure: Fix Azure MSI Rate Limit
- [#4508](https://github.com/thanos-io/thanos/pull/4508) Adjust and rename `ThanosSidecarUnhealthy` to `ThanosSidecarNoConnectionToStartedPrometheus`; Remove `ThanosSidecarPrometheusDown`.

### Changed

Expand Down
6 changes: 0 additions & 6 deletions cmd/thanos/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ func runSidecar(
Name: "thanos_sidecar_prometheus_up",
Help: "Boolean indicator whether the sidecar can reach its Prometheus peer.",
})
lastHeartbeat := promauto.With(reg).NewGauge(prometheus.GaugeOpts{
Name: "thanos_sidecar_last_heartbeat_success_time_seconds",
Help: "Timestamp of the last successful heartbeat in seconds.",
})

ctx, cancel := context.WithCancel(context.Background())
g.Add(func() error {
Expand Down Expand Up @@ -191,7 +187,6 @@ func runSidecar(
)
promUp.Set(1)
statusProber.Ready()
lastHeartbeat.SetToCurrentTime()
return nil
})
if err != nil {
Expand All @@ -213,7 +208,6 @@ func runSidecar(
promUp.Set(0)
} else {
promUp.Set(1)
lastHeartbeat.SetToCurrentTime()
}

return nil
Expand Down
10 changes: 4 additions & 6 deletions examples/alerts/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,14 @@ rules:
severity: critical
- alert: ThanosSidecarNoConnectionToStartedPrometheus
annotations:
description: Thanos Sidecar {{$labels.instance}} is unhealthy for more than {{$value}}
seconds.
description: Thanos Sidecar {{$labels.instance}} is unhealthy.
runbook_url: https://github.com/thanos-io/thanos/tree/main/mixin/runbook.md#alert-name-thanossidecarnoconnectiontostartedprometheus
summary: Thanos Sidecar cannot access Prometheus, even though Prometheus seems
healthy and has reloaded WAL.
expr: |
time() - max by (pod, job, instance) (thanos_sidecar_last_heartbeat_success_time_seconds{job=~".*thanos-sidecar.*"}) >= 240
AND on (pod) (
min by (pod) (prometheus_tsdb_data_replay_duration_seconds) != 0
)
thanos_sidecar_prometheus_up{job=~".*thanos-sidecar.*"} == 0
AND on (namespace, pod)
prometheus_tsdb_data_replay_duration_seconds != 0
for: 5m
labels:
severity: critical
Expand Down
2 changes: 1 addition & 1 deletion mixin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ This project is intended to be used as a library. You can extend and customize d
},
sidecar+:: {
selector: 'job=~".*thanos-sidecar.*"',
thanosPrometheusCommonDimensions: 'pod',
thanosPrometheusCommonDimensions: 'namespace, pod',
title: '%(prefix)sSidecar' % $.dashboard.prefix,
},
// TODO(kakkoyun): Fix naming convention: bucketReplicate
Expand Down

0 comments on commit ab4be6b

Please sign in to comment.