Commit Graph
49 Commits
Author SHA1 Message Date
Mustafa Akin 077bb6654c Namespace support to work without cluster scope, fixes #42 2020-06-22 18:28:11 +03:00
Mustafa Akin fee89514e8 better default config to log to stdout, debug log added for involved object capturing 2020-06-22 18:17:18 +03:00
Mustafa Akin d262b1f7c7 Treat all 2xx succesful in webhook, fixes #57 2020-06-22 17:36:56 +03:00
Mustafa Akin c4a5dd0857 Merge branch 'master' of github.com:opsgenie/kubernetes-event-exporter into multiple-fixes-for-issues 2020-06-22 17:35:36 +03:00
Mustafa Akin 1a24caeeeb Log format support, fixes #52 2020-06-22 17:31:01 +03:00
Mustafa Akin 1ff1f121db Test for issue #51 2020-06-22 17:04:25 +03:00
Mustafa Akin 823662b2a9 Fixes #48, Elasticsearch is not taking layout although documented to do so 2020-06-22 16:55:17 +03:00
Mustafa AkınandGitHub ae8bfb579d Merge pull request #53 from jaydp17/webhook-return-err
return err in webhook sink
2020-06-22 16:44:54 +03:00
Mustafa AkınandGitHub 112e224047 Merge pull request #49 from lesh366/master
New ms teams support
2020-06-22 16:44:32 +03:00
Mustafa AkınandGitHub 9d8c746d1b Merge pull request #45 from youyongsong/patch/support-rotate-in-file-sink
Add file rolling function in file sink.
2020-06-22 16:44:01 +03:00
Jaydeep Solanki 18bdae4d23 return err in webhook sink 2020-06-01 16:40:09 +05:30
80f904e39f Update pkg/sinks/webhook.go
Co-authored-by: Heinz N. Gies <heinz@licenser.net>
2020-05-29 13:09:43 +02:00
Njegos Railic 8aae6e0d9a Handle HTTP Status code 201 in the webhook sink 2020-05-29 12:32:21 +02:00
lesh366andGitHub 62b1c4cae2 format alligment 2020-05-27 12:18:09 +03:00
elads bbdecb204e new microsoft teams support 2020-05-27 05:15:33 -04: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
Mustafa AkınandGitHub b3695e478d Merge pull request #37 from youyongsong/feature/support-leader-election
feature: support leader election
2020-05-02 01:25:27 +03:00
Mustafa AkınandGitHub 6eb781cfd6 Merge pull request #39 from ameyajoshi99/feature/annotations-filter
Feature/annotations filter
2020-05-02 01:24:59 +03:00
Brian Terry 8c0bc19a25 Add receiver 2020-04-22 13:39:42 -04:00
Brian Terry 16fb7846c3 Revert "Add Opscenter to receiver"
This reverts commit 5104e4c878.
2020-04-22 13:38:04 -04:00
Brian Terry 5104e4c878 Add Opscenter to receiver 2020-04-22 12:47:00 -04:00
Brian Terry f30e730a25 Add testing 2020-04-22 12:42:06 -04:00
Brian Terry d722fe1c67 Add testing 2020-04-21 15:14:17 -04:00
Brian Terry b87d2c392d Add testing 2020-04-21 15:14:10 -04:00
Brian Terry 6bcef23d1a Update Priority to int64 2020-04-21 10:40:21 -04:00
Brian Terry c9162036fb Add OpsCenter Sink 2020-04-21 10:29:11 -04:00
Ameya Joshi 122836c1d0 go fmt 2020-04-20 16:20:00 +05:30
Ameya Joshi 6108bad882 Adding Annotations in Rules 2020-04-20 16:13:52 +05:30
youyongsong 5dca26ee8c feature: support leader election
leader election function is disabled by default, and could be enabled by adding the
following section in `config.yaml`:

```yaml
leaderElection:
  enabled: true
  leaderElectionID: kubernetes-event-exporter  // this field can be omited, default value is kubernetes-event-exporter
```
2020-04-14 19:35:23 +08:00
Martin Heck 39498c9f54 Merge branch 'master' into elasticsearch-tls-config
# Conflicts:
#	pkg/sinks/elasticsearch.go
2020-04-10 18:12:55 +02:00
Mustafa AkınandGitHub 1526f77225 Merge branch 'master' into index-format 2020-04-10 16:06:30 +03:00
Dmitriy Kononov d3bb915de0 adding ssl verification mode option 2020-04-01 22:46:40 +06:00
Martin Heck 44a52da165 Add support for TLS configuration of elasticsearch sink 2020-03-26 12:23:54 +01:00
Mustafa AkınandGitHub 0f470b5af2 Merge pull request #20 from shikloshi/pubsub-sink
Adding gcloud pubsub sink
2020-02-07 13:34:58 +11:00
Mustafa Akin 8c7101d463 Fixed the inner field serialization bug, added test for array serialization 2020-02-07 11:54:59 +11:00
shikloshi 09627aed0b adding config to pubsub sink object 2020-02-03 09:54:10 +02:00
shikloshi 651a8a9b0b Updating documentation with pubsub 2020-02-03 09:51:41 +02:00
shikloshi ad043f7145 adding pubsub sink 2020-02-03 09:44:31 +02:00
Aaron Brodersen bbb985f8c9 Add indexFormat field for date formatted indices
Date formatted index names are a common pattern in Elastic setups. This
commit as a config field to specify a string pattern for index names.
The pattern is searched for sequenences inside {curly braces} and passes
any text found plus the current time through the Go time formatting function.
2020-01-24 11:38:38 -06:00
aseker 7defd7d073 layout list fix 2020-01-17 17:10:20 +03:00
aseker 208a261d93 Annotations added to involved object 2020-01-10 15:58:05 +03:00
Mustafa AkınandGitHub aca4ca6dd9 Merge pull request #11 from mdemierre/feature/close-sinks
engine: Implement clean closing of sinks
2019-12-22 20:33:50 +03:00
Marc Demierre 106e78ae0e engine: Implement clean closing of sinks
Before the change, the engine didn't call the `Close()` method of the
sinks. This is needed in some cases, i.e when a sink implementation is
buffered.

This change adds a `Close()` method to the registry that
will signal sinks to exit and wait for all sinks to exit before
returning. This is then used in the engine stop logic.

In the channel-based registry, the closing of all sinks is done in
parallel (using a `sync.WaitGroup`). In the sync registry, sinks are
closed sequentially.

Fixes issue #10
2019-12-15 21:56:37 +01: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 45cf57c7f9 Modified README and fixed minor bugs 2019-12-09 14:09:26 +03:00
Mustafa Akin b146fbb507 Added testing pipeline, deployment and configuration docs 2019-12-08 21:05:51 +03: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 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