Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off clustering for log gathering alloy #474

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

petewall
Copy link
Collaborator

Move PodLogs control to the primary alloy, which does use clustering.

Also add some instructions for setting the storage path for logs instance.

…the primary alloy, which does use clustering.

Also add some instructions for setting the storage path for logs instance

Signed-off-by: Pete Wall <pete.wall@grafana.com>
Copy link

@thampiotr thampiotr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

*/}}
{{ fail "Invalid configuration for gathering pod logs! When using logs.pod_logs.gatherMethod: \"volumes\", Grafana Alloy for Logs should not utilize clustering. Otherwise, performance will suffer!\nPlease set:\nalloy-logs:\n alloy:\n clustering:\n enabled: false"}}
{{- end }}

{{- else if eq .Values.logs.pod_logs.gatherMethod "api" }}
{{- if not (index .Values "alloy-logs").alloy.clustering.enabled }}
{{- if eq (index .Values "alloy-logs").controller.type "daemonset" }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logs via k8s API can be collected with a deployment or statefulset, a daemonset ties the number of instances to number of nodes, which is not necessary. Technically this is not wrong though.

Comment on lines +55 to +65
enableStatefulSetAutoDeletePVC: true
volumeClaimTemplates:
- metadata:
name: alloy-log-positions
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: "standard"
resources:
requests:
storage: 100Mi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just that we haven't been running it this way, so not much experience on our side.

@petewall petewall merged commit 7ec6d61 into main Apr 18, 2024
5 checks passed
@petewall petewall deleted the fix/disable-log-clustering branch April 18, 2024 15:23
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.

Add documentation / example for using volumes for log file positions Turn off clustering for Alloy for Logs
3 participants