I’m trying to send metrics to ApplicationInsights following this article. Instead of using a Feature, as exposed in the article, I want to simply enable metrics and add the ProbeCollector from my Endpoint configuration class, so what I’ve done is to create the ProbeCollector class and configure the endpoint as follows:
MetricsOptions metrics = _endpointConfiguration.EnableMetrics(); // register-probe var settings = _endpointConfiguration.GetSettings(); // Offending line string discriminator = settings.LogicalAddress().EndpointInstance.Discriminator; string endpoint = _endpointName; string queue = settings.LocalAddress(); string instanceId = settings.Get<string>("NServiceBus.HostInformation.HostId"); var collector = new ProbeCollector( endpoint, discriminator, instanceId, queue ); metrics.RegisterObservers(collector.RegisterProbes);
But when I do settings.LogicalAddress() I get the exception specified in the title of this topic.
What is the proper way of getting the discriminator? What is the discriminator anyway? as this is the only value that I don’t have in order to configure the ProbeCollector.
I’m using NServiceBus 6.4.3 with ASB 7.2.11