Skip to content

Commit

Permalink
Updated deprecated stdlib env() w/ sys.env (#1027)
Browse files Browse the repository at this point in the history
* Fixed deprecated stdlib env() with sys.env()

Resolves #1026

* Updated Build Dependencies and Artifacts

* Rebuilt
  • Loading branch information
bentonam authored Dec 21, 2024
1 parent 6a381c3 commit 0cea4a3
Show file tree
Hide file tree
Showing 68 changed files with 135 additions and 135 deletions.
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

0 comments on commit 0cea4a3

Please sign in to comment.