Skip to content

Commit

Permalink
Fix bug: add scrape interval for 2 targets (#533)
Browse files Browse the repository at this point in the history
* Fix bug: add scrape interval for 2 targets

* remove branch
  • Loading branch information
Sohamdg081992 authored Jul 10, 2023
1 parent e725418 commit 05bec02
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
9 changes: 4 additions & 5 deletions .pipelines/azure-pipeline-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ trigger:
branches:
include:
- main

pr:
autoCancel: true
branches:
Expand Down Expand Up @@ -104,7 +103,7 @@ jobs:
- task: CredScan@3
displayName: "SDL : Run credscan"

- task: CopyFiles@2
displayName: "Ev2: copy Ev2 deployment artifacts to staging directory"
inputs:
Expand Down Expand Up @@ -549,15 +548,15 @@ jobs:
else
echo "-e error failed to login to az with managed identity credentials"
exit 1
fi
fi
ACCESS_TOKEN=$(az account get-access-token --resource $RESOURCE_AUDIENCE --query accessToken -o json)
if [ $? -eq 0 ]; then
echo "get access token from resource:$RESOURCE_AUDIENCE successfully."
else
echo "-e error get access token from resource:$RESOURCE_AUDIENCE failed."
exit 1
fi
fi
ACCESS_TOKEN=$(echo $ACCESS_TOKEN | tr -d '"' | tr -d '"\r\n')
ARC_API_URL="https://eastus2euap.dp.kubernetesconfiguration.azure.com"
Expand All @@ -578,7 +577,7 @@ jobs:
inputs:
azureSubscription: 'ContainerInsights_Build_Subscription(9b96ebbd-c57a-42d1-bbe9-b69296e4c7fb)'
scriptType: 'bash'
scriptLocation: 'inlineScript'
scriptLocation: 'inlineScript'
inlineScript: |
az config set extension.use_dynamic_install=yes_without_prompt
az k8s-extension update --name azuremonitor-metrics --resource-group ci-dev-arc-wcus --cluster-name ci-dev-arc-wcus --cluster-type connectedClusters --version $HELM_SEMVER --release-train pipeline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
scrape_configs:
- job_name: 'kubernetes-pods'
scrape_interval: $$SCRAPE_INTERVAL$$
kubernetes_sd_configs:
- role: pod
relabel_configs:
Expand All @@ -22,4 +23,4 @@
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: kubernetes_pod_name
target_label: kubernetes_pod_name
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
scrape_configs:
- job_name: prometheus_collector_health
scrape_interval: $$SCRAPE_INTERVAL$$
label_limit: 63
label_name_length_limit: 511
label_value_length_limit: 1023
static_configs:
- targets: ['127.0.0.1:2234']
- targets: ['127.0.0.1:2234']
2 changes: 1 addition & 1 deletion otelcollector/configmapparser/prometheus-config-merger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def setDefaultFileScrapeInterval(scrapeInterval)
@corednsDefaultFile, @cadvisorDefaultFileRsSimple, @cadvisorDefaultFileRsAdvanced, @cadvisorDefaultFileDs, @kubeproxyDefaultFile,
@apiserverDefaultFile, @kubestateDefaultFile, @nodeexporterDefaultFileRsSimple, @nodeexporterDefaultFileRsAdvanced, @nodeexporterDefaultFileDs,
@prometheusCollectorHealthDefaultFile, @windowsexporterDefaultRsSimpleFile, @windowsexporterDefaultDsFile,
@windowskubeproxyDefaultFileRsSimpleFile, @windowskubeproxyDefaultDsFile
@windowskubeproxyDefaultFileRsSimpleFile, @windowskubeproxyDefaultDsFile, @podannotationsDefaultFile
]

defaultFilesArray.each { |currentFile|
Expand Down

0 comments on commit 05bec02

Please sign in to comment.