Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugins/in_prometheus_scrape/prom_scrape.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ static struct prom_scrape *prom_scrape_create(struct flb_input_instance *ins,
flb_free(ctx);
return NULL;
}

if (flb_input_upstream_set(upstream, ins) != 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Set the keepalive stream flag when applying net settings

When prometheus_scrape uses the default or explicit net.keepalive On, this call copies ins->net_setup.keepalive but leaves the upstream flags as the FLB_IO_TCP value created above. create_conn() initializes conn->recycle from flb_stream_is_keepalive(&u->base), so the connection is still destroyed on release and the new net.keepalive support remains ineffective; the input path needs the same keepalive flag update that output upstream setup performs before the upstream is used.

Useful? React with 👍 / 👎.

flb_plg_error(ins, "network upstream setup failed");
flb_upstream_destroy(upstream);
flb_free(ctx);
return NULL;
}
ctx->upstream = upstream;

return ctx;
Expand Down
Loading