|
@@ -5,16 +5,19 @@ namespace OhmGraphite
|
|
|
public int Port { get; }
|
|
|
public string Host { get; }
|
|
|
public bool UseHttps { get; }
|
|
|
+ public string Path { get; }
|
|
|
|
|
|
- public PrometheusConfig(int port, string host, bool useHttps)
|
|
|
+ public PrometheusConfig(int port, string host, bool useHttps, string path)
|
|
|
{
|
|
|
Port = port;
|
|
|
Host = host;
|
|
|
UseHttps = useHttps;
|
|
|
+ Path = path;
|
|
|
}
|
|
|
|
|
|
internal static PrometheusConfig ParseAppSettings(IAppConfig config)
|
|
|
{
|
|
|
+ string path = config["prometheus_path"] ?? "metrics/";
|
|
|
string host = config["prometheus_host"] ?? "*";
|
|
|
if (!bool.TryParse(config["prometheus_https"], out bool useHttps))
|
|
|
{
|
|
@@ -25,7 +28,7 @@ namespace OhmGraphite
|
|
|
port = 4445;
|
|
|
}
|
|
|
|
|
|
- return new PrometheusConfig(port, host, useHttps);
|
|
|
+ return new PrometheusConfig(port, host, useHttps, path);
|
|
|
}
|
|
|
}
|
|
|
}
|