Skip to content

feat(cloud): docktail.cloud.* labels for monitoring intent - #96

Merged
marvinvr merged 4 commits into
issue-38from
issue-102
Sep 30, 2026
Merged

marvinvr merged 4 commits into
issue-38from
issue-102

Conversation

@marvinvr

Copy link
Copy Markdown
Owner

Stacked on #91 — merge that first (this branch starts from its head so the proto copy includes it).

Adds docktail.cloud.* labels so a container can declare how DockTail Cloud monitors it, next to the rest of its labels:

Label Effect
docktail.cloud.ignore=true Never reported as a service, never checked or log-captured; listed in the container inventory marked label_ignored and not watchable.
docktail.cloud.logs=off Never capture incident log excerpts (a label can only switch capture off).
docktail.cloud.check.kind=tcp|http Local check kind.
docktail.cloud.check.path=/healthz HTTP check path (implies http).
docktail.cloud.check.expect-status=204 The HTTP status that counts as up (implies http).

Model. The agent applies label intent itself: for its own setting a label wins over the cloud-pushed config, field by field, and a setting without a label keeps the cloud's value. Valid intent is reported per service in the snapshot (additive, omitempty proto fields: Service.LabelIntent, Container.LabelIgnored, plus SanitizeLabelIntent) so the dashboard can show what is set by label.

Safety. Label values go through the same bounds as cloud config (ValidateHTTPPath, status 100–599, tcp/http only); invalid values and unknown docktail.cloud.* keys are logged once per container and dropped. The check destination still comes only from local discovery. A service whose backend protocol is tcp keeps its TCP check whatever the HTTP labels say. An ignored container's events are keyed by container name, and no logs are captured for it.

Nothing changes for the Tailscale reconciler. Docs: docs/04-labels.md (new "DockTail Cloud Labels" section) and docs/06-cloud.md. Unit tests in cloud/labels_test.go.

Refs marvinvr/docktail-cloud#102

Containers can now declare how DockTail Cloud monitors them, next to the
rest of their labels:

- docktail.cloud.ignore=true keeps the container out of Cloud monitoring:
  it is never reported as a service, checked or log-captured, and is
  listed in the container inventory marked label_ignored instead.
- docktail.cloud.logs=off never captures incident log excerpts for it.
- docktail.cloud.check.kind / .path / .expect-status shape the local
  check (a path or expected status implies http).

The agent applies label intent itself: a label wins over the pushed
config for its own setting, field by field, and settings without a label
keep the cloud's value. Invalid values and unknown docktail.cloud.* keys
are logged once per container and dropped, validated against the same
bounds as cloud config, so a label can never pick a check destination.
Valid intent is reported on each snapshot service (additive, omitempty
proto fields) so the dashboard can show what is set by label.

Nothing changes for the Tailscale reconciler.
@marvinvr
marvinvr changed the base branch from main to issue-38 September 24, 2026 04:12
@marvinvr
marvinvr added this pull request to stack #98 September 24, 2026 04:12
@marvinvr
marvinvr merged commit 6bfdfaf into main Sep 30, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant