Skip to content

Commit

Permalink
Adding default TLS to dcgmscraper (amazon-contributing#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
okankoAMZ authored Mar 1, 2024
1 parent 622200a commit 9cb314e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions receiver/awscontainerinsightreceiver/internal/gpu/dcgmscraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"time"

configutil "github.com/prometheus/common/config"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/discovery"
Expand All @@ -25,7 +26,7 @@ import (
)

const (
caFile = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
caFile = "/etc/amazon-cloudwatch-observability-agent-cert/tls-ca.crt"
collectionInterval = 60 * time.Second
jobName = "containerInsightsDCGMExporterScraper"
scraperMetricsPath = "/metrics"
Expand Down Expand Up @@ -103,10 +104,16 @@ func NewDcgmScraper(opts DcgmScraperOpts) (*DcgmScraper, error) {

func getScraperConfig(hostInfoProvider hostInfoProvider) *config.ScrapeConfig {
return &config.ScrapeConfig{
HTTPClientConfig: configutil.HTTPClientConfig{
TLSConfig: configutil.TLSConfig{
CAFile: caFile,
InsecureSkipVerify: false,
},
},
ScrapeInterval: model.Duration(collectionInterval),
ScrapeTimeout: model.Duration(collectionInterval),
JobName: jobName,
Scheme: "http",
Scheme: "https",
MetricsPath: scraperMetricsPath,
ServiceDiscoveryConfigs: discovery.Configs{
&kubernetes.SDConfig{
Expand Down

0 comments on commit 9cb314e

Please sign in to comment.