-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpListenerPrefixes other than localhost #2840
Comments
Hi @GuglielmoFrigerio, |
Guys, I think I have exactly the same problem. I'm using This works fine: options.HttpListenerPrefixes = new string[] {
"http://localhost:9184"
}; and below ones does not: options.HttpListenerPrefixes = new string[] {
"http://*:9184", "http://+:9185"
};
options.HttpListenerPrefixes = new string[] {
"http://{host-ip}:9184"
}; I'm trying to expose Thanks. |
Hi @Yun-Ting this is how I configure Prometheus in the Startup.cs:
This is the app settings:
|
Hi, I stumbled over the same bug, which makes exposing the metrics interface on all interfaces impossible. After taking a look at the source code, I came up with the following workaround until the bug is fixed, by setting the private backing field directly using reflection, thereby sidestepping the buggy validation: ...
.AddPrometheusExporter(options =>
{
options.StartHttpListener = true;
options.GetType()
?.GetField("httpListenerPrefixes", BindingFlags.NonPublic | BindingFlags.Instance)
?.SetValue(options, new[] { "http://*:9464" });
}); Take care, |
Does anyone tried to configure the exporter to publish on every network interface the host provide?
I've tried the following prefixes
Nothing seems to work.
I've tried under Windows 11 & DotNet 6.
I wanted to test a scenario where the Prometheus server is remote respect to the application.
The text was updated successfully, but these errors were encountered: