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

Configure Alloy to be used as a self-service too for logs (source files) #235

Closed
wants to merge 22 commits into from

Conversation

TheoBrigitte
Copy link
Member

  * MC ingest logs from all pods in every namespaces
  * WC ingest logs from all pods in kube-system + giantswarm namespaces
    plus select pods and/or namespaces with the logging label
@TheoBrigitte TheoBrigitte self-assigned this Oct 4, 2024
@@ -44,6 +47,22 @@ alloy:
type: RuntimeDefault
controller:
type: daemonset
extraContainers:
- name: alloy-namespaces
image: bitnami/kubectl:latest
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to use a giantswarm image

@TheoBrigitte
Copy link
Member Author

Still needs to implement the tenant name override from label, like its done here https://github.com/giantswarm/logging-operator/pull/233/files#diff-405f451506c2146b4cf915863a848d9a42f39a3b292a9b6f9ada78b4eac32598R85

@TheoBrigitte
Copy link
Member Author

TheoBrigitte commented Oct 9, 2024

Not following this route as it would not allow to override the tenant when using labels on namespaces, due to the namespaces labels not being available when using discovery.kubernetes.

Trying to discover those labels using a sidecar container also does not work, the idea was to fetch the namespace label and produce a list of namespace_A:tenant_name_A;namespace_B:tenant_name_B; and then extract the tenant name using the following relabel rule

rule {
        source_labels = concat(["__meta_kubernetes_namespace"], split(local.file.namespaces_tenant.content, ";"))
       regex         = "(.+);.*(\1):([0-9]+);.*"

        target_label  = "tenant_namespace"
}

Unfortunately there is no support for backreference (\1) in Alloy/Prometheus regex RE2 engine.

Also this would be super hacky and any other namespace label we would like to process would introduce another hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant