Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kubernetes/grafana-alloy/base/resources/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
app.k8s.io/name: grafana-alloy
spec:
restartPolicy: Always
serviceAccountName: grafana-alloy
serviceAccountName: grafana-alloy-sa
containers:
- name: grafana-alloy
image: grafana/alloy:v1.9.1
Expand Down
9 changes: 5 additions & 4 deletions kubernetes/grafana-alloy/base/resources/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: grafana-alloy
name: grafana-alloy-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
kind: ClusterRoleBinding
metadata:
name: grafana-alloy
name: grafana-alloy-crb
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: view
subjects:
- kind: ServiceAccount
name: grafana-alloy
name: grafana-alloy-sa

81 changes: 49 additions & 32 deletions kubernetes/grafana-alloy/cloud/config/grafana-alloy.river
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
// Traces
otelcol.receiver.otlp "default" {
grpc {
endpoint = "0.0.0.0:4317"
}

http {
endpoint = "0.0.0.0:4318"
}

output {
traces = [otelcol.processor.batch.default.input]
}
}

otelcol.processor.batch "default" {
output {
metrics = []
logs = []
traces = [
grafana_cloud.stack.receivers.traces,
]
}
}

// Metrics
// Discovery
discovery.kubernetes "application_pods" {
selectors {
label = "app.k8s.io/name=quickpizza"
Expand All @@ -34,12 +9,6 @@ discovery.kubernetes "application_pods" {
own_namespace = true
}
}
prometheus.scrape "default" {
forward_to = [
grafana_cloud.stack.receivers.metrics,
]
targets = discovery.relabel.relabel_targets.output
}

discovery.relabel "relabel_targets" {
rule {
Expand All @@ -63,6 +32,54 @@ discovery.relabel "relabel_targets" {
targets = discovery.kubernetes.application_pods.targets
}

// Metrics
prometheus.scrape "default" {
forward_to = [
grafana_cloud.stack.receivers.metrics,
]
targets = discovery.relabel.relabel_targets.output
}

// Logs
loki.source.kubernetes "pods" {
targets = discovery.kubernetes.application_pods.targets
forward_to = [
grafana_cloud.stack.receivers.logs,
]
}

loki.source.kubernetes_events "k8s_event_logs" {
forward_to = [
grafana_cloud.stack.receivers.logs,
]
}

// Traces
otelcol.receiver.otlp "default" {
grpc {
endpoint = "0.0.0.0:4317"
}

http {
endpoint = "0.0.0.0:4318"
}

output {
traces = [otelcol.processor.batch.default.input]
}
}

otelcol.processor.batch "default" {
output {
metrics = []
logs = []
traces = [
grafana_cloud.stack.receivers.traces,
]
}
}

// Profiles
pyroscope.scrape "scrape_profiles" {
forward_to = [
grafana_cloud.stack.receivers.profiles,
Expand Down
Loading