Skip to content

Commit

Permalink
Re-filter after discovery.process to remove any non-kubernetes java p…
Browse files Browse the repository at this point in the history
…rocesses (#652)

* Re-filter after discovery.process to remove any non-kubernetes java processes

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

* No need to re-filter namespaces

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

* Move pod drop higher up to filter earlier. Rearrange some of the rule arguments

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

---------

Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall authored Jul 26, 2024
1 parent 7cb9db2 commit 1053000
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,38 @@ discovery.process "java_pods" {
discovery.relabel "java_pods" {
targets = discovery.process.java_pods.targets
rule {
action = "drop"
regex = "Succeeded|Failed|Completed"
source_labels = ["__meta_kubernetes_pod_phase"]
regex = "Succeeded|Failed|Completed"
action = "drop"
}
rule {
source_labels = ["__meta_kubernetes_pod_name"]
regex = "^$"
action = "drop"
}
rule {
source_labels = ["__meta_process_exe"]
action = "keep"
regex = ".*/java$"
}
rule {
action = "replace"
source_labels = ["__meta_kubernetes_namespace"]
action = "replace"
target_label = "namespace"
}
rule {
action = "replace"
source_labels = ["__meta_kubernetes_pod_name"]
action = "replace"
target_label = "pod"
}
rule {
action = "replace"
source_labels = ["__meta_kubernetes_pod_node_name"]
action = "replace"
target_label = "node"
}
rule {
action = "replace"
source_labels = ["__meta_kubernetes_pod_container_name"]
action = "replace"
target_label = "container"
}
{{- if .Values.profiles.java.extraRelabelingRules }}
Expand Down
34 changes: 22 additions & 12 deletions examples/application-observability/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions examples/application-observability/profiles.alloy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 22 additions & 12 deletions examples/profiles-enabled/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions examples/profiles-enabled/profiles.alloy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1053000

Please sign in to comment.