Skip to content

Commit 0a2c653

Browse files
committed
Merge branch 'master' of github.com:Leanplum/fluent-bit into stackdriver-trace-support
2 parents 3912b90 + 73df60c commit 0a2c653

File tree

19 files changed

+1092
-43
lines changed

19 files changed

+1092
-43
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ option(FLB_OUT_LIB "Enable library mode output plugin" Yes)
172172
option(FLB_OUT_NULL "Enable dev null output plugin" Yes)
173173
option(FLB_OUT_FLOWCOUNTER "Enable flowcount output plugin" Yes)
174174
option(FLB_OUT_LOGDNA "Enable LogDNA output plugin" Yes)
175+
option(FLB_OUT_LOKI "Enable Loki output plugin" Yes)
175176
option(FLB_OUT_KAFKA "Enable Kafka output plugin" No)
176177
option(FLB_OUT_KAFKA_REST "Enable Kafka Rest output plugin" Yes)
177178
option(FLB_OUT_CLOUDWATCH_LOGS "Enable AWS CloudWatch output plugin" Yes)

include/fluent-bit/flb_output.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@
4949
#endif
5050

5151
/* Output plugin masks */
52-
#define FLB_OUTPUT_NET 32 /* output address may set host and port */
53-
#define FLB_OUTPUT_PLUGIN_CORE 0
54-
#define FLB_OUTPUT_PLUGIN_PROXY 1
52+
#define FLB_OUTPUT_NET 32 /* output address may set host and port */
53+
#define FLB_OUTPUT_PLUGIN_CORE 0
54+
#define FLB_OUTPUT_PLUGIN_PROXY 1
55+
#define FLB_OUTPUT_NO_MULTIPLEX 512
5556

5657
/*
5758
* Tests callbacks
@@ -319,7 +320,9 @@ struct flb_output_thread {
319320
struct flb_config *config; /* FLB context */
320321
struct flb_output_instance *o_ins; /* output instance */
321322
struct flb_thread *parent; /* parent thread addr */
322-
struct mk_list _head; /* Link to struct flb_task->threads */
323+
struct mk_list _head_output; /* Link to flb_output_instance->th_queue */
324+
struct mk_list _head; /* Link to flb_task->threads */
325+
323326
};
324327

325328
static FLB_INLINE
@@ -348,6 +351,7 @@ static FLB_INLINE int flb_output_thread_destroy_id(int id, struct flb_task *task
348351
return -1;
349352
}
350353

354+
mk_list_del(&out_th->_head_output);
351355
mk_list_del(&out_th->_head);
352356
thread = out_th->parent;
353357

@@ -367,6 +371,7 @@ static FLB_INLINE void cb_output_thread_destroy(void *data)
367371
flb_debug("[out thread] cb_destroy thread_id=%i", out_th->id);
368372

369373
out_th->task->users--;
374+
mk_list_del(&out_th->_head_output);
370375
mk_list_del(&out_th->_head);
371376
}
372377

@@ -511,6 +516,8 @@ struct flb_thread *flb_output_thread(struct flb_task *task,
511516
((char *)th->callee) + stack_size);
512517
#endif
513518

519+
mk_list_add(&out_th->_head_output, &o_ins->th_queue);
520+
514521
/* Workaround for makecontext() */
515522
output_params_set(th,
516523
buf,

plugins/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ REGISTER_OUT_PLUGIN("out_forward")
178178
REGISTER_OUT_PLUGIN("out_http")
179179
REGISTER_OUT_PLUGIN("out_influxdb")
180180
REGISTER_OUT_PLUGIN("out_logdna")
181+
REGISTER_OUT_PLUGIN("out_loki")
181182
REGISTER_OUT_PLUGIN("out_kafka")
182183
REGISTER_OUT_PLUGIN("out_kafka_rest")
183184
REGISTER_OUT_PLUGIN("out_nats")

plugins/out_loki/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set(src
2+
loki.c
3+
)
4+
5+
FLB_PLUGIN(out_loki "${src}" "")

0 commit comments

Comments
 (0)