hyperf / metric

[READ ONLY]
MIT License
6 stars 10 forks source link

prometheus配置支持 https #3

Closed ushell closed 3 years ago

ushell commented 3 years ago

metrics配置中如果采用PUSH_MODE方式(prometheus pushgateway),PROMETHEUS_PUSH_HOST仅支持http方式

具体代码: https://github.com/hyperf/metric/blob/master/src/Adapter/Prometheus/MetricFactory.php#L161

建议代码:

if (! Str::contains($address, ['https://', 'http://']))
{
    $address = 'http://' . $address;
}
huangzhhui commented 3 years ago

可以提个 PR 过来优化一下

ushell commented 3 years ago

PR: #4

项目貌似readonly, 不能合并PR?

limingxinleo commented 3 years ago

代码提交到hyperf/hyperf仓库