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

Dynamic routing based on namespace #21882

Open
thenu97 opened this issue Nov 25, 2024 · 1 comment
Open

Dynamic routing based on namespace #21882

thenu97 opened this issue Nov 25, 2024 · 1 comment
Labels
sink: vector Anything `vector` sink related type: feature A value-adding code addition that introduce new functionality.

Comments

@thenu97
Copy link

thenu97 commented Nov 25, 2024

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

We currently have an EKS cluster where each client has their own namespace. We want to be able to send each client logs to an EC2 instance that belongs to the client.

Attempted Solutions

We tried deploying a vector instance per namespace, however, we quickly realised that having 300 namespaces, it'll be a vector per node per namespace so that'll be 300 pods per node, which obviously isn't ideal.

Proposal

We're hoping we will be able to do some intelligent namespace based routing e.g.

data_dir: /vector-data-dir
sources:
  kube_logs:
    type: kubernetes_logs
    auto_partial_merge: true
    # extra_field_selector: "metadata.namespace=${namespace}"

transforms:
  add_metadata:
    inputs:
      - kube_logs
    type: remap
    source: |
      .namespace = .kubernetes.namespace
      .cluster_name = "${cluster_name}"

sinks:
  namespace_router:
    type: vector
    inputs:
      - add_metadata
    address: "{{ namespace }}-0.hosting.test.com:3150"

however type: vector doesn't have address template-able.

If this isn't the best way of handling, please let us know what the best practice is in such cases

References

No response

Version

0.40.1

@thenu97 thenu97 added the type: feature A value-adding code addition that introduce new functionality. label Nov 25, 2024
@pront
Copy link
Member

pront commented Nov 26, 2024

Hi @thenu97, thanks for creating this. I cannot think of a workaround that works elegantly for a large number of namespaces.

This is a nice feature but it will require a number of changes in the Vector sink.

@pront pront added the sink: vector Anything `vector` sink related label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sink: vector Anything `vector` sink related type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants