Skip to content

Commit adb69b5

Browse files
committed
add event_to_action && prometheus output
1 parent 7225fbc commit adb69b5

18 files changed

Lines changed: 1921 additions & 86 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ TBD: throughput on production servers.
4444

4545
**Input**: [dmesg](plugin/input/dmesg/README.md), [fake](plugin/input/fake/README.md), [file](plugin/input/file/README.md), [http](plugin/input/http/README.md), [journalctl](plugin/input/journalctl/README.md), [k8s](plugin/input/k8s/README.md), [kafka](plugin/input/kafka/README.md), [socket](plugin/input/socket/README.md)
4646

47-
**Action**: [add_file_name](plugin/action/add_file_name/README.md), [add_host](plugin/action/add_host/README.md), [cardinality](plugin/action/cardinality/README.md), [convert_date](plugin/action/convert_date/README.md), [convert_log_level](plugin/action/convert_log_level/README.md), [convert_utf8_bytes](plugin/action/convert_utf8_bytes/README.md), [debug](plugin/action/debug/README.md), [decode](plugin/action/decode/README.md), [discard](plugin/action/discard/README.md), [flatten](plugin/action/flatten/README.md), [hash](plugin/action/hash/README.md), [join](plugin/action/join/README.md), [join_template](plugin/action/join_template/README.md), [json_decode](plugin/action/json_decode/README.md), [json_encode](plugin/action/json_encode/README.md), [json_extract](plugin/action/json_extract/README.md), [keep_fields](plugin/action/keep_fields/README.md), [mask](plugin/action/mask/README.md), [modify](plugin/action/modify/README.md), [move](plugin/action/move/README.md), [parse_es](plugin/action/parse_es/README.md), [parse_re2](plugin/action/parse_re2/README.md), [remove_fields](plugin/action/remove_fields/README.md), [rename](plugin/action/rename/README.md), [set_time](plugin/action/set_time/README.md), [split](plugin/action/split/README.md), [throttle](plugin/action/throttle/README.md)
47+
**Action**: [add_file_name](plugin/action/add_file_name/README.md), [add_host](plugin/action/add_host/README.md), [cardinality](plugin/action/cardinality/README.md), [convert_date](plugin/action/convert_date/README.md), [convert_log_level](plugin/action/convert_log_level/README.md), [convert_utf8_bytes](plugin/action/convert_utf8_bytes/README.md), [debug](plugin/action/debug/README.md), [decode](plugin/action/decode/README.md), [discard](plugin/action/discard/README.md), [event_to_metrics](plugin/action/event_to_metrics/README.md), [flatten](plugin/action/flatten/README.md), [hash](plugin/action/hash/README.md), [join](plugin/action/join/README.md), [join_template](plugin/action/join_template/README.md), [json_decode](plugin/action/json_decode/README.md), [json_encode](plugin/action/json_encode/README.md), [json_extract](plugin/action/json_extract/README.md), [keep_fields](plugin/action/keep_fields/README.md), [mask](plugin/action/mask/README.md), [modify](plugin/action/modify/README.md), [move](plugin/action/move/README.md), [parse_es](plugin/action/parse_es/README.md), [parse_re2](plugin/action/parse_re2/README.md), [remove_fields](plugin/action/remove_fields/README.md), [rename](plugin/action/rename/README.md), [set_time](plugin/action/set_time/README.md), [split](plugin/action/split/README.md), [throttle](plugin/action/throttle/README.md)
4848

49-
**Output**: [clickhouse](plugin/output/clickhouse/README.md), [devnull](plugin/output/devnull/README.md), [elasticsearch](plugin/output/elasticsearch/README.md), [file](plugin/output/file/README.md), [gelf](plugin/output/gelf/README.md), [http](plugin/output/http/README.md), [kafka](plugin/output/kafka/README.md), [loki](plugin/output/loki/README.md), [postgres](plugin/output/postgres/README.md), [s3](plugin/output/s3/README.md), [splunk](plugin/output/splunk/README.md), [stdout](plugin/output/stdout/README.md)
49+
**Output**: [clickhouse](plugin/output/clickhouse/README.md), [devnull](plugin/output/devnull/README.md), [elasticsearch](plugin/output/elasticsearch/README.md), [file](plugin/output/file/README.md), [gelf](plugin/output/gelf/README.md), [http](plugin/output/http/README.md), [kafka](plugin/output/kafka/README.md), [loki](plugin/output/loki/README.md), [postgres](plugin/output/postgres/README.md), [prometheus](plugin/output/prometheus/README.md), [s3](plugin/output/s3/README.md), [splunk](plugin/output/splunk/README.md), [stdout](plugin/output/stdout/README.md)
5050

