Skip to content
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

System.Net.Sockets.SocketException when fetching metrics #450

Open
Wagnard opened this issue Nov 20, 2023 · 0 comments
Open

System.Net.Sockets.SocketException when fetching metrics #450

Wagnard opened this issue Nov 20, 2023 · 0 comments

Comments

@Wagnard
Copy link

Wagnard commented Nov 20, 2023

.NET 8 (happen also on .NET 7)
app (Console) is under a container on Linux. (self contained)
Default metrics
started this way:

using var server = new MetricServer(port: 1234);
server.Start();

When the metrics are fetched, ex: " 192.168.1.240:1234/metrics " they work but they generate in the application :
Exception thrown: 'System.Net.Sockets.SocketException' in System.Net.Sockets.dll
Exception thrown: 'System.Net.Sockets.SocketException' in System.Private.CoreLib.dll

This happen 15 seconds after a metric fetch. So you need to fetch at an interval higher than 15secs to repro.

When using .NET 7 there was this workaround:

using var server = new KestrelMetricServer(port: 1234);
server.Start();

But in .NET 8 this workaround generate theses errors :

Exception thrown: 'System.ArgumentException' in Prometheus.NetStandard.dll
http.server.active_requests collection failed: The list of label values must have the same number of elements as the list of label names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant