30 Commits

Author SHA1 Message Date
Kebree
907ce911f7 enable sha mechanism for kafka authentication (#173)
Co-authored-by: Jean-Baptiste GINTRAND <jean-baptiste.gintrand@forterro.com>
2024-05-14 00:27:38 +03:00
dependabot[bot]
2668c4309d Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#149)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-23 08:26:23 +03:00
Ronak Nathani
d7ba03a966 Improves leader election so that we don't lose events (#153)
Currently, when a replica loses its leadership, a new leader isn't elected until leaseDuration seconds.
Here, that is 15s. The max time till we get a new leader is leaseDuration (15s) + retryPeriod (2s) = 17s.

This commit updates the shutdown process such that if the leader replica is sent a shutdown signal,
it sleeps for leaseDuration seconds. This allows the leader replica to continue to export events until
a new leader is elected. And a new leader is elected only if lease hasn't been renewed and leaseDuration expires.

In addition to this, leader election now uses the leases object instead of configMaps and leases. The clusterRole
is also updated to allow writing to the leases object.

For use cases where no event loss is tolerable, users should use maxEventAgeSeconds to > 1.
2024-02-23 08:26:06 +03:00
dependabot[bot]
428f35b3e7 Bump golang.org/x/net from 0.10.0 to 0.17.0 (#133)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-25 14:50:26 +03:00
Manuel Rüger
9e7f84ba16 Use exporter-toolkit (#71)
This adds support for TLS configuration on the http metrics endpoint
as well as support for a landing page.
2023-07-27 11:11:31 +03:00
Serge
b336183798 Support kubernetes 1.27 (#111)
Co-authored-by: Serge <Serge@gmail>
2023-07-24 09:33:07 +03:00
Mustafa Akın
65f6d73cca Merge branch 'migrate-yaml-library-to-expose-config-errors-easier' of https://github.com/Evedel/kubernetes-event-exporter into Evedel-migrate-yaml-library-to-expose-config-errors-easier 2023-07-06 20:30:45 +03:00
Manuel Rüger
811ab9b6c9 go.mod: Update masterminds/sprig to v3 (#72) 2023-07-06 18:38:57 +03:00
dependabot[bot]
2db118fa19 Bump google.golang.org/grpc from 1.51.0 to 1.53.0 (#101)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.51.0 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.51.0...v1.53.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-06 18:31:35 +03:00
Evedel
94ee2b7e03 install goccy/go-yaml 2023-03-19 16:10:21 +11:00
dependabot[bot]
32a64cc965 Bump golang.org/x/net from 0.4.0 to 0.7.0 (#60)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.4.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.4.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-17 09:26:14 +03:00
Mustafa Akın
f9335bda24 Updated packages, tidied and changed package name from opsgenie to resmoio (#45)
* Updated packages, tidied and changed package name from opsgenie to resmoio

* Handle removal of clusterName from API and leader election api change

* Update Dockerfile Go to 1.19

* Test case for parsing minCount properly for #43

* more extensive test case to also match apiVersion config
2022-12-19 10:45:46 +03:00
dbluxo
a4ad4bc3ed fix: update dependencies to fix CVE-2021-43565 & CVE-2022-27664 (#36) 2022-12-12 18:24:40 +03:00
Brian McQueen
b79cc20ecd added initial set of prometheus metrics per ticket #4 exposing basic success and error rates (#15) 2022-09-15 11:09:30 +03:00
Willem Borgesius
90ce4b5f94 Add opensearch sink 2021-12-16 08:17:44 +01:00
Mustafa Akın
b3e76c60bd vendor update 2021-11-06 12:56:49 +03:00
Brian McQueen
7b11ced56a added vendor directory for goavro 2021-10-06 15:26:19 -07:00
Mustafa Akın
fbc68cdade manual vendoring 2021-06-16 22:45:11 +03:00
Mustafa Akın
269b8d3b03 Vendor fixes 2021-06-16 22:42:46 +03:00
vikash s
63dc187fb6 Event bridge config added 2020-09-14 16:36:51 +05:30
Mustafa Akin
fb763662cf Go mod vendor for bigquery libs 2020-08-22 17:24:25 +03:00
Viktor Barinov
480bbc57a5 go-mod-sum 2020-07-21 16:48:35 -07:00
youyongsong
15f2feb28f Add file rolling function in file sink.
I known File Sink is currently mostly used in local development, but we also tend to use it in our production environment with fluentd, because this combination is very stable and reliable.

Currently File Sink lacks the file rolling function, which is very important for the production environment. So I want to add file rolling function to File Sink through this pr without breaking changes.

file rolling is disabled by default, and can be enabled by adding the following arguments:

```yaml
- receivers:
  file:
    path: ./test.log
    maxsize: 20    // if ./test.log is larger than 20MB, it will be renamed to ./test-<datetime>.log as a backup file,
    and create a new file named test.log to receive events. It defaults to 100 megabytes.
    maxage: 20     // if backup files ./test-<datetime>.log are created 20 days ago, they will be deleted. The default
    is not to remove old log files based on age.
    maxbackups: 3  // if backup files are more than 3, older backup files will be removed.
```

the rolling function is powered by [lumberjack](https://github.com/natefinch/lumberjack). Becasue `lumberjack.Logger` implmented `io.WriteCloser` interface, so it is easy to replace `file *os.file` with `writer &lumberjack.Logger`.

run kubernetes-event-exporter with following config:
```yaml
logLevel: debug
route:
  match:
    - receiver: "file"
receivers:
  - name: "file"
    file:
      path: "./event.log"
      maxsize: 1
      maxbackups: 4
```
run following script to generate events and output `./event*.log` status:
```shell
while true
do
  kubectl run nginx --image nginx || kubectl delete deployment nginx
  ls -lh event*.log
  sleep 2
done
```
the result is:
```
deployment.apps "nginx" deleted
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:03 event-2020-03-04T10-03-30.271.log
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:15 event-2020-03-04T10-15-52.496.log
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:28 event-2020-03-04T10-28-27.334.log
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:41 event-2020-03-04T10-41-11.316.log
-rw-r--r-- 1 ysyou staff 1023K Mar  4 18:54 event.log
deployment.apps/nginx created
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:15 event-2020-03-04T10-15-52.496.log
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:28 event-2020-03-04T10-28-27.334.log
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:41 event-2020-03-04T10-41-11.316.log
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:54 event-2020-03-04T10-54-11.451.log
-rw-r--r-- 1 ysyou staff 2.0K Mar  4 18:54 event.log
```
when `event.log` reaches 1M, it is renamed to `event-2020-03-04T10-54-11.451.log`, because backup files are more than 4, the oldest one `event-2020-03-04T10-03-30.271.log` is deleted.
2020-05-06 16:07:36 +08:00
Brian Terry
e5f113b386 Add OpsCenter Sink 2020-04-21 10:29:02 -04:00
shikloshi
ad043f7145 adding pubsub sink 2020-02-03 09:44:31 +02:00
Marc Demierre
8c5d1871db sink: Implement basic Kafka sink
This new sink adds basic support for Kafka, using `sarama.SyncProducer`.

It allows minimal configuration to make it useful:

- Topic
- Broker List
- TLS settings

The layout transformations are supported in the same way as for kinesis.

Implements issue #6.
2019-12-15 14:00:00 +01:00
Mustafa Akin
b78cf2d997 Add Slack, SQS, SNS outputs. Batching skeleton is implemented but not used in sinks 2019-12-01 16:26:31 +03:00
Mustafa Akin
9f9bcc62d9 go mod vendor and tidy, and README is updated 2019-11-21 10:38:51 -08:00
Mustafa Akin
c4726c1a72 Opsgenie output is added, some minor fixes 2019-11-21 10:30:33 -08:00
Mustafa Akin
1fc04d5570 Initial commit, working tests 2019-10-29 00:03:31 +03:00