tomkerkhove / promitor

Bringing Azure Monitor metrics where you need them.
https://promitor.io
MIT License
249 stars 91 forks source link

Resource discovery is no longer optional #2104

Closed tomkerkhove closed 1 year ago

tomkerkhove commented 2 years ago

Report

Resource discovery is no longer optional after introducing optimized scraping through grouping.

Expected Behavior

Resource discovery is optional

Actual Behavior

Resource discovery is not required:

[09:16:27 FTL] Promitor Scraper Agent has encountered an unexpected error. Please open an issue at https://github.com/tomkerkhove/promitor/issues to let us know about it.
System.Exception: Resource Discovery is not configured
   at GuardNet.Guard.For[TException](Func`1 predicate, TException exception)
   at GuardNet.Guard.For[TException](Func`1 predicate, String message)
   at Promitor.Agents.Scraper.Discovery.ResourceDiscoveryClient..ctor(HttpClient httpClient, IOptionsMonitor`1 configuration, ILogger`1 logger) in /src/Promitor.Agents.Scraper/ResourceDiscoveryClient.cs:line 29
   at lambda_method27(Closure , IServiceProvider , Object[] )
   at Microsoft.Extensions.Http.DefaultTypedHttpClientFactory`1.CreateClient(HttpClient httpClient)
   at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.AddTransientHelper[TClient](IServiceProvider s, IHttpClientBuilder builder)
   at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__DisplayClass10_0`1.<AddTypedClientCore>b__0(IServiceProvider s)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.SchedulingExtensions.<>c__DisplayClass2_0.<ScheduleResourcesScraping>b__1(IServiceProvider jobServices) in /src/Promitor.Agents.Scraper/SchedulingExtensions.cs:line 96
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.SchedulerServiceCollectionExtensions.<>c__DisplayClass6_0.<CreateInstance>b__0(IServiceProvider sp) in C:\projects\cronscheduler-aspnetcore\src\CronScheduler.Extensions\DependencyInjection\SchedulerServiceCollectionExtensions.cs:line 119
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at Promitor.Agents.Scraper.Program.Main(String[] args) in /src/Promitor.Agents.Scraper/Program.cs:line 52

Steps to Reproduce the Problem

  1. Create configuration without resource discovery
  2. Deploy scraper

Component

Scraper

Version

2.7.0

Configuration

Configuration:

    version: v1
    azureMetadata:
      tenantId: tenant
      subscriptionId: sub
      resourceGroupName: promitor-testing-infrastructure-europe
      cloud: Global
    metricDefaults:
      aggregation:
        interval: 00:05:00
      scraping:
        schedule: "*/5 * * * *"
    metrics:
    - azureMetricConfiguration:
        aggregation:
          type: Average
        metricName: availabilityResults/availabilityPercentage
      description: Availabiliy of our documentation
      name: promitor_demo_documentation_availability
      resourceType: Generic
      resources:
      - filter: availabilityResult/name eq 'Documentation'
        resourceUri: microsoft.insights/components/promitor-testing-resource-eu-telemetry
    - azureMetricConfiguration:
        aggregation:
          type: Total
        metricName: RunsFailed
      description: Total amount of failed runs for Azure Logic Apps
      name: azure_logic_apps_failed_run
      resourceType: LogicApp
      resources:
      - workflowName: promitor-testing-resource-eu-workflow-eu-1
    - azureMetricConfiguration:
        aggregation:
          type: Average
        metricName: ActiveMessages
      description: Average percentage of memory usage on an Azure App Plan
      labels:
        app: promitor
        geo: europe
      name: promitor_demo_servicebus_messagecount_discovered
      resourceType: ServiceBusNamespace
      resources:
      - namespace: promitor-testing-resource-eu-messaging
    - azureMetricConfiguration:
        aggregation:
          type: Average
        limit: 5
        metricName: ActiveMessages
      description: Average percentage of memory usage on an Azure App Plan
      labels:
        app: promitor
        geo: europe
      name: promitor_demo_servicebus_messagecount_limited
      resourceType: ServiceBusNamespace
      resources:
      - namespace: promitor-testing-resource-eu-messaging
    - azureMetricConfiguration:
        aggregation:
          type: Total
        metricName: TotalJob
      description: Amount of jobs per Azure Automation account
      name: promitor_demo_automation_job_count
      resourceType: AutomationAccount
      resources:
      - accountName: promitor-testing-resource-eu-automation-1
    - azureMetricConfiguration:
        aggregation:
          type: Total
        metricName: TotalUpdateDeploymentRuns
      description: Amount of jobs per Azure Automation account
      name: promitor_demo_automation_update_deployment_runs
      resourceType: AutomationAccount
      resources:
      - accountName: promitor-testing-resource-eu-automation-1
    - azureMetricConfiguration:
        aggregation:
          type: Average
        metricName: availabilityResults/availabilityPercentage
      description: Availability (%) of promitor.io measured in Azure Application Insights
      name: promitor_demo_application_insights_availability
      resourceType: ApplicationInsights
      resources:
      - name: promitor-automation-data-generation-we-telemetry-classic
        resourceGroupName: promitor-automation-data-generation
      - name: promitor-automation-data-generation-we-telemetry
        resourceGroupName: promitor-automation-data-generation
  runtime.yaml: |-
    server:
      httpPort: "5000"
    authentication:
      mode: ServicePrincipal
      identityId: id
    metricSinks:
      prometheusScrapingEndpoint:
        metricUnavailableValue: "NaN"
        enableMetricTimestamps: "true"
        baseUriPath: "/metrics"
        labels:
          transformation: "None"
    metricsConfiguration:
      absolutePath: /config/metrics-declaration.yaml
    telemetry:
      applicationInsights:
        isEnabled: "false"
      containerLogs:
        isEnabled: "true"
      defaultVerbosity: "Error"

