proxy.useCustomHeaders Causing High CPU Load

Hi,
We are Using Grafana 6.1.6 and are seeing high CPU Load because of the use of this function located line 168 in pkg/api/pluginproxy/ds_proxy.go

This is what the flamegraph for our instance of Grafana looks like :

We have over 150 Elasticsearch datasources all using Basic auth, TLS client cert and CA in Server Access mode.
We found that by merely commenting out that line of code, Grafana Performance was improved drastically and system load was much lighter as encryption was delegated to the system instead of being processed in go (or so it seems).

This has not had any impact on our end users as far as we can tell and everything is still working as expected in our use case.

I did not think it wise to open a GitHub issue at this time as I am very unsure as to what this line of code does, and why it’s impacting us so much, because as far as I can tell we are not asking Grafana to add any custom headers. I need to take a closer look at our config file to make sure that is the case but I wanted to open this thread here to see if anyone had any pointers.

Thank you for your help.
Possibly related thread ?

We upgraded Grafana to V6.3.6 and can confirm the same behavior.

I will rebuild the RPM without proxy.useCustomHeaders(req) to see if I can still bring CPU usage down this way.