Skip to content

Commit

Permalink
[kubenertes] enabled log in traces
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>
  • Loading branch information
qclaogui committed Apr 29, 2024
1 parent 4c4c86a commit e3f7af5
Show file tree
Hide file tree
Showing 45 changed files with 2,018 additions and 1,618 deletions.
2 changes: 1 addition & 1 deletion docker-compose/common/config/alloy/all-in-one.alloy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
level = coalesce(env("ALLOY_LOG_LEVEL"), "warn")
format = "logfmt"
}

Expand Down
2 changes: 1 addition & 1 deletion docker-compose/common/config/alloy/logs.alloy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
level = coalesce(env("ALLOY_LOG_LEVEL"), "warn")
format = "logfmt"
}

Expand Down
2 changes: 1 addition & 1 deletion docker-compose/common/config/alloy/metrics.alloy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
level = coalesce(env("ALLOY_LOG_LEVEL"), "warn")
format = "logfmt"
}

Expand Down
2 changes: 1 addition & 1 deletion docker-compose/common/config/alloy/profiles.alloy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
level = coalesce(env("ALLOY_LOG_LEVEL"), "warn")
format = "logfmt"
}

Expand Down
2 changes: 1 addition & 1 deletion docker-compose/common/config/alloy/traces.alloy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
level = coalesce(env("ALLOY_LOG_LEVEL"), "warn")
format = "logfmt"
}

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/common/alloy/configs/config.alloy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
level = coalesce(env("ALLOY_LOG_LEVEL"), "warn")
format = "logfmt"
}
6 changes: 1 addition & 5 deletions kubernetes/common/alloy/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ helmCharts:
valuesFile: values-k3d-k3s.yaml

resources:
- configs/kubernetes/integrations
- ../../../monitoring-mixins/alloy-mixin/deploy

configMapGenerator:
Expand Down Expand Up @@ -51,8 +52,3 @@ configMapGenerator:
- configs/kubernetes/jobs/kube-state-metrics.alloy
- configs/kubernetes/jobs/kubelet.alloy
- configs/kubernetes/jobs/node-exporter.alloy

secretGenerator:
- name: alloy-env
literals:
- ALLOY_LOG_LEVEL=warn
159 changes: 153 additions & 6 deletions kubernetes/common/alloy/manifests/k8s-all-in-one.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions kubernetes/common/alloy/values-k3d-k3s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ crds:
configReloader:
enabled: false
alloy:
securityContext:
privileged: true
enableReporting: false
configMap:
create: false
Expand Down
19 changes: 6 additions & 13 deletions kubernetes/microservices-mode/logs/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ metadata:
---
apiVersion: v1
data:
config.alloy: "logging {\n\tlevel = coalesce(env(\"ALLOY_LOG_LEVEL\"), \"info\")\n\tformat
config.alloy: "logging {\n\tlevel = coalesce(env(\"ALLOY_LOG_LEVEL\"), \"warn\")\n\tformat
= \"logfmt\"\n}\n\n/********************************************\n * Grafana LGTMP
Stack Receiver Provider\n ********************************************/\nimport.git
\"provider\" {\n\trepository = \"https://github.com/qclaogui/codelab-monitoring.git\"\n\trevision
Expand Down Expand Up @@ -1216,7 +1216,7 @@ data:
= [provider.self_hosted_stack.kubernetes.metrics_receiver]\n}\n"
kind: ConfigMap
metadata:
name: alloy-config-hfmb58htdm
name: alloy-config-2g5bc6hfmc
namespace: monitoring-system
---
apiVersion: v1
Expand Down Expand Up @@ -4631,15 +4631,6 @@ metadata:
type: Opaque
---
apiVersion: v1
data:
ALLOY_LOG_LEVEL: d2Fybg==
kind: Secret
metadata:
name: alloy-env-f7k229g955
namespace: monitoring-system
type: Opaque
---
apiVersion: v1
data:
instance-address: bWVtY2FjaGVkLm1lbWNhY2hlZC1zeXN0ZW0uc3ZjLmNsdXN0ZXIubG9jYWw6MTEyMTE=
instance-name: cHJpbWFyeQ==
Expand Down Expand Up @@ -6508,7 +6499,7 @@ spec:
fieldPath: spec.nodeName
envFrom:
- secretRef:
name: alloy-env-f7k229g955
name: alloy-env
optional: true
image: docker.io/grafana/alloy:v1.0.0
imagePullPolicy: IfNotPresent
Expand All @@ -6535,6 +6526,8 @@ spec:
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 1
securityContext:
privileged: true
volumeMounts:
- mountPath: /etc/alloy
name: config
Expand All @@ -6554,7 +6547,7 @@ spec:
serviceAccountName: alloy
volumes:
- configMap:
name: alloy-config-hfmb58htdm
name: alloy-config-2g5bc6hfmc
name: config
- configMap:
name: alloy-modules-kubernetes-metrics-db96446m8f
Expand Down
1 change: 0 additions & 1 deletion kubernetes/microservices-mode/logs/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ kind: Kustomization

resources:
- ../../common/alloy
- ../../common/alloy/configs/kubernetes/integrations
- loki

# optional
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/microservices-mode/logs/logs.alloy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
level = coalesce(env("ALLOY_LOG_LEVEL"), "warn")
format = "logfmt"
}