Runtime:

    server:
      httpPort: "5000"
    authentication:
      mode: ServicePrincipal
      identityId: id
    metricSinks:
      prometheusScrapingEndpoint:
        metricUnavailableValue: "NaN"
        enableMetricTimestamps: "true"
        baseUriPath: "/metrics"
        labels:
          transformation: "None"
    metricsConfiguration:
      absolutePath: /config/metrics-declaration.yaml
    telemetry:
      applicationInsights:
        isEnabled: "false"
      containerLogs:
        isEnabled: "true"
      defaultVerbosity: "Error"

Logs

██████╗ ██████╗  ██████╗ ███╗   ███╗██╗████████╗ ██████╗ ██████╗
██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██║╚══██╔══╝██╔═══██╗██╔══██╗
██████╔╝██████╔╝██║   ██║██╔████╔██║██║   ██║   ██║   ██║██████╔╝
██╔═══╝ ██╔══██╗██║   ██║██║╚██╔╝██║██║   ██║   ██║   ██║██╔══██╗
██║     ██║  ██║╚██████╔╝██║ ╚═╝ ██║██║   ██║   ╚██████╔╝██║  ██║
╚═╝     ╚═╝  ╚═╝ ╚═════╝ ╚═╝     ╚═╝╚═╝   ╚═╝    ╚═════╝ ╚═╝  ╚═╝
[09:16:26 INF] Booting up Promitor v2.7.0 running .NET .NET 6.0.6 - Thank you for using Promitor!
[09:16:26 INF] Running .NET 6.0.6 on Linux (alpine.3.14-x64 | Linux 5.4.0-1069-azure #72~18.04.1-Ubuntu SMP Mon Feb 7 11:12:24 UTC 2022).
[09:16:26 INF] Using configuration folder '/config/'
fail: Promitor.Agents.Scraper.Startup[0]
      Failure to create job name for scraping resources for list of metrics which includes availabilityResults/availabilityPercentage.
      System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
      en-US is an invalid culture identifier.
         at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
         at System.Globalization.CultureInfo..ctor(String name)
         at CronExpressionDescriptor.ExpressionParser..ctor(String expression, Options options)
         at CronExpressionDescriptor.ExpressionDescriptor.GetDescription(DescriptionTypeEnum type)
         at CronExpressionDescriptor.ExpressionDescriptor.GetDescription(String expression, Options options)
         at CronExpressionDescriptor.ExpressionDescriptor.GetDescription(String expression)
         at Microsoft.Extensions.DependencyInjection.SchedulingExtensions.GenerateResourceScrapingJobName(MetricsDeclaration metricsDeclaration, ILogger`1 logger) in /src/Promitor.Agents.Scraper/SchedulingExtensions.cs:line 133
[09:16:27 INF] Starting validation of Promitor setup
[09:16:27 INF] Scrape configuration found at '/config/metrics-declaration.yaml'
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                              │ Outcome │ Details                        ┃
┠───────────────────────────────────┼─────────┼────────────────────────────────┨
┃ Metrics Declaration Path          │ Success │ Everything is well-configured. ┃
┃ Azure Authentication              │ Success │ Everything is well-configured. ┃
┃ Metrics Declaration               │ Success │ Everything is well-configured. ┃
┃ Resource Discovery                │ Success │ Everything is well-configured. ┃
┃ StatsD Metric Sink                │ Success │ Everything is well-configured. ┃
┃ Prometheus Scraping Endpoint      │ Success │ Everything is well-configured. ┃
┃ Metric Sink                       │         │                                ┃
┃ Atlassian Statuspage Metric Sink  │ Success │ Everything is well-configured. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
                                   Validation
[09:16:27 INF] Promitor configuration is valid, we are good to go.
[09:16:27 INF] Here's an overview of what was configured:
╭───────────┬─────────────────┬───────────────────────────┬────────────────────╮
│ Tenant Id │ Subscription Id │ Resource Group Name       │ Azure Cloud        │
│           │                 │ (Default)                 │                    │
├───────────┼─────────────────┼───────────────────────────┼────────────────────┤
│ tenant    │ sub             │ promitor-testing-infrastr │ Azure Global Cloud │
│           │                 │ ucture-europe             │                    │
╰───────────┴─────────────────┴───────────────────────────┴────────────────────╯
                                 Azure Metadata
╭─────────────┬────────────┬────────────┬────────────┬────────────┬────────────╮
│ Metric Name │ Resource   │ Labels     │ Azure      │ Resources  │ Resource   │
│             │ Type       │            │ Monitor    │ To Scrape  │ Discovery  │
│             │            │            │ Metric     │            │ Groups To  │
│             │            │            │            │            │ Scrape     │
├─────────────┼────────────┼────────────┼────────────┼────────────┼────────────┤
│ promitor_de │ Generic    │ None       │ availabili │ microsoft. │ None       │
│ mo_document │            │            │ tyResults/ │ insights/c │            │
│ ation_avail │            │            │ availabili │ omponents/ │            │
│ ability     │            │            │ tyPercenta │ promitor-t │            │
│             │            │            │ ge         │ esting-res │            │
│             │            │            │            │ ource-eu-t │            │
│             │            │            │            │ elemetry   │            │
│ azure_logic │ Logic App  │ None       │ RunsFailed │ promitor-t │ None       │
│ _apps_faile │            │            │            │ esting-res │            │
│ d_run       │            │            │            │ ource-eu-w │            │
│             │            │            │            │ orkflow-eu │            │
│             │            │            │            │ -1         │            │
│ promitor_de │ Service    │ - app:     │ ActiveMess │ promitor-t │ None       │
│ mo_serviceb │ Bus        │ promitor   │ ages       │ esting-res │            │
│ us_messagec │ Namespace  │ - geo:     │            │ ource-eu-m │            │
│ ount_discov │            │ europe     │            │ essaging   │            │
│ ered        │            │            │            │            │            │
│ promitor_de │ Service    │ - app:     │ ActiveMess │ promitor-t │ None       │
│ mo_serviceb │ Bus        │ promitor   │ ages       │ esting-res │            │
│ us_messagec │ Namespace  │ - geo:     │            │ ource-eu-m │            │
│ ount_limite │            │ europe     │            │ essaging   │            │
│ d           │            │            │            │            │            │
│ promitor_de │ Automation │ None       │ TotalJob   │ promitor-t │ None       │
│ mo_automati │ Account    │            │            │ esting-res │            │
│ on_job_coun │            │            │            │ ource-eu-a │            │
│ t           │            │            │            │ utomation- │            │
│             │            │            │            │ 1          │            │
│ promitor_de │ Automation │ None       │ TotalUpdat │ promitor-t │ None       │
│ mo_automati │ Account    │            │ eDeploymen │ esting-res │            │
│ on_update_d │            │            │ tRuns      │ ource-eu-a │            │
│ eployment_r │            │            │            │ utomation- │            │
│ uns         │            │            │            │ 1          │            │
│ promitor_de │ Applicatio │ None       │ availabili │ promitor-a │ None       │
│ mo_applicat │ n Insights │            │ tyResults/ │ utomation- │            │
│ ion_insight │            │            │ availabili │ data-gener │            │
│ s_availabil │            │            │ tyPercenta │ ation-we-t │            │
│ ity         │            │            │ ge         │ elemetry-c │            │
│             │            │            │            │ lassic,    │            │
│             │            │            │            │ promitor-a │            │
│             │            │            │            │ utomation- │            │
│             │            │            │            │ data-gener │            │
│             │            │            │            │ ation-we-t │            │
│             │            │            │            │ elemetry   │            │
╰─────────────┴────────────┴────────────┴────────────┴────────────┴────────────╯
                               Configured Metrics
[09:16:27 FTL] Promitor Scraper Agent has encountered an unexpected error. Please open an issue at https://github.com/tomkerkhove/promitor/issues to let us know about it.
System.Exception: Resource Discovery is not configured
   at GuardNet.Guard.For[TException](Func`1 predicate, TException exception)
   at GuardNet.Guard.For[TException](Func`1 predicate, String message)
   at Promitor.Agents.Scraper.Discovery.ResourceDiscoveryClient..ctor(HttpClient httpClient, IOptionsMonitor`1 configuration, ILogger`1 logger) in /src/Promitor.Agents.Scraper/ResourceDiscoveryClient.cs:line 29
   at lambda_method27(Closure , IServiceProvider , Object[] )
   at Microsoft.Extensions.Http.DefaultTypedHttpClientFactory`1.CreateClient(HttpClient httpClient)
   at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.AddTransientHelper[TClient](IServiceProvider s, IHttpClientBuilder builder)
   at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__DisplayClass10_0`1.<AddTypedClientCore>b__0(IServiceProvider s)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.SchedulingExtensions.<>c__DisplayClass2_0.<ScheduleResourcesScraping>b__1(IServiceProvider jobServices) in /src/Promitor.Agents.Scraper/SchedulingExtensions.cs:line 96
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.SchedulerServiceCollectionExtensions.<>c__DisplayClass6_0.<CreateInstance>b__0(IServiceProvider sp) in C:\projects\cronscheduler-aspnetcore\src\CronScheduler.Extensions\DependencyInjection\SchedulerServiceCollectionExtensions.cs:line 119
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at Promitor.Agents.Scraper.Program.Main(String[] args) in /src/Promitor.Agents.Scraper/Program.cs:line 52

Platform

No response

Contact Details

No response

tomkerkhove commented 2 years ago

We should:

DanielSSilva commented 1 year ago

Hi! Not sure if I'm missing anything, but I've been trying to setup Promitor on an AKS cluster and I'm facing this exact same error. I've been reading the documentation and I was just following this walkthrough and faced the same error. I'm not sure if I should setup resource discovery, because I can't understand what's its purpose or if it's required.

Here's info regarding the helm chart I'm using:

NAME                    NAMESPACE   REVISION    UPDATED                                 STATUS      CHART                           APP VERSION
promitor-agent-scraper  default     1           2022-10-04 15:56:11.509024 +0100 WEST   deployed    promitor-agent-scraper-2.8.0    2.7.0
tomkerkhove commented 1 year ago

Normally you should not and it is fixed in 2.8.0 but need to close the release on this.

DanielSSilva commented 1 year ago

Alright. As I saw it being merged into master, I was wondering if it was already fixed and maybe there was something missing from the helm chart itself. Thanks for the clarification!

tomkerkhove commented 1 year ago

2.8.0 tag is actually already out so you could give it a try - https://github.com/tomkerkhove/promitor/pkgs/container/promitor-agent-scraper/44036724?tag=2.8.0

It's not announced yet given the Windows image is stuck in the release pipeline :(

DanielSSilva commented 1 year ago

Amazing, it seems to be working :) thank you for your help and quick replies :)

tomkerkhove commented 1 year ago

Good to hear and happy to help!

tomkerkhove commented 1 year ago

This is available in Scraper v2.8.0 - https://github.com/tomkerkhove/promitor/releases/tag/Scraper-v2.8.0