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

Supporting Kubernetes event properties in OpenSearch index format #155

Open
jarnfast opened this issue Jan 18, 2024 · 0 comments · May be fixed by #181
Open

Supporting Kubernetes event properties in OpenSearch index format #155

jarnfast opened this issue Jan 18, 2024 · 0 comments · May be fixed by #181

Comments

@jarnfast
Copy link

Hi,

in multi-tenant clusters it is possible to configure the kubernetes-event-exporter with multiple rules and receiver so that events for the tenant namespaces end up in dedicated indices in OpenSearch.

The problem is that whenever a tenant is onboarded the kubernetes-event-exporter's configuration needs to be extended with an additional rule and receiver.

If the indexFormat allowed for expansion of event properties this could be achieved with a single rule and receiver.
E.g.

receivers:
  - name: "by-namespace"
    opensearch:
      hosts:
        - http://localhost:9200
      indexFormat: "kube-events-{{ .Namespace }}-{2006-01-02}"

This could implemented by passing the *kube.EnhancedEvent to osFormatIndexName method and letting it expand any event properties denoted with {{ .. }} using GetString(event *kube.EnhancedEvent, text string) from tmpl.go before doing the Go time formatting directives - this way it'll be backwards compatible.

This would be similar to the channel behavior in the slack receiver and the layout templates.

If this sounds agreeable I'll gladly attempt to implement this functionality.

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 a pull request may close this issue.

1 participant