Closed SergeyKanzhelev closed 5 years ago
I'm looking at this right now.
When you mention "middleware" are you referring to MVC middleware? e.g.
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.UsePrometheus(new PrometheusMiddlewareOptions(){ Url = new Uri("/metrics") });
app.UseMvc();
}
}
I ask, as I have written a version of this, but I am getting compiler warnings that the classes needed to register as MVC middleware (HttpContext
, IApplicationBuilder
, etc.) are not Common Language Specification compliant. Is this a strict compliance rule for this set of libraries? Have I mis-understood the requirement, or should I make a separate DLL that does not have the [assembly: System.CLSCompliant(true)]
directive?
Thank you!
just remove this directive. I was trying to use it whenever it can be used as it simplifies some cross-.NET- language scenarios. But it is not strictly required.
Thank you for looking into it!
Moved to OpenTelemetry
In some environments opening separate port for Prometheus exporter will not work. Especially for sandboxed environments like Azure Web Apps. Re-using app's port and allow Prometheus to work as a middleware will help to enable those environments.