File tree Expand file tree Collapse file tree 4 files changed +21
-8
lines changed
Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -5,23 +5,23 @@ metadata:
55 name : grafana-alloy
66---
77apiVersion : rbac.authorization.k8s.io/v1
8- kind : RoleBinding
8+ kind : ClusterRoleBinding
99metadata :
1010 name : grafana-alloy
1111roleRef :
1212 apiGroup : rbac.authorization.k8s.io
1313 kind : ClusterRole
1414 name : view
1515subjects :
16- - kind : ServiceAccount
17- name : grafana-alloy
16+ - kind : ServiceAccount
17+ name : grafana-alloy
18+ namespace : quickpizza
1819---
1920apiVersion : apps/v1
2021kind : Deployment
2122metadata :
2223 name : grafana-alloy
23- labels : &alloyLabels
24- # application name: groups all related resources
24+ labels : &alloyLabels # application name: groups all related resources
2525 app.k8s.io/name : grafana-alloy
2626 # component type: defines the role of this deployment
2727 app.kubernetes.io/component : service
7777 targetPort : grpc
7878 - port : 4318
7979 name : http
80- targetPort : http
80+ targetPort : http
Original file line number Diff line number Diff line change @@ -82,6 +82,13 @@ loki.source.kubernetes "application_pods" {
8282}
8383
8484discovery.relabel "application_pods_profiles" {
85+
86+ // Drop database pods - they don't expose pprof endpoints
87+ rule {
88+ source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_component"]
89+ regex = "database"
90+ action = "drop"
91+ }
8592 // https://grafana.com/docs/pyroscope/latest/view-and-analyze-profile-data/line-by-line/
8693 rule {
8794 target_label = "service_repository"
Original file line number Diff line number Diff line change @@ -18,10 +18,9 @@ resource "kubernetes_service_account_v1" "alloy" {
1818
1919// Grant the "view" ClusterRole to kubernetes_service_account_v1
2020// This allows Alloy (`service_account_name`) to discover application pods and scrape metrics.
21- resource "kubernetes_role_binding_v1 " "alloy" {
21+ resource "kubernetes_cluster_role_binding_v1 " "alloy" {
2222 metadata {
2323 name = " alloy"
24- namespace = kubernetes_namespace_v1. quickpizza . id
2524 }
2625 role_ref {
2726 api_group = " rbac.authorization.k8s.io"
Original file line number Diff line number Diff line change @@ -95,6 +95,13 @@ loki.source.kubernetes "application_pods" {
9595}
9696
9797discovery.relabel "application_pods_profiles" {
98+
99+ // Drop database pods - they don't expose pprof endpoints
100+ rule {
101+ source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_component"]
102+ regex = "database"
103+ action = "drop"
104+ }
98105 // https://grafana.com/docs/pyroscope/latest/view-and-analyze-profile-data/line-by-line/
99106 rule {
100107 target_label = "service_repository"
You can’t perform that action at this time.
0 commit comments