Skip to content

Commit 28e447c

Browse files
authored
fix(monitoring): stop tracking the polarsignals-cloud Secret in ArgoCD (#476)
The empty-shell pattern (commit the object with no data, live-patch the token) kept breaking: the token went missing twice in a row right after unrelated syncs of this same Application, each time taking down remote-write to Polar Signals Cloud until manually recreated. Rather than chase the exact SSA mechanism, remove the object from git entirely so ArgoCD never applies or diffs it at all — this repo tracks resources by the argocd.argoproj.io/tracking-id annotation, so an object without one is invisible to sync and prune alike. The Prometheus CR still references the Secret by name; only the object that provisions it is gone from here.
1 parent fdcc25f commit 28e447c

2 files changed

Lines changed: 20 additions & 17 deletions

File tree

monitoring/README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,22 @@ kubectl --namespace=parca-analytics patch middleware psc-remote-write-headers \
5151
## Sending parca-analytics data to Polar Signals Cloud via remoteWrite
5252

5353
The parca-analytics Prometheus has a second `remoteWrite` target pointing
54-
directly at Polar Signals Cloud. The token is not committed to git — the
55-
`polarsignals-cloud` Secret is committed with no `data` at all, matching the
56-
`objectStorageSecret` pattern above. Once you have a Polar Signals Cloud API
57-
token, patch it in:
54+
directly at Polar Signals Cloud. The token is not committed to git, and unlike
55+
`objectStorageSecret`, the `polarsignals-cloud` Secret isn't declared in git
56+
at all — it's created directly in the cluster and left untracked by ArgoCD,
57+
so a sync can never prune or reset it. Once you have a Polar Signals Cloud API
58+
token, create it:
5859

5960
```bash
6061
kubectl --namespace=parca-analytics create secret generic polarsignals-cloud \
61-
--from-literal=token=<token> --dry-run=client -o yaml \
62-
| kubectl apply -f -
62+
--from-literal=token=<token>
63+
```
64+
65+
If the Secret already exists with ArgoCD's `argocd.argoproj.io/tracking-id`
66+
annotation on it (e.g. left over from before this Secret was untracked),
67+
remove that annotation so `prune: true` syncs leave it alone:
68+
69+
```bash
70+
kubectl --namespace=parca-analytics annotate secret polarsignals-cloud \
71+
argocd.argoproj.io/tracking-id-
6372
```

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,11 @@ local prometheuses = [
327327
remoteWrite: [{
328328
url: 'https://api.polarsignals.com/api/v1/write',
329329
authorization: {
330-
credentials: { name: p.polarSignalsCloudSecret.metadata.name, key: 'token' },
330+
// Deliberately not the polarSignalsCloudSecret object it once was: this
331+
// Secret is created directly in the cluster, untracked by ArgoCD (see
332+
// monitoring/README.md), so nothing ever prunes or resyncs its token
333+
// away. Referencing it by name here is the only coupling left.
334+
credentials: { name: 'polarsignals-cloud', key: 'token' },
331335
},
332336
headers: {
333337
projectID: '5a755043-1fb8-48fd-a2c8-2787498ec59d',
@@ -379,16 +383,6 @@ local prometheuses = [
379383
},
380384
},
381385

382-
polarSignalsCloudSecret: {
383-
apiVersion: 'v1',
384-
kind: 'Secret',
385-
metadata: {
386-
name: 'polarsignals-cloud',
387-
namespace: p._config.namespace,
388-
labels: p._config.commonLabels,
389-
},
390-
},
391-
392386
polarSignalsCloudRemoteWriteSLO: {
393387
apiVersion: 'pyrra.dev/v1alpha1',
394388
kind: 'ServiceLevelObjective',

0 commit comments

Comments
 (0)