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

Could not load type 'Prometheus.Advanced.Collector` after update to Prometheus-net 3 #10

Open
musukvl opened this issue Feb 7, 2019 · 1 comment

Comments

@musukvl
Copy link

musukvl commented Feb 7, 2019

public static void Main(string[] args)
{
        DiagnosticListener.AllListeners
                .SubscribeDiagnosticListener(o =>
                {
                    o.AddAspNetCoreObserver();
                    o.AddHttpHandlerObserver();
                });

fails with

System.TypeLoadException
  HResult=0x80131522
  Message=Could not load type 'Prometheus.Advanced.Collector`1' from assembly 'Prometheus.NetStandard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a243e9817ba9d559'.
  Source=Bluekiri.Diagnostics.Prometheus
  StackTrace:
   at Bluekiri.Diagnostics.Prometheus.HttpHandlerDiagnosticListenerObserver..ctor(HttpHandlerObserverConfig config, Collector`1 counter, Collector`1 summary)
   at Bluekiri.Diagnostics.Prometheus.SubscribeOptionsExtensions.AddHttpHandlerObserver(SubscribeOptions o, Action`1 configure)
   at Application.WebApi.Program.<>c.<Main>b__0_0(SubscribeOptions o) in \Program.cs:line 16
@xordi
Copy link
Contributor

xordi commented Mar 4, 2019

Hi @musukvl,

Sorry for the delay answering this. Currently the library will require some refactorings to be used with prometheus-net 3.X. There are breaking changes that will force us to rethink some code. We are also pending of this issue prometheus-net/prometheus-net#136 in order to be able to code the unit tests properly.

If in your use case you only require ASP.NET Core metrics, I would recommend you to directly use prometheus-net 3.X with the metrics middleware.

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

2 participants