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

Updated deprecated stdlib env() w/ sys.env #1027

Merged
merged 3 commits into from
Dec 21, 2024
Merged
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
36 changes: 18 additions & 18 deletions charts/feature-integrations/tests/mysql_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ tests:
argument "metrics_destinations" {
comment = "Must be a list of metric destinations where collected metrics should be forwarded to"
}


remote.kubernetes.secret "my_database" {
name = "my-database-release-name-k8s-monitoring-feature-integrations"
namespace = "NAMESPACE"
}

prometheus.exporter.mysql "my_database" {
data_source_name = string.format("%s:%s@(%s:%d)/",
nonsensitive(remote.kubernetes.secret.my_database.data["username"]),
Expand All @@ -49,7 +49,7 @@ tests:
job_name = "integration/mysql"
forward_to = [prometheus.relabel.my_database.receiver]
}

prometheus.relabel "my_database" {
max_cache_size = 100000
rule {
Expand Down Expand Up @@ -106,7 +106,7 @@ tests:
argument "metrics_destinations" {
comment = "Must be a list of metric destinations where collected metrics should be forwarded to"
}

prometheus.exporter.mysql "test_db" {
data_source_name = string.format("%s:%d/", "database.test.svc", 3306)
enable_collectors = ["heartbeat","mysql.user"]
Expand All @@ -116,7 +116,7 @@ tests:
job_name = "integration/mysql"
forward_to = [prometheus.relabel.test_db.receiver]
}

prometheus.relabel "test_db" {
max_cache_size = 100000
rule {
Expand All @@ -125,7 +125,7 @@ tests:
}
forward_to = argument.metrics_destinations.value
}

prometheus.exporter.mysql "staging_db" {
data_source_name = "root:password@database.staging.svc:3306/"
enable_collectors = ["heartbeat","mysql.user"]
Expand All @@ -135,7 +135,7 @@ tests:
job_name = "integration/mysql"
forward_to = [prometheus.relabel.staging_db.receiver]
}

prometheus.relabel "staging_db" {
max_cache_size = 100000
rule {
Expand All @@ -144,13 +144,13 @@ tests:
}
forward_to = argument.metrics_destinations.value
}


remote.kubernetes.secret "prod_db" {
name = "prod-db-release-name-k8s-monitoring-feature-integrations"
namespace = "NAMESPACE"
}

prometheus.exporter.mysql "prod_db" {
data_source_name = string.format("%s:%s@(%s:%d)/",
nonsensitive(remote.kubernetes.secret.prod_db.data["username"]),
Expand All @@ -165,7 +165,7 @@ tests:
job_name = "integration/mysql"
forward_to = [prometheus.relabel.prod_db.receiver]
}

prometheus.relabel "prod_db" {
max_cache_size = 100000
rule {
Expand Down Expand Up @@ -204,7 +204,7 @@ tests:
dataSource:
host: test-database-mysql.mysql.svc
auth:
usernameFrom: env(MYSQL_ROOT_USER)
usernameFrom: sys.env(MYSQL_ROOT_USER)
passwordKey: mysql-root-password
secret:
create: false
Expand All @@ -222,16 +222,16 @@ tests:
argument "metrics_destinations" {
comment = "Must be a list of metric destinations where collected metrics should be forwarded to"
}


remote.kubernetes.secret "test_database" {
name = "test-database-mysql"
namespace = "mysql"
}

prometheus.exporter.mysql "test_database" {
data_source_name = string.format("%s:%s@(%s:%d)/",
env(MYSQL_ROOT_USER),
sys.env(MYSQL_ROOT_USER),
remote.kubernetes.secret.test_database.data["mysql-root-password"],
"test-database-mysql.mysql.svc",
3306,
Expand All @@ -243,7 +243,7 @@ tests:
job_name = "integration/mysql"
forward_to = [prometheus.relabel.test_database.receiver]
}

prometheus.relabel "test_database" {
max_cache_size = 100000
rule {
Expand Down
2 changes: 1 addition & 1 deletion charts/feature-node-logs/templates/_module.alloy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ declare "node_logs" {
relabel_rules = loki.relabel.journal.rules
labels = {
job = {{ .Values.journal.jobLabel | quote }},
instance = env("HOSTNAME"),
instance = sys.env("HOSTNAME"),
}
forward_to = [loki.process.journal_logs.receiver]
}
Expand Down
2 changes: 1 addition & 1 deletion charts/feature-node-logs/tests/default_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ tests:
relabel_rules = loki.relabel.journal.rules
labels = {
job = "integrations/kubernetes/journal",
instance = env("HOSTNAME"),
instance = sys.env("HOSTNAME"),
}
forward_to = [loki.process.journal_logs.receiver]
}
Expand Down
2 changes: 1 addition & 1 deletion charts/feature-node-logs/tests/filter_units_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ tests:
relabel_rules = loki.relabel.journal.rules
labels = {
job = "integrations/kubernetes/journal",
instance = env("HOSTNAME"),
instance = sys.env("HOSTNAME"),
}
forward_to = [loki.process.journal_logs.receiver]
}
Expand Down
2 changes: 1 addition & 1 deletion charts/feature-node-logs/tests/labels_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ tests:
relabel_rules = loki.relabel.journal.rules
labels = {
job = "integrations/kubernetes/journal",
instance = env("HOSTNAME"),
instance = sys.env("HOSTNAME"),
}
forward_to = [loki.process.journal_logs.receiver]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ tests:
relabel_rules = loki.relabel.journal.rules
labels = {
job = "integrations/kubernetes/journal",
instance = env("HOSTNAME"),
instance = sys.env("HOSTNAME"),
}
forward_to = [loki.process.journal_logs.receiver]
}
Expand Down
2 changes: 1 addition & 1 deletion charts/feature-pod-logs/templates/_volumes.alloy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ discovery.kubernetes "pods" {
role = "pod"
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
{{- if .Values.namespaces }}
namespaces {
Expand Down
6 changes: 3 additions & 3 deletions charts/feature-pod-logs/tests/default_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ tests:
role = "pod"
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
}

Expand Down Expand Up @@ -228,7 +228,7 @@ tests:
role = "pod"
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
}

Expand Down Expand Up @@ -378,7 +378,7 @@ tests:
role = "pod"
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
}

Expand Down
2 changes: 1 addition & 1 deletion charts/feature-profiling/templates/_ebpf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
discovery.kubernetes "ebpf_pods" {
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
{{- if .Values.ebpf.namespaces }}
namespaces {
Expand Down
2 changes: 1 addition & 1 deletion charts/feature-profiling/templates/_java.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
discovery.kubernetes "java_pods" {
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
{{- if .Values.java.namespaces }}
namespaces {
Expand Down
2 changes: 1 addition & 1 deletion charts/feature-profiling/templates/_pprof.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
discovery.kubernetes "pprof_pods" {
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
{{- if .Values.pprof.namespaces }}
namespaces {
Expand Down
12 changes: 6 additions & 6 deletions charts/feature-profiling/tests/ebpf_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ tests:
discovery.kubernetes "ebpf_pods" {
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
role = "pod"
}

discovery.relabel "ebpf_pods" {
targets = discovery.kubernetes.ebpf_pods.targets
rule {
Expand Down Expand Up @@ -63,7 +63,7 @@ tests:
target_label = "service_name"
}
}

pyroscope.ebpf "ebpf_pods" {
targets = discovery.relabel.ebpf_pods.output
demangle = "none"
Expand Down Expand Up @@ -100,14 +100,14 @@ tests:
discovery.kubernetes "ebpf_pods" {
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
namespaces {
names = ["default"]
}
role = "pod"
}

discovery.relabel "ebpf_pods" {
targets = discovery.kubernetes.ebpf_pods.targets
rule {
Expand Down Expand Up @@ -145,7 +145,7 @@ tests:
action = "drop"
}
}

pyroscope.ebpf "ebpf_pods" {
targets = discovery.relabel.ebpf_pods.output
demangle = "none"
Expand Down
8 changes: 4 additions & 4 deletions charts/feature-profiling/tests/java_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ tests:
discovery.kubernetes "java_pods" {
selectors {
role = "pod"
field = "spec.nodeName=" + env("HOSTNAME")
field = "spec.nodeName=" + sys.env("HOSTNAME")
}
role = "pod"
}

discovery.process "java_pods" {
join = discovery.kubernetes.java_pods.targets
}

discovery.relabel "java_pods" {
targets = discovery.process.java_pods.targets
rule {
Expand Down Expand Up @@ -69,7 +69,7 @@ tests:
target_label = "container"
}
}

pyroscope.java "java_pods" {
targets = discovery.relabel.java_pods.output
profiling_config {
Expand Down
Loading
Loading