Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <[email protected]>
  • Loading branch information
petewall committed Feb 4, 2025
1 parent feefe8c commit 097afac
Show file tree
Hide file tree
Showing 147 changed files with 3,904 additions and 4,263 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ declare "application_observability" {
{{- end }}
{{- end }}

// {{ $component.description }}
// {{ $component.description | trim }}
{{- include (printf "feature.applicationObservability.%s.alloy" $component.component) $args | indent 2 }}
{{- end }}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
{{- fail (printf "Pod Logs feature should not mount /var/log when using the \"kubernetesApi\" gather method.\nPlease set:\n%s:\n alloy:\n mounts:\n varlog: false" .CollectorName) }}
{{- end -}}
{{- if not .Collector.alloy.clustering.enabled }}
{{- fail (printf "Pod Logs feature requires Alloy to be in clustering mode when using the \"kubernetesApi\" gather method.\nPlease set:\n%s:\n alloy:\n clustering:\n enabled: true" .CollectorName) }}
{{- if eq .Collector.controller.type "daemonset" }}
{{- fail (printf "Pod Logs feature requires Alloy DaemonSet to be in clustering mode when using the \"kubernetesApi\" gather method.\nPlease set:\n%s:\n alloy:\n clustering:\n enabled: true" .CollectorName) }}
{{- else if gt (.Collector.controller.replicas | int) 1 }}
{{- fail (printf "Pod Logs feature requires Alloy with multiple replicas to be in clustering mode when using the \"kubernetesApi\" gather method.\nPlease set:\n%s:\n alloy:\n clustering:\n enabled: true" .CollectorName) }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ tests:
target_label = "tmp_container_runtime"
}
// set the job label from the k8s.grafana.com/logs.job annotation if it exists
rule {
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_job"]
regex = "(.+)"
target_label = "job"
}
// make all labels on the pod available to the pipeline as labels,
// they are omitted before write to loki via stage.label_keep unless explicitly set
rule {
Expand Down Expand Up @@ -112,6 +105,14 @@ tests:
source_labels = ["__meta_kubernetes_pod_annotation_resource_opentelemetry_io_deployment_environment"]
target_label = "deployment_environment"
}
rule {
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_job"]
target_label = "job"
}
rule {
source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_name"]
target_label = "app_kubernetes_io_name"
}
}
discovery.kubernetes "pods" {
Expand Down Expand Up @@ -243,13 +244,6 @@ tests:
target_label = "tmp_container_runtime"
}
// set the job label from the k8s.grafana.com/logs.job annotation if it exists
rule {
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_job"]
regex = "(.+)"
target_label = "job"
}
// make all labels on the pod available to the pipeline as labels,
// they are omitted before write to loki via stage.label_keep unless explicitly set
rule {
Expand Down Expand Up @@ -304,6 +298,14 @@ tests:
source_labels = ["__meta_kubernetes_pod_annotation_resource_opentelemetry_io_deployment_environment"]
target_label = "deployment_environment"
}
rule {
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_job"]
target_label = "job"
}
rule {
source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_name"]
target_label = "app_kubernetes_io_name"
}
}
discovery.kubernetes "pods" {
Expand Down Expand Up @@ -433,13 +435,6 @@ tests:
target_label = "tmp_container_runtime"
}
// set the job label from the k8s.grafana.com/logs.job annotation if it exists
rule {
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_job"]
regex = "(.+)"
target_label = "job"
}
// make all labels on the pod available to the pipeline as labels,
// they are omitted before write to loki via stage.label_keep unless explicitly set
rule {
Expand Down Expand Up @@ -494,6 +489,14 @@ tests:
source_labels = ["__meta_kubernetes_pod_annotation_resource_opentelemetry_io_deployment_environment"]
target_label = "deployment_environment"
}
rule {
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_job"]
target_label = "job"
}
rule {
source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_name"]
target_label = "app_kubernetes_io_name"
}
}
discovery.kubernetes "pods" {
Expand Down Expand Up @@ -631,13 +634,6 @@ tests:
target_label = "tmp_container_runtime"
}
// set the job label from the k8s.grafana.com/logs.job annotation if it exists
rule {
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_job"]
regex = "(.+)"
target_label = "job"
}
// make all labels on the pod available to the pipeline as labels,
// they are omitted before write to loki via stage.label_keep unless explicitly set
rule {
Expand Down Expand Up @@ -692,6 +688,14 @@ tests:
source_labels = ["__meta_kubernetes_pod_annotation_resource_opentelemetry_io_deployment_environment"]
target_label = "deployment_environment"
}
rule {
source_labels = ["__meta_kubernetes_pod_annotation_k8s_grafana_com_logs_job"]
target_label = "job"
}
rule {
source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_name"]
target_label = "app_kubernetes_io_name"
}
}
discovery.kubernetes "pods" {
Expand Down

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

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

Loading

0 comments on commit 097afac

Please sign in to comment.