Skip to content

Commit 2211c6d

Browse files
committed
output: enable plugin registration with event type.
This commit relies on changes being accepted in the fluent-bit repository. The goal is to enable event-type registration for go proxy plugins. This change introduces a new function that will allow event-type setting in registration. This is done in order to not introduce breaking changes to current plugins. This new function can be used instead of the default FLBPluginRegisterFunction to set the event_type to a different value (metrics (2)). Signed-off-by: jmccormick7 <[email protected]> Signed-off-by: jmccormick7 <[email protected]>
1 parent a7a013e commit 2211c6d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

output/flb_plugin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct flb_plugin_proxy_def {
3838
int flags;
3939
char *name;
4040
char *description;
41+
int event_type;
4142
};
4243

4344
#endif

output/output.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ func FLBPluginRegister(def unsafe.Pointer, name, desc string) int {
5353
p.flags = 0
5454
p.name = C.CString(name)
5555
p.description = C.CString(desc)
56+
p.event_type = 0
57+
return 0
58+
}
59+
60+
func FLBPluginRegisterWithEventType(def unsafe.Pointer, eventType int, name, desc string) int {
61+
p := (*FLBPluginProxyDef)(def)
62+
p._type = FLB_PROXY_OUTPUT_PLUGIN
63+
p.proxy = FLB_PROXY_GOLANG
64+
p.flags = 0
65+
p.name = C.CString(name)
66+
p.description = C.CString(desc)
67+
p.event_type = C.int(eventType)
5668
return 0
5769
}
5870

0 commit comments

Comments
 (0)