5151
## Logging system
5252

_sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- [debug](plugin/action/debug/README.md)
3333
- [decode](plugin/action/decode/README.md)
3434
- [discard](plugin/action/discard/README.md)
35+
- [event_to_metrics](plugin/action/event_to_metrics/README.md)
3536
- [flatten](plugin/action/flatten/README.md)
3637
- [hash](plugin/action/hash/README.md)
3738
- [join](plugin/action/join/README.md)
@@ -61,6 +62,7 @@
6162
- [kafka](plugin/output/kafka/README.md)
6263
- [loki](plugin/output/loki/README.md)
6364
- [postgres](plugin/output/postgres/README.md)
65+
- [prometheus](plugin/output/prometheus/README.md)
6466
- [s3](plugin/output/s3/README.md)
6567
- [splunk](plugin/output/splunk/README.md)
6668
- [stdout](plugin/output/stdout/README.md)

cmd/file.d/file.d.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
_ "github.com/ozontech/file.d/plugin/action/debug"
2727
_ "github.com/ozontech/file.d/plugin/action/decode"
2828
_ "github.com/ozontech/file.d/plugin/action/discard"
29+
_ "github.com/ozontech/file.d/plugin/action/event_to_metrics"
2930
_ "github.com/ozontech/file.d/plugin/action/flatten"
3031
_ "github.com/ozontech/file.d/plugin/action/hash"
3132
_ "github.com/ozontech/file.d/plugin/action/join"
@@ -61,6 +62,7 @@ import (
6162
_ "github.com/ozontech/file.d/plugin/output/kafka"
6263
_ "github.com/ozontech/file.d/plugin/output/loki"
6364
_ "github.com/ozontech/file.d/plugin/output/postgres"
65+
_ "github.com/ozontech/file.d/plugin/output/prometheus"
6466
_ "github.com/ozontech/file.d/plugin/output/s3"
6567
_ "github.com/ozontech/file.d/plugin/output/splunk"
6668
_ "github.com/ozontech/file.d/plugin/output/stdout"

go.mod

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ toolchain go1.25.5
66

77
require (
88
github.com/ClickHouse/ch-go v0.65.1
9-
github.com/KimMachineGun/automemlimit v0.2.6
9+
github.com/KimMachineGun/automemlimit v0.7.1
1010
github.com/Masterminds/squirrel v1.5.4
1111
github.com/alecthomas/kingpin v2.2.6+incompatible
12-
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137
12+
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b
1313
github.com/alicebob/miniredis/v2 v2.35.0
1414
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310
1515
github.com/bitly/go-simplejson v0.5.1
1616
github.com/bmatcuk/doublestar/v4 v4.8.1
1717
github.com/bufbuild/protocompile v0.13.0
18+
github.com/castai/promwrite v0.6.0
1819
github.com/cenkalti/backoff/v4 v4.3.0
1920
github.com/cespare/xxhash/v2 v2.3.0
2021
github.com/dominikbraun/graph v0.23.0
@@ -32,10 +33,10 @@ require (
3233
github.com/minio/minio-go v6.0.14+incompatible
3334
github.com/ozontech/insane-json v0.1.9
3435
github.com/pierrec/lz4/v4 v4.1.22
35-
github.com/prometheus/client_golang v1.16.0
36-
github.com/prometheus/client_model v0.3.0
37-
github.com/prometheus/common v0.42.0
38-
github.com/prometheus/procfs v0.10.1
36+
github.com/prometheus/client_golang v1.22.0
37+
github.com/prometheus/client_model v0.6.2
38+
github.com/prometheus/common v0.63.0
39+
github.com/prometheus/procfs v0.15.1
3940
github.com/redis/go-redis/v9 v9.8.0
4041
github.com/rjeczalik/notify v0.9.3
4142
github.com/satori/go.uuid v1.2.0
@@ -49,10 +50,10 @@ require (
4950
github.com/valyala/fasthttp v1.48.0
5051
github.com/xdg-go/scram v1.1.2
5152
go.uber.org/atomic v1.11.0
52-
go.uber.org/automaxprocs v1.5.3
53+
go.uber.org/automaxprocs v1.6.0
5354
go.uber.org/zap v1.27.0
5455
golang.org/x/net v0.47.0
55-
google.golang.org/protobuf v1.36.5
56+
google.golang.org/protobuf v1.36.6
5657
gopkg.in/yaml.v2 v2.4.0
5758
gopkg.in/yaml.v3 v3.0.1
5859
k8s.io/api v0.34.2
@@ -65,13 +66,9 @@ require (
6566
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
6667
github.com/andybalholm/brotli v1.0.5 // indirect
6768
github.com/beorn7/perks v1.0.1 // indirect
68-
github.com/cilium/ebpf v0.9.1 // indirect
69-
github.com/containerd/cgroups/v3 v3.0.1 // indirect
70-
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
7169
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
7270
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
7371
github.com/dmarkham/enumer v1.5.10 // indirect
74-
github.com/docker/go-units v0.4.0 // indirect
7572
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
7673
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
7774
github.com/go-faster/city v1.0.1 // indirect
@@ -81,13 +78,13 @@ require (
8178
github.com/go-logr/logr v1.4.2 // indirect
8279
github.com/go-logr/stdr v1.2.2 // indirect
8380
github.com/go-openapi/jsonpointer v0.21.0 // indirect
84-
github.com/go-openapi/jsonreference v0.20.2 // indirect
81+
github.com/go-openapi/jsonreference v0.21.0 // indirect
8582
github.com/go-openapi/swag v0.23.0 // indirect
86-
github.com/godbus/dbus/v5 v5.0.4 // indirect
8783
github.com/gogo/protobuf v1.3.2 // indirect
88-
github.com/golang/protobuf v1.5.4 // indirect
84+
github.com/golang/snappy v1.0.0 // indirect
8985
github.com/google/gnostic-models v0.7.0 // indirect
9086
github.com/google/go-cmp v0.7.0 // indirect
87+
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
9188
github.com/hashicorp/errwrap v1.1.0 // indirect
9289
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
9390
github.com/hashicorp/go-multierror v1.1.1 // indirect
@@ -107,23 +104,23 @@ require (
107104
github.com/jackc/puddle/v2 v2.2.2 // indirect
108105
github.com/josharian/intern v1.0.0 // indirect
109106
github.com/json-iterator/go v1.1.12 // indirect
107+
github.com/kylelemons/godebug v1.1.0 // indirect
110108
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
111109
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
112110
github.com/lib/pq v1.10.4 // indirect
113111
github.com/mailru/easyjson v0.7.7 // indirect
114-
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
115112
github.com/mitchellh/go-homedir v1.1.0 // indirect
116113
github.com/mitchellh/mapstructure v1.5.0 // indirect
117114
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
118115
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
119116
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
120-
github.com/opencontainers/runtime-spec v1.0.2 // indirect
121117
github.com/pascaldekloe/name v1.0.1 // indirect
118+
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
122119
github.com/pkg/errors v0.9.1 // indirect
123120
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
121+
github.com/prometheus/prometheus v0.304.1 // indirect
124122
github.com/ryanuber/go-glob v1.0.0 // indirect
125123
github.com/segmentio/asm v1.2.0 // indirect
126-
github.com/sirupsen/logrus v1.8.1 // indirect
127124
github.com/smartystreets/goconvey v1.6.4 // indirect
128125
github.com/spf13/pflag v1.0.6 // indirect
129126
github.com/tidwall/match v1.1.1 // indirect
@@ -136,15 +133,15 @@ require (
136133
github.com/xdg-go/stringprep v1.0.4 // indirect
137134
github.com/yuin/gopher-lua v1.1.1 // indirect
138135
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
139-
go.opentelemetry.io/otel v1.34.0 // indirect
140-
go.opentelemetry.io/otel/metric v1.34.0 // indirect
141-
go.opentelemetry.io/otel/trace v1.34.0 // indirect
136+
go.opentelemetry.io/otel v1.35.0 // indirect
137+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
138+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
142139
go.uber.org/multierr v1.11.0 // indirect
143140
go.yaml.in/yaml/v2 v2.4.2 // indirect
144141
go.yaml.in/yaml/v3 v3.0.4 // indirect
145142
golang.org/x/crypto v0.45.0 // indirect
146143
golang.org/x/mod v0.29.0 // indirect
147-
golang.org/x/oauth2 v0.27.0 // indirect
144+
golang.org/x/oauth2 v0.29.0 // indirect
148145
golang.org/x/sync v0.18.0 // indirect
149146
golang.org/x/sys v0.38.0 // indirect
150147
golang.org/x/term v0.37.0 // indirect
@@ -153,7 +150,6 @@ require (
153150
golang.org/x/tools v0.38.0 // indirect
154151
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
155152
gopkg.in/inf.v0 v0.9.1 // indirect
156-
gopkg.in/ini.v1 v1.62.0 // indirect
157153
k8s.io/klog/v2 v2.130.1 // indirect
158154
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
159155
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect

0 commit comments

Comments
 (0)