From: Florian Forster Date: Sat, 16 Dec 2023 19:59:39 +0000 (+0100) Subject: write_open_telemetry plugin: Configure the flush callback to be called periodically. X-Git-Tag: 6.0.0-rc0~17^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4af137d8dbab135891749b1c8930e7e3b81a07cc;p=thirdparty%2Fcollectd.git write_open_telemetry plugin: Configure the flush callback to be called periodically. --- diff --git a/src/write_open_telemetry.cc b/src/write_open_telemetry.cc index 916f2c66f..a2bcbc2af 100644 --- a/src/write_open_telemetry.cc +++ b/src/write_open_telemetry.cc @@ -234,6 +234,11 @@ static int ot_config_node(oconfig_item_t *ci) { .free_func = ot_callback_decref, }; + /* Call ot_flush periodically. */ + plugin_ctx_t ctx = plugin_get_ctx(); + ctx.flush_interval = plugin_get_interval(); + plugin_set_ctx(ctx); + cb->reference_count++; plugin_register_write(callback_name.ptr, ot_write, &user_data);