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

Add Keep sink #21965

Open
talboren opened this issue Dec 5, 2024 · 6 comments · May be fixed by #22072
Open

Add Keep sink #21965

talboren opened this issue Dec 5, 2024 · 6 comments · May be fixed by #22072
Labels
sink: new A request for a new sink type: feature A value-adding code addition that introduce new functionality.

Comments

@talboren
Copy link

talboren commented Dec 5, 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

People that use Keep (https://www.github.com/keephq/keep) often want to send events from existing services to our service (cloud or self-hosted). The end goal is having an easy-to-configure log sink for Keep to send events to.

Attempted Solutions

No response

Proposal

Add an Keep log sink. I imagine it to be similar to the HTTP implementation (or even use the existing)

An example vector.toml could look like this:

sinks:
  keep:
    inputs:
      - demo_logs
    api_url: http://keep-backend:8080
    api_key: KEEP_API_KEY
    type: keep
    encoding:
      codec: json

References

No response

Version

No response

@talboren talboren added the type: feature A value-adding code addition that introduce new functionality. label Dec 5, 2024
@jszwedko jszwedko added the sink: new A request for a new sink label Dec 5, 2024
@sainad2222
Copy link

I want to give this a try and wanted to understand few more things about keep after going through their demo_app

  1. Do we need a vector provider support at keep side?
  2. If not, which provider suits more?

@talboren
Copy link
Author

I want to give this a try and wanted to understand few more things about keep after going through their demo_app

  1. Do we need a vector provider support at keep side?
  2. If not, which provider suits more?

Hey @sainad2222 :) I'm the maintainer of Keep and I think we already discussed some of the items in our Slack.
Happy to help with any open questions you may have

@sainad2222
Copy link

@jszwedko Trying to understand what qualifies as a new sink when it can be configured via http too. From what I understood from the examples sinks are present for those who have existing rust sdks/libraries, if they have grpc clients, complex authentication or other things that is hard to support by http. In the example of Keep, we can also use http that can still work

sources:
  sample_prom:
    type: prometheus_scrape
    endpoints:
      - http://localhost:9090/metrics

transforms:
  convert_event:
    inputs:
      - sample_prom
    type: "metric_to_log"
  restructure_event:
    inputs:
      - convert_event
    source: |-
      .event, _err = merge({}, .)
      template = {}
      template.event = .event
      . = template
      .source_type = "prometheus"
    type: "remap"

sinks:
  keep:
    type: "http"
    inputs: ["restructure_event"]
    uri: "http://localhost:8080/alerts/event/vectordev?provider_id=test"
    encoding:
      codec: "json"
    request:
      headers:
        x-api-key: "keepappkey"
        content-type: "application/json"

Will having a dedicated sink help in this case?

@jszwedko
Copy link
Member

From what I understood from the examples sinks are present for those who have existing rust sdks/libraries, if they have grpc clients, complex authentication or other things that is hard to support by http.

You have it right. It's a balance but generally we look at how hard it is to reuse an existing sink to determine whether it makes sense to introduce a new one. In this case, it seems fairly straightforward to use the http sink so rather than adding a new one we could just document how to configure the HTTP sink to push to Keep; however, adding a new sink that is just a wrapper around the HTTP sink is pretty straight-forward, too, though and has the advantage of discoverability and slightly better UX.

@sainad2222
Copy link

I'll try adding a sink and see if we can remove the additional transformers atleast.

@sainad2222
Copy link

For anyone landing on this issue and wants to configure Keep as sink we added support for Vector as a provider in Keep.
Refer this till Keep is added as a sink in Vector.

@sainad2222 sainad2222 linked a pull request Dec 21, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sink: new A request for a new sink type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants