in_prometheus_scrape: enable scraping of TLS endpoints.
@@ -29,6 +29,7 @@ static struct prom_scrape *prom_scrape_create(struct flb_input_instance *ins,
struct flb_config *config)
{
int ret;
+ int upstream_flags;
struct prom_scrape *ctx;
struct flb_upstream *upstream;
@@ -53,8 +54,15 @@ static struct prom_scrape *prom_scrape_create(struct flb_input_instance *ins,
return NULL;
}
+ upstream_flags = FLB_IO_TCP;
+
+ if (ins->use_tls) {
+ upstream_flags |= FLB_IO_TLS;
+ }
+
upstream = flb_upstream_create(config, ins->host.name, ins->host.port,
- FLB_IO_TCP, NULL);
+ upstream_flags, ins->tls);
+
if (!upstream) {
flb_plg_error(ins, "upstream initialization error");
return NULL;
