From e13d3721f1593ba460fbe7508ac3f567425869b6 Mon Sep 17 00:00:00 2001 From: Hyunsoo Kim Date: Fri, 3 May 2024 12:59:41 -0400 Subject: [PATCH] adding scrape protocol and ID for pr0metheus receiver --- .../internal/gpu/dcgmscraper_config.go | 11 ++++++----- .../prometheusscraper/simple_prometheus_scraper.go | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/receiver/awscontainerinsightreceiver/internal/gpu/dcgmscraper_config.go b/receiver/awscontainerinsightreceiver/internal/gpu/dcgmscraper_config.go index 4d11945d0db3..40e74fcfce7d 100644 --- a/receiver/awscontainerinsightreceiver/internal/gpu/dcgmscraper_config.go +++ b/receiver/awscontainerinsightreceiver/internal/gpu/dcgmscraper_config.go @@ -38,11 +38,12 @@ func GetScraperConfig(hostInfoProvider hostInfoProvider) *config.ScrapeConfig { InsecureSkipVerify: false, }, }, - ScrapeInterval: model.Duration(collectionInterval), - ScrapeTimeout: model.Duration(collectionInterval), - JobName: jobName, - Scheme: "https", - MetricsPath: scraperMetricsPath, + ScrapeInterval: model.Duration(collectionInterval), + ScrapeTimeout: model.Duration(collectionInterval), + ScrapeProtocols: config.DefaultScrapeProtocols, + JobName: jobName, + Scheme: "https", + MetricsPath: scraperMetricsPath, ServiceDiscoveryConfigs: discovery.Configs{ &kubernetes.SDConfig{ Role: kubernetes.RoleService, diff --git a/receiver/awscontainerinsightreceiver/internal/prometheusscraper/simple_prometheus_scraper.go b/receiver/awscontainerinsightreceiver/internal/prometheusscraper/simple_prometheus_scraper.go index 2f7be0071adf..ff33bb219d59 100644 --- a/receiver/awscontainerinsightreceiver/internal/prometheusscraper/simple_prometheus_scraper.go +++ b/receiver/awscontainerinsightreceiver/internal/prometheusscraper/simple_prometheus_scraper.go @@ -61,6 +61,7 @@ func NewSimplePrometheusScraper(opts SimplePrometheusScraperOpts) (*SimplePromet } params := receiver.CreateSettings{ + ID: component.MustNewID(opts.ScraperConfigs.JobName), TelemetrySettings: opts.TelemetrySettings, }