Expand Down
19 changes: 6 additions & 13 deletions kubernetes/microservices-mode/metrics/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ metadata:
---
apiVersion: v1
data:
config.alloy: "logging {\n\tlevel = coalesce(env(\"ALLOY_LOG_LEVEL\"), \"info\")\n\tformat
config.alloy: "logging {\n\tlevel = coalesce(env(\"ALLOY_LOG_LEVEL\"), \"warn\")\n\tformat
= \"logfmt\"\n}\n\n/********************************************\n * Grafana LGTMP
Stack Receiver Provider\n ********************************************/\nimport.git
\"provider\" {\n\trepository = \"https://github.com/qclaogui/codelab-monitoring.git\"\n\trevision
Expand All @@ -1033,7 +1033,7 @@ data:
= [provider.self_hosted_stack.kubernetes.metrics_receiver]\n}\n"
kind: ConfigMap
metadata:
name: alloy-config-5fh6g2bbbg
name: alloy-config-764m96t48b
namespace: monitoring-system
---
apiVersion: v1
Expand Down Expand Up @@ -4513,15 +4513,6 @@ metadata:
namespace: monitoring-system
---
apiVersion: v1
data:
ALLOY_LOG_LEVEL: d2Fybg==
kind: Secret
metadata:
name: alloy-env-f7k229g955
namespace: monitoring-system
type: Opaque
---
apiVersion: v1
data:
instance-address: bWVtY2FjaGVkLm1lbWNhY2hlZC1zeXN0ZW0uc3ZjLmNsdXN0ZXIubG9jYWw6MTEyMTE=
instance-name: cHJpbWFyeQ==
Expand Down Expand Up @@ -5885,7 +5876,7 @@ spec:
fieldPath: spec.nodeName
envFrom:
- secretRef:
name: alloy-env-f7k229g955
name: alloy-env
optional: true
image: docker.io/grafana/alloy:v1.0.0
imagePullPolicy: IfNotPresent
Expand All @@ -5912,6 +5903,8 @@ spec:
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 1
securityContext:
privileged: true
volumeMounts:
- mountPath: /etc/alloy
name: config
Expand All @@ -5931,7 +5924,7 @@ spec:
serviceAccountName: alloy
volumes:
- configMap:
name: alloy-config-5fh6g2bbbg
name: alloy-config-764m96t48b
name: config
- configMap:
name: alloy-modules-kubernetes-metrics-db96446m8f
Expand Down
1 change: 0 additions & 1 deletion kubernetes/microservices-mode/metrics/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ kind: Kustomization

resources:
- ../../common/alloy
- ../../common/alloy/configs/kubernetes/integrations
- mimir-distributed

images:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/microservices-mode/metrics/metrics.alloy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
level = coalesce(env("ALLOY_LOG_LEVEL"), "warn")
format = "logfmt"
}

Expand Down
19 changes: 6 additions & 13 deletions kubernetes/microservices-mode/profiles/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ metadata:
---
apiVersion: v1
data:
config.alloy: "logging {\n\tlevel = coalesce(env(\"ALLOY_LOG_LEVEL\"), \"info\")\n\tformat
config.alloy: "logging {\n\tlevel = coalesce(env(\"ALLOY_LOG_LEVEL\"), \"warn\")\n\tformat
= \"logfmt\"\n}\n\n/********************************************\n * Grafana LGTMP
Stack Receiver Provider\n ********************************************/\nimport.git
\"provider\" {\n\trepository = \"https://github.com/qclaogui/codelab-monitoring.git\"\n\trevision
Expand Down Expand Up @@ -1099,7 +1099,7 @@ data:
= [provider.self_hosted_stack.kubernetes.metrics_receiver]\n}\n"
kind: ConfigMap
metadata:
name: alloy-config-m9k4kcgmdc
name: alloy-config-6h7tb697c9
namespace: monitoring-system
---
apiVersion: v1
Expand Down Expand Up @@ -4554,15 +4554,6 @@ metadata:
namespace: profiles-system
---
apiVersion: v1
data:
ALLOY_LOG_LEVEL: d2Fybg==
kind: Secret
metadata:
name: alloy-env-f7k229g955
namespace: monitoring-system
type: Opaque
---
apiVersion: v1
data:
instance-address: bWVtY2FjaGVkLm1lbWNhY2hlZC1zeXN0ZW0uc3ZjLmNsdXN0ZXIubG9jYWw6MTEyMTE=
instance-name: cHJpbWFyeQ==
Expand Down Expand Up @@ -5622,7 +5613,7 @@ spec:
fieldPath: spec.nodeName
envFrom:
- secretRef:
name: alloy-env-f7k229g955
name: alloy-env
optional: true
image: docker.io/grafana/alloy:v1.0.0
imagePullPolicy: IfNotPresent
Expand All @@ -5649,6 +5640,8 @@ spec:
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 1
securityContext:
privileged: true
volumeMounts:
- mountPath: /etc/alloy
name: config
Expand All @@ -5668,7 +5661,7 @@ spec:
serviceAccountName: alloy
volumes:
- configMap:
name: alloy-config-m9k4kcgmdc
name: alloy-config-6h7tb697c9
name: config
- configMap:
name: alloy-modules-kubernetes-metrics-db96446m8f
Expand Down
1 change: 0 additions & 1 deletion kubernetes/microservices-mode/profiles/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ kind: Kustomization

resources:
- ../../common/alloy
- ../../common/alloy/configs/kubernetes/integrations
- pyroscope

# optional
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/microservices-mode/profiles/profiles.alloy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
logging {
level = coalesce(env("ALLOY_LOG_LEVEL"), "info")
level = coalesce(env("ALLOY_LOG_LEVEL"), "warn")
format = "logfmt"
}

Expand Down
Loading

0 comments on commit e3f7af5

Please sign in to comment.