BUG/MINOR: contrib/prometheus-exporter: Add HTX data block in one time

Since recent changes on the way HTX data blocks are added in an HTX message, we
must now be sure the prometheus service add its own blocks in one time. Indeed,
the function htx_add_data() may now decide to only copy a part of data. So
instead, we must call htx_add_data_atonce() instead.
This commit is contained in:
Christopher Faulet 2019-05-28 21:56:07 +02:00
parent a4f9dd4a56
commit 142b5df778

View File

@ -1409,7 +1409,7 @@ static int promex_dump_global_metrics(struct appctx *appctx, struct htx *htx)
}
end:
if (!htx_add_data(htx, out))
if (!htx_add_data_atonce(htx, out))
return -1; /* Unexpected and unrecoverable error */
channel_add_input(chn, out.len);
return ret;
@ -1587,7 +1587,7 @@ static int promex_dump_front_metrics(struct appctx *appctx, struct htx *htx)
}
end:
if (!htx_add_data(htx, out))
if (!htx_add_data_atonce(htx, out))
return -1; /* Unexpected and unrecoverable error */
channel_add_input(chn, out.len);
return ret;
@ -1805,7 +1805,7 @@ static int promex_dump_back_metrics(struct appctx *appctx, struct htx *htx)
}
end:
if (!htx_add_data(htx, out))
if (!htx_add_data_atonce(htx, out))
return -1; /* Unexpected and unrecoverable error */
channel_add_input(chn, out.len);
return ret;
@ -1999,7 +1999,7 @@ static int promex_dump_srv_metrics(struct appctx *appctx, struct htx *htx)
end:
if (!htx_add_data(htx, out))
if (!htx_add_data_atonce(htx, out))
return -1; /* Unexpected and unrecoverable error */
channel_add_input(chn, out.len);
return ret;