Skip to content

Commit

Permalink
Add stability level guideline
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall committed Oct 22, 2024
1 parent a1e6d6b commit ca27d88
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 7 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions charts/k8s-monitoring/docs/examples/remote-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ cluster:

alloy-metrics:
enabled: true
alloy:
stabilityLevel: public-preview
remoteConfig:
enabled: true
url: "https://remote-config.example.com/alloy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ remotecfg {
username = nonsensitive(remote.kubernetes.secret.alloy_metrics_remote_cfg.data["username"])
password = remote.kubernetes.secret.alloy_metrics_remote_cfg.data["password"]
}
id = "remote-config-example-cluster-default-" + constants.hostnamepoll_frequency = "5m"
id = "remote-config-example-cluster-default-" + constants.hostname
poll_frequency = "5m"
attributes = {
"cluster" = "remote-config-example-cluster",
"platform" = "kubernetes",
"workloadType": "statefulset",
"workloadType" = "statefulset",
}
}
7 changes: 4 additions & 3 deletions charts/k8s-monitoring/docs/examples/remote-config/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ data:
username = nonsensitive(remote.kubernetes.secret.alloy_metrics_remote_cfg.data["username"])
password = remote.kubernetes.secret.alloy_metrics_remote_cfg.data["password"]
}
id = "remote-config-example-cluster-default-" + constants.hostnamepoll_frequency = "5m"
id = "remote-config-example-cluster-default-" + constants.hostname
poll_frequency = "5m"
attributes = {
"cluster" = "remote-config-example-cluster",
"platform" = "kubernetes",
"workloadType": "statefulset",
"workloadType" = "statefulset",
}
}
---
Expand Down Expand Up @@ -267,7 +268,7 @@ spec:
- --cluster.enabled=true
- --cluster.join-addresses=ko-alloy-metrics-cluster
- --cluster.name="alloy-metrics"
- --stability.level=generally-available
- --stability.level=public-preview
env:
- name: ALLOY_DEPLOY_MODE
value: "helm"
Expand Down
2 changes: 2 additions & 0 deletions charts/k8s-monitoring/docs/examples/remote-config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ cluster:

alloy-metrics:
enabled: true
alloy:
stabilityLevel: public-preview
remoteConfig:
enabled: true
url: "https://remote-config.example.com/alloy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ remotecfg {
id = {{ .id | quote }}
{{- else }}
id = "{{ $.Values.cluster.name }}-{{ $.Release.Namespace }}-" + constants.hostname
{{- end -}}
{{- end }}
poll_frequency = {{ .pollFrequency | quote }}
attributes = {
"cluster" = {{ $.Values.cluster.name | quote }},
"platform" = "kubernetes",
"workloadType": {{ (index $.Values $.collectorName).controller.type | quote }},
"workloadType" = {{ (index $.Values $.collectorName).controller.type | quote }},
{{- range $key, $value := .extraAttributes }}
{{ $key | quote }} = {{ $value | quote }},
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,18 @@
{{- end }}
{{- end }}
{{- end }}

{{- define "collectors.validate.remoteConfig" }}
{{- if (index .Values .collectorName).enabled }}
{{- if (index .Values .collectorName).remoteConfig.enabled }}
{{- if not (has (index .Values .collectorName).alloy.stabilityLevel (list "public-preview" "experimental")) }}
{{- $msg := list "" "The remote configuratino feature requires Alloy to use the \"public-preview\" stability level. Please set:" }}
{{- $msg = append $msg (printf "%s:" .collectorName ) }}
{{- $msg = append $msg " alloy:" }}
{{- $msg = append $msg " stabilityLevel: public-preview" }}
{{- fail (join "\n" $msg) }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

1 change: 1 addition & 0 deletions charts/k8s-monitoring/templates/validations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
{{- include "collectors.validate.featuresEnabled" . }}
{{- range $collectorName := ((include "collectors.list.enabled" .) | fromYamlArray) }}
{{- include "collectors.validate.liveDebugging" (dict "collectorName" $collectorName "Values" $.Values) }}
{{- include "collectors.validate.remoteConfig" (dict "collectorName" $collectorName "Values" $.Values) }}
{{- end }}
---

0 comments on commit ca27d88

Please sign in to comment.