mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fixes yamllint errors
Signed-off-by: Michal Wasilewski <mwasilewski@gmx.com>
This commit is contained in:
parent
46153083db
commit
3f686cad8b
|
@ -11,159 +11,158 @@ executors:
|
||||||
# should also be updated.
|
# should also be updated.
|
||||||
golang:
|
golang:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/golang:1.16-node
|
- image: circleci/golang:1.16-node
|
||||||
golang_115:
|
golang_115:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/golang:1.15-node
|
- image: circleci/golang:1.15-node
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
executor: golang
|
executor: golang
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- prometheus/setup_environment
|
- prometheus/setup_environment
|
||||||
- go/load-cache:
|
- go/load-cache:
|
||||||
key: v1
|
key: v1
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- v3-npm-deps-{{ checksum "web/ui/react-app/yarn.lock" }}
|
- v3-npm-deps-{{ checksum "web/ui/react-app/yarn.lock" }}
|
||||||
- v3-npm-deps-
|
- v3-npm-deps-
|
||||||
- run:
|
- run:
|
||||||
command: sudo apt-get install -y yamllint
|
command: sudo apt-get install -y yamllint
|
||||||
- run:
|
- run:
|
||||||
command: make
|
command: make
|
||||||
environment:
|
environment:
|
||||||
# Run garbage collection more aggressively to avoid getting OOMed during the lint phase.
|
# Run garbage collection more aggressively to avoid getting OOMed during the lint phase.
|
||||||
GOGC: "20"
|
GOGC: "20"
|
||||||
# By default Go uses GOMAXPROCS but a Circle CI executor has many
|
# By default Go uses GOMAXPROCS but a Circle CI executor has many
|
||||||
# cores (> 30) while the CPU and RAM resources are throttled. If we
|
# cores (> 30) while the CPU and RAM resources are throttled. If we
|
||||||
# don't limit this to the number of allocated cores, the job is
|
# don't limit this to the number of allocated cores, the job is
|
||||||
# likely to get OOMed and killed.
|
# likely to get OOMed and killed.
|
||||||
GOOPTS: "-p 2"
|
GOOPTS: "-p 2"
|
||||||
GOMAXPROCS: "2"
|
GOMAXPROCS: "2"
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
- prometheus/check_proto:
|
- prometheus/check_proto:
|
||||||
version: "3.15.8"
|
version: "3.15.8"
|
||||||
- prometheus/store_artifact:
|
- prometheus/store_artifact:
|
||||||
file: prometheus
|
file: prometheus
|
||||||
- prometheus/store_artifact:
|
- prometheus/store_artifact:
|
||||||
file: promtool
|
file: promtool
|
||||||
- go/save-cache:
|
- go/save-cache:
|
||||||
key: v1
|
key: v1
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v3-npm-deps-{{ checksum "web/ui/react-app/yarn.lock" }}
|
key: v3-npm-deps-{{ checksum "web/ui/react-app/yarn.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- /home/circleci/.cache/yarn
|
- /home/circleci/.cache/yarn
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: test-results
|
path: test-results
|
||||||
|
|
||||||
test_windows:
|
test_windows:
|
||||||
executor:
|
executor:
|
||||||
name: win/default
|
name: win/default
|
||||||
shell: powershell
|
shell: powershell
|
||||||
working_directory: /go/src/github.com/prometheus/prometheus
|
working_directory: /go/src/github.com/prometheus/prometheus
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
# Temporary workaround until circleci updates go.
|
# Temporary workaround until circleci updates go.
|
||||||
command: |
|
command: |
|
||||||
choco upgrade -y golang
|
choco upgrade -y golang
|
||||||
- run:
|
- run:
|
||||||
command:
|
command: refreshenv
|
||||||
refreshenv
|
- run:
|
||||||
- run:
|
command: |
|
||||||
command: |
|
$env:GOARCH=""; $env:GOOS=""; cd web/ui; go generate
|
||||||
$env:GOARCH=""; $env:GOOS=""; cd web/ui; go generate
|
cd ../..
|
||||||
cd ../..
|
$TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/discovery.*|github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"}
|
||||||
$TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/discovery.*|github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"}
|
go test $TestTargets -vet=off -v
|
||||||
go test $TestTargets -vet=off -v
|
environment:
|
||||||
environment:
|
GOGC: "20"
|
||||||
GOGC: "20"
|
GOOPTS: "-p 2"
|
||||||
GOOPTS: "-p 2"
|
|
||||||
|
|
||||||
test_tsdb_go115:
|
test_tsdb_go115:
|
||||||
executor: golang_115
|
executor: golang_115
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: go test ./tsdb/...
|
- run: go test ./tsdb/...
|
||||||
|
|
||||||
test_mixins:
|
test_mixins:
|
||||||
executor: golang
|
executor: golang
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: go install ./cmd/promtool/.
|
- run: go install ./cmd/promtool/.
|
||||||
- run:
|
- run:
|
||||||
command: go install -mod=readonly github.com/google/go-jsonnet/cmd/jsonnet github.com/google/go-jsonnet/cmd/jsonnetfmt github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
|
command: go install -mod=readonly github.com/google/go-jsonnet/cmd/jsonnet github.com/google/go-jsonnet/cmd/jsonnetfmt github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
|
||||||
working_directory: ~/project/documentation/prometheus-mixin
|
working_directory: ~/project/documentation/prometheus-mixin
|
||||||
- run:
|
- run:
|
||||||
command: make clean
|
command: make clean
|
||||||
working_directory: ~/project/documentation/prometheus-mixin
|
working_directory: ~/project/documentation/prometheus-mixin
|
||||||
- run:
|
- run:
|
||||||
command: jb install
|
command: jb install
|
||||||
working_directory: ~/project/documentation/prometheus-mixin
|
working_directory: ~/project/documentation/prometheus-mixin
|
||||||
- run:
|
- run:
|
||||||
command: sudo apt-get install -y yamllint
|
command: sudo apt-get install -y yamllint
|
||||||
- run:
|
- run:
|
||||||
command: make
|
command: make
|
||||||
working_directory: ~/project/documentation/prometheus-mixin
|
working_directory: ~/project/documentation/prometheus-mixin
|
||||||
- run:
|
- run:
|
||||||
command: git diff --exit-code
|
command: git diff --exit-code
|
||||||
working_directory: ~/project/documentation/prometheus-mixin
|
working_directory: ~/project/documentation/prometheus-mixin
|
||||||
|
|
||||||
repo_sync:
|
repo_sync:
|
||||||
executor: golang
|
executor: golang
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: mkdir -v -p "${PATH%%:*}" && curl -sL --fail https://github.com/mikefarah/yq/releases/download/v4.6.3/yq_linux_amd64 -o "${PATH%%:*}/yq" && chmod -v +x "${PATH%%:*}/yq"
|
- run: mkdir -v -p "${PATH%%:*}" && curl -sL --fail https://github.com/mikefarah/yq/releases/download/v4.6.3/yq_linux_amd64 -o "${PATH%%:*}/yq" && chmod -v +x "${PATH%%:*}/yq"
|
||||||
- run: sha256sum -c <(echo "c4343783c3361495c0d6d1eb742bba7432aa65e13e9fb8d7e201d544bcf14246 ${PATH%%:*}/yq")
|
- run: sha256sum -c <(echo "c4343783c3361495c0d6d1eb742bba7432aa65e13e9fb8d7e201d544bcf14246 ${PATH%%:*}/yq")
|
||||||
- run: ./scripts/sync_repo_files.sh
|
- run: ./scripts/sync_repo_files.sh
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
prometheus:
|
prometheus:
|
||||||
jobs:
|
jobs:
|
||||||
- test:
|
- test:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
- test_tsdb_go115:
|
- test_tsdb_go115:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
- test_mixins:
|
- test_mixins:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
- test_windows:
|
- test_windows:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
- prometheus/build:
|
- prometheus/build:
|
||||||
name: build
|
name: build
|
||||||
parallelism: 12
|
parallelism: 12
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
||||||
- prometheus/publish_main:
|
- prometheus/publish_main:
|
||||||
context: org-context
|
context: org-context
|
||||||
requires:
|
requires:
|
||||||
- test
|
- test
|
||||||
- build
|
- build
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: main
|
only: main
|
||||||
image: circleci/golang:1-node
|
image: circleci/golang:1-node
|
||||||
- prometheus/publish_release:
|
- prometheus/publish_release:
|
||||||
context: org-context
|
context: org-context
|
||||||
requires:
|
requires:
|
||||||
- test
|
- test
|
||||||
- build
|
- build
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
||||||
branches:
|
branches:
|
||||||
ignore: /.*/
|
ignore: /.*/
|
||||||
image: circleci/golang:1-node
|
image: circleci/golang:1-node
|
||||||
nightly:
|
nightly:
|
||||||
triggers:
|
triggers:
|
||||||
- schedule:
|
- schedule:
|
||||||
|
@ -173,5 +172,5 @@ workflows:
|
||||||
only:
|
only:
|
||||||
- main
|
- main
|
||||||
jobs:
|
jobs:
|
||||||
- repo_sync:
|
- repo_sync:
|
||||||
context: org-context
|
context: org-context
|
||||||
|
|
58
.github/workflows/codeql-analysis.yml
vendored
58
.github/workflows/codeql-analysis.yml
vendored
|
@ -13,12 +13,12 @@ name: "CodeQL"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, release-* ]
|
branches: [main, release-*]
|
||||||
pull_request:
|
pull_request:
|
||||||
# The branches below must be a subset of the branches above
|
# The branches below must be a subset of the branches above
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '26 14 * * 1'
|
- cron: "26 14 * * 1"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
|
@ -28,40 +28,40 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
language: [ 'go', 'javascript' ]
|
language: ["go", "javascript"]
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||||
# Learn more:
|
# Learn more:
|
||||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v1
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
# By default, queries listed here will override any specified in a config file.
|
# By default, queries listed here will override any specified in a config file.
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v1
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
# and modify them (or add more) to build your code if your project
|
# and modify them (or add more) to build your code if your project
|
||||||
# uses a compiled language
|
# uses a compiled language
|
||||||
|
|
||||||
#- run: |
|
#- run: |
|
||||||
# make bootstrap
|
# make bootstrap
|
||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v1
|
uses: github/codeql-action/analyze@v1
|
||||||
|
|
68
.github/workflows/funcbench.yml
vendored
68
.github/workflows/funcbench.yml
vendored
|
@ -22,37 +22,37 @@ jobs:
|
||||||
PROVIDER: gke
|
PROVIDER: gke
|
||||||
ZONE: europe-west3-a
|
ZONE: europe-west3-a
|
||||||
steps:
|
steps:
|
||||||
- name: Update status to pending
|
- name: Update status to pending
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"pending","context":"funcbench-status","target_url":"'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"pending","context":"funcbench-status","target_url":"'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
- name: Prepare nodepool
|
- name: Prepare nodepool
|
||||||
uses: docker://prominfra/funcbench:master
|
uses: docker://prominfra/funcbench:master
|
||||||
with:
|
with:
|
||||||
entrypoint: 'docker_entrypoint'
|
entrypoint: "docker_entrypoint"
|
||||||
args: make deploy
|
args: make deploy
|
||||||
- name: Delete all resources
|
- name: Delete all resources
|
||||||
if: always()
|
if: always()
|
||||||
uses: docker://prominfra/funcbench:master
|
uses: docker://prominfra/funcbench:master
|
||||||
with:
|
with:
|
||||||
entrypoint: 'docker_entrypoint'
|
entrypoint: "docker_entrypoint"
|
||||||
args: make clean
|
args: make clean
|
||||||
- name: Update status to failure
|
- name: Update status to failure
|
||||||
if: failure()
|
if: failure()
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"failure","context":"funcbench-status","target_url":"'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"failure","context":"funcbench-status","target_url":"'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
- name: Update status to success
|
- name: Update status to success
|
||||||
if: success()
|
if: success()
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"success","context":"funcbench-status","target_url":"'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"success","context":"funcbench-status","target_url":"'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
|
|
48
.github/workflows/fuzzing.yml
vendored
48
.github/workflows/fuzzing.yml
vendored
|
@ -2,28 +2,28 @@ name: CIFuzz
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'go.sum'
|
- "go.sum"
|
||||||
- 'go.mod'
|
- "go.mod"
|
||||||
- '**.go'
|
- "**.go"
|
||||||
jobs:
|
jobs:
|
||||||
Fuzzing:
|
Fuzzing:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Build Fuzzers
|
- name: Build Fuzzers
|
||||||
id: build
|
id: build
|
||||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||||
with:
|
with:
|
||||||
oss-fuzz-project-name: 'prometheus'
|
oss-fuzz-project-name: "prometheus"
|
||||||
dry-run: false
|
dry-run: false
|
||||||
- name: Run Fuzzers
|
- name: Run Fuzzers
|
||||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||||
with:
|
with:
|
||||||
oss-fuzz-project-name: 'prometheus'
|
oss-fuzz-project-name: "prometheus"
|
||||||
fuzz-seconds: 600
|
fuzz-seconds: 600
|
||||||
dry-run: false
|
dry-run: false
|
||||||
- name: Upload Crash
|
- name: Upload Crash
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
if: failure() && steps.build.outcome == 'success'
|
if: failure() && steps.build.outcome == 'success'
|
||||||
with:
|
with:
|
||||||
name: artifacts
|
name: artifacts
|
||||||
path: ./out/artifacts
|
path: ./out/artifacts
|
||||||
|
|
186
.github/workflows/prombench.yml
vendored
186
.github/workflows/prombench.yml
vendored
|
@ -1,6 +1,6 @@
|
||||||
on:
|
on:
|
||||||
repository_dispatch:
|
repository_dispatch:
|
||||||
types: [prombench_start,prombench_restart,prombench_stop]
|
types: [prombench_start, prombench_restart, prombench_stop]
|
||||||
name: Prombench Workflow
|
name: Prombench Workflow
|
||||||
env:
|
env:
|
||||||
AUTH_FILE: ${{ secrets.TEST_INFRA_PROVIDER_AUTH }}
|
AUTH_FILE: ${{ secrets.TEST_INFRA_PROVIDER_AUTH }}
|
||||||
|
@ -22,105 +22,105 @@ jobs:
|
||||||
if: github.event.action == 'prombench_start'
|
if: github.event.action == 'prombench_start'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update status to pending
|
- name: Update status to pending
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"pending", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"pending", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
- name: Run make deploy to start test
|
- name: Run make deploy to start test
|
||||||
id: make_deploy
|
id: make_deploy
|
||||||
uses: docker://prominfra/prombench:master
|
uses: docker://prominfra/prombench:master
|
||||||
with:
|
with:
|
||||||
args: >-
|
args: >-
|
||||||
until make all_nodes_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done;
|
until make all_nodes_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done;
|
||||||
make deploy;
|
make deploy;
|
||||||
- name: Update status to failure
|
- name: Update status to failure
|
||||||
if: failure()
|
if: failure()
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"failure", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"failure", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
- name: Update status to success
|
- name: Update status to success
|
||||||
if: success()
|
if: success()
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"success", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"success", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
benchmark_cancel:
|
benchmark_cancel:
|
||||||
name: Benchmark Cancel
|
name: Benchmark Cancel
|
||||||
if: github.event.action == 'prombench_stop'
|
if: github.event.action == 'prombench_stop'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update status to pending
|
- name: Update status to pending
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"pending", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"pending", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
- name: Run make clean to stop test
|
- name: Run make clean to stop test
|
||||||
id: make_clean
|
id: make_clean
|
||||||
uses: docker://prominfra/prombench:master
|
uses: docker://prominfra/prombench:master
|
||||||
with:
|
with:
|
||||||
args: >-
|
args: >-
|
||||||
until make all_nodes_running; do echo "waiting for nodepools to be created"; sleep 10; done;
|
until make all_nodes_running; do echo "waiting for nodepools to be created"; sleep 10; done;
|
||||||
make clean;
|
make clean;
|
||||||
- name: Update status to failure
|
- name: Update status to failure
|
||||||
if: failure()
|
if: failure()
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"failure", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"failure", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
- name: Update status to success
|
- name: Update status to success
|
||||||
if: success()
|
if: success()
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"success", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"success", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
benchmark_restart:
|
benchmark_restart:
|
||||||
name: Benchmark Restart
|
name: Benchmark Restart
|
||||||
if: github.event.action == 'prombench_restart'
|
if: github.event.action == 'prombench_restart'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update status to pending
|
- name: Update status to pending
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"pending", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"pending", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
- name: Run make clean then make deploy to restart test
|
- name: Run make clean then make deploy to restart test
|
||||||
id: make_restart
|
id: make_restart
|
||||||
uses: docker://prominfra/prombench:master
|
uses: docker://prominfra/prombench:master
|
||||||
with:
|
with:
|
||||||
args: >-
|
args: >-
|
||||||
until make all_nodes_running; do echo "waiting for nodepools to be created"; sleep 10; done;
|
until make all_nodes_running; do echo "waiting for nodepools to be created"; sleep 10; done;
|
||||||
make clean;
|
make clean;
|
||||||
until make all_nodes_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done;
|
until make all_nodes_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done;
|
||||||
make deploy;
|
make deploy;
|
||||||
- name: Update status to failure
|
- name: Update status to failure
|
||||||
if: failure()
|
if: failure()
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"failure", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"failure", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
- name: Update status to success
|
- name: Update status to success
|
||||||
if: success()
|
if: success()
|
||||||
run: >-
|
run: >-
|
||||||
curl -i -X POST
|
curl -i -X POST
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
||||||
-H "Content-Type: application/json"
|
-H "Content-Type: application/json"
|
||||||
--data '{"state":"success", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
--data '{"state":"success", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
||||||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
---
|
||||||
tasks:
|
tasks:
|
||||||
- init:
|
- init:
|
||||||
make build
|
make build
|
||||||
command: |
|
command: |
|
||||||
gp sync-done build
|
gp sync-done build
|
||||||
|
|
|
@ -3,14 +3,14 @@ run:
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
- depguard
|
- depguard
|
||||||
- golint
|
- golint
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
exclude-rules:
|
exclude-rules:
|
||||||
- path: _test.go
|
- path: _test.go
|
||||||
linters:
|
linters:
|
||||||
- errcheck
|
- errcheck
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
depguard:
|
depguard:
|
||||||
|
|
4
cmd/promtool/testdata/bad-promql.yml
vendored
4
cmd/promtool/testdata/bad-promql.yml
vendored
|
@ -8,5 +8,5 @@ tests:
|
||||||
values: 3
|
values: 3
|
||||||
|
|
||||||
promql_expr_test:
|
promql_expr_test:
|
||||||
# This PromQL generates an error.
|
# This PromQL generates an error.
|
||||||
- expr: "join_1 + on(a) join_2"
|
- expr: "join_1 + on(a) join_2"
|
||||||
|
|
18
cmd/promtool/testdata/unittest.yml
vendored
18
cmd/promtool/testdata/unittest.yml
vendored
|
@ -8,13 +8,13 @@ tests:
|
||||||
- interval: 1m
|
- interval: 1m
|
||||||
input_series:
|
input_series:
|
||||||
- series: test_full
|
- series: test_full
|
||||||
values: '0 0'
|
values: "0 0"
|
||||||
|
|
||||||
- series: test_stale
|
- series: test_stale
|
||||||
values: '0 stale'
|
values: "0 stale"
|
||||||
|
|
||||||
- series: test_missing
|
- series: test_missing
|
||||||
values: '0 _ _ _ _ _ _ 0'
|
values: "0 _ _ _ _ _ _ 0"
|
||||||
|
|
||||||
promql_expr_test:
|
promql_expr_test:
|
||||||
# Ensure the sample is evaluated at the time we expect it to be.
|
# Ensure the sample is evaluated at the time we expect it to be.
|
||||||
|
@ -36,7 +36,7 @@ tests:
|
||||||
eval_time: 59s
|
eval_time: 59s
|
||||||
exp_samples:
|
exp_samples:
|
||||||
- value: 0
|
- value: 0
|
||||||
labels: 'test_stale'
|
labels: "test_stale"
|
||||||
- expr: test_stale
|
- expr: test_stale
|
||||||
eval_time: 1m
|
eval_time: 1m
|
||||||
exp_samples: []
|
exp_samples: []
|
||||||
|
@ -83,10 +83,10 @@ tests:
|
||||||
- expr: count(ALERTS) by (alertname, alertstate)
|
- expr: count(ALERTS) by (alertname, alertstate)
|
||||||
eval_time: 4m
|
eval_time: 4m
|
||||||
exp_samples:
|
exp_samples:
|
||||||
- labels: '{alertname="AlwaysFiring",alertstate="firing"}'
|
- labels: '{alertname="AlwaysFiring",alertstate="firing"}'
|
||||||
value: 1
|
value: 1
|
||||||
- labels: '{alertname="InstanceDown",alertstate="pending"}'
|
- labels: '{alertname="InstanceDown",alertstate="pending"}'
|
||||||
value: 1
|
value: 1
|
||||||
|
|
||||||
alert_rule_test:
|
alert_rule_test:
|
||||||
- eval_time: 1d
|
- eval_time: 1d
|
||||||
|
@ -120,7 +120,7 @@ tests:
|
||||||
- series: 'test{job="test", instance="x:0"}'
|
- series: 'test{job="test", instance="x:0"}'
|
||||||
# 2 minutes + 1 second of input data, recording rules should only run
|
# 2 minutes + 1 second of input data, recording rules should only run
|
||||||
# once a minute.
|
# once a minute.
|
||||||
values: '0+1x120'
|
values: "0+1x120"
|
||||||
|
|
||||||
promql_expr_test:
|
promql_expr_test:
|
||||||
- expr: job:test:count_over_time1m
|
- expr: job:test:count_over_time1m
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- azure_sd_configs:
|
- azure_sd_configs:
|
||||||
- authentication_method: invalid
|
- authentication_method: invalid
|
||||||
subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
||||||
|
|
|
@ -4,4 +4,4 @@ scrape_configs:
|
||||||
- subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
- subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
||||||
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
||||||
client_id:
|
client_id:
|
||||||
client_secret: mysecret
|
client_secret: mysecret
|
||||||
|
|
|
@ -4,4 +4,4 @@ scrape_configs:
|
||||||
- subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
- subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
||||||
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
||||||
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
||||||
client_secret:
|
client_secret:
|
||||||
|
|
|
@ -4,4 +4,4 @@ scrape_configs:
|
||||||
- subscription_id:
|
- subscription_id:
|
||||||
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
||||||
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
||||||
client_secret: mysecret
|
client_secret: mysecret
|
||||||
|
|
|
@ -4,4 +4,4 @@ scrape_configs:
|
||||||
- subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
- subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
||||||
tenant_id:
|
tenant_id:
|
||||||
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
||||||
client_secret: mysecret
|
client_secret: mysecret
|
||||||
|
|
1
config/testdata/bearertoken.bad.yml
vendored
1
config/testdata/bearertoken.bad.yml
vendored
|
@ -3,4 +3,3 @@ scrape_configs:
|
||||||
|
|
||||||
bearer_token: 1234
|
bearer_token: 1234
|
||||||
bearer_token_file: somefile
|
bearer_token_file: somefile
|
||||||
|
|
||||||
|
|
|
@ -5,4 +5,3 @@ scrape_configs:
|
||||||
basic_auth:
|
basic_auth:
|
||||||
username: user
|
username: user
|
||||||
password: password
|
password: password
|
||||||
|
|
||||||
|
|
528
config/testdata/conf.good.yml
vendored
528
config/testdata/conf.good.yml
vendored
|
@ -1,24 +1,24 @@
|
||||||
# my global config
|
# my global config
|
||||||
global:
|
global:
|
||||||
scrape_interval: 15s
|
scrape_interval: 15s
|
||||||
evaluation_interval: 30s
|
evaluation_interval: 30s
|
||||||
# scrape_timeout is set to the global default (10s).
|
# scrape_timeout is set to the global default (10s).
|
||||||
|
|
||||||
external_labels:
|
external_labels:
|
||||||
monitor: codelab
|
monitor: codelab
|
||||||
foo: bar
|
foo: bar
|
||||||
|
|
||||||
rule_files:
|
rule_files:
|
||||||
- "first.rules"
|
- "first.rules"
|
||||||
- "my/*.rules"
|
- "my/*.rules"
|
||||||
|
|
||||||
remote_write:
|
remote_write:
|
||||||
- url: http://remote1/push
|
- url: http://remote1/push
|
||||||
name: drop_expensive
|
name: drop_expensive
|
||||||
write_relabel_configs:
|
write_relabel_configs:
|
||||||
- source_labels: [__name__]
|
- source_labels: [__name__]
|
||||||
regex: expensive.*
|
regex: expensive.*
|
||||||
action: drop
|
action: drop
|
||||||
oauth2:
|
oauth2:
|
||||||
client_id: "123"
|
client_id: "123"
|
||||||
client_secret: "456"
|
client_secret: "456"
|
||||||
|
@ -46,300 +46,298 @@ remote_read:
|
||||||
key_file: valid_key_file
|
key_file: valid_key_file
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
honor_labels: true
|
honor_labels: true
|
||||||
# scrape_interval is defined by the configured global (15s).
|
# scrape_interval is defined by the configured global (15s).
|
||||||
# scrape_timeout is defined by the global default (10s).
|
# scrape_timeout is defined by the global default (10s).
|
||||||
|
|
||||||
# metrics_path defaults to '/metrics'
|
# metrics_path defaults to '/metrics'
|
||||||
# scheme defaults to 'http'.
|
# scheme defaults to 'http'.
|
||||||
|
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
- files:
|
- files:
|
||||||
- foo/*.slow.json
|
- foo/*.slow.json
|
||||||
- foo/*.slow.yml
|
- foo/*.slow.yml
|
||||||
- single/file.yml
|
- single/file.yml
|
||||||
refresh_interval: 10m
|
refresh_interval: 10m
|
||||||
- files:
|
- files:
|
||||||
- bar/*.yaml
|
- bar/*.yaml
|
||||||
|
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['localhost:9090', 'localhost:9191']
|
- targets: ["localhost:9090", "localhost:9191"]
|
||||||
labels:
|
labels:
|
||||||
my: label
|
my: label
|
||||||
your: label
|
your: label
|
||||||
|
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- source_labels: [job, __meta_dns_name]
|
- source_labels: [job, __meta_dns_name]
|
||||||
regex: (.*)some-[regex]
|
regex: (.*)some-[regex]
|
||||||
target_label: job
|
target_label: job
|
||||||
replacement: foo-${1}
|
replacement: foo-${1}
|
||||||
# action defaults to 'replace'
|
# action defaults to 'replace'
|
||||||
- source_labels: [abc]
|
- source_labels: [abc]
|
||||||
target_label: cde
|
target_label: cde
|
||||||
- replacement: static
|
- replacement: static
|
||||||
target_label: abc
|
target_label: abc
|
||||||
- regex:
|
- regex:
|
||||||
replacement: static
|
replacement: static
|
||||||
target_label: abc
|
target_label: abc
|
||||||
|
|
||||||
authorization:
|
authorization:
|
||||||
credentials_file: valid_token_file
|
credentials_file: valid_token_file
|
||||||
|
|
||||||
|
- job_name: service-x
|
||||||
- job_name: service-x
|
|
||||||
|
|
||||||
basic_auth:
|
|
||||||
username: admin_name
|
|
||||||
password: "multiline\nmysecret\ntest"
|
|
||||||
|
|
||||||
scrape_interval: 50s
|
|
||||||
scrape_timeout: 5s
|
|
||||||
|
|
||||||
body_size_limit: 10MB
|
|
||||||
sample_limit: 1000
|
|
||||||
|
|
||||||
metrics_path: /my_path
|
|
||||||
scheme: https
|
|
||||||
|
|
||||||
dns_sd_configs:
|
|
||||||
- refresh_interval: 15s
|
|
||||||
names:
|
|
||||||
- first.dns.address.domain.com
|
|
||||||
- second.dns.address.domain.com
|
|
||||||
- names:
|
|
||||||
- first.dns.address.domain.com
|
|
||||||
# refresh_interval defaults to 30s.
|
|
||||||
|
|
||||||
relabel_configs:
|
|
||||||
- source_labels: [job]
|
|
||||||
regex: (.*)some-[regex]
|
|
||||||
action: drop
|
|
||||||
- source_labels: [__address__]
|
|
||||||
modulus: 8
|
|
||||||
target_label: __tmp_hash
|
|
||||||
action: hashmod
|
|
||||||
- source_labels: [__tmp_hash]
|
|
||||||
regex: 1
|
|
||||||
action: keep
|
|
||||||
- action: labelmap
|
|
||||||
regex: 1
|
|
||||||
- action: labeldrop
|
|
||||||
regex: d
|
|
||||||
- action: labelkeep
|
|
||||||
regex: k
|
|
||||||
|
|
||||||
metric_relabel_configs:
|
|
||||||
- source_labels: [__name__]
|
|
||||||
regex: expensive_metric.*
|
|
||||||
action: drop
|
|
||||||
|
|
||||||
- job_name: service-y
|
|
||||||
|
|
||||||
consul_sd_configs:
|
|
||||||
- server: 'localhost:1234'
|
|
||||||
token: mysecret
|
|
||||||
services: ['nginx', 'cache', 'mysql']
|
|
||||||
tags: ["canary", "v1"]
|
|
||||||
node_meta:
|
|
||||||
rack: "123"
|
|
||||||
allow_stale: true
|
|
||||||
scheme: https
|
|
||||||
tls_config:
|
|
||||||
ca_file: valid_ca_file
|
|
||||||
cert_file: valid_cert_file
|
|
||||||
key_file: valid_key_file
|
|
||||||
insecure_skip_verify: false
|
|
||||||
|
|
||||||
relabel_configs:
|
|
||||||
- source_labels: [__meta_sd_consul_tags]
|
|
||||||
separator: ','
|
|
||||||
regex: label:([^=]+)=([^,]+)
|
|
||||||
target_label: ${1}
|
|
||||||
replacement: ${2}
|
|
||||||
|
|
||||||
- job_name: service-z
|
|
||||||
|
|
||||||
tls_config:
|
|
||||||
cert_file: valid_cert_file
|
|
||||||
key_file: valid_key_file
|
|
||||||
|
|
||||||
authorization:
|
|
||||||
credentials: mysecret
|
|
||||||
|
|
||||||
- job_name: service-kubernetes
|
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: endpoints
|
|
||||||
api_server: 'https://localhost:1234'
|
|
||||||
tls_config:
|
|
||||||
cert_file: valid_cert_file
|
|
||||||
key_file: valid_key_file
|
|
||||||
|
|
||||||
basic_auth:
|
basic_auth:
|
||||||
username: 'myusername'
|
username: admin_name
|
||||||
password: 'mysecret'
|
password: "multiline\nmysecret\ntest"
|
||||||
|
|
||||||
- job_name: service-kubernetes-namespaces
|
scrape_interval: 50s
|
||||||
|
scrape_timeout: 5s
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
body_size_limit: 10MB
|
||||||
- role: endpoints
|
sample_limit: 1000
|
||||||
api_server: 'https://localhost:1234'
|
|
||||||
namespaces:
|
|
||||||
names:
|
|
||||||
- default
|
|
||||||
|
|
||||||
basic_auth:
|
metrics_path: /my_path
|
||||||
username: 'myusername'
|
scheme: https
|
||||||
password_file: valid_password_file
|
|
||||||
|
|
||||||
|
dns_sd_configs:
|
||||||
|
- refresh_interval: 15s
|
||||||
|
names:
|
||||||
|
- first.dns.address.domain.com
|
||||||
|
- second.dns.address.domain.com
|
||||||
|
- names:
|
||||||
|
- first.dns.address.domain.com
|
||||||
|
# refresh_interval defaults to 30s.
|
||||||
|
|
||||||
- job_name: service-marathon
|
relabel_configs:
|
||||||
marathon_sd_configs:
|
- source_labels: [job]
|
||||||
- servers:
|
regex: (.*)some-[regex]
|
||||||
- 'https://marathon.example.com:443'
|
action: drop
|
||||||
|
- source_labels: [__address__]
|
||||||
|
modulus: 8
|
||||||
|
target_label: __tmp_hash
|
||||||
|
action: hashmod
|
||||||
|
- source_labels: [__tmp_hash]
|
||||||
|
regex: 1
|
||||||
|
action: keep
|
||||||
|
- action: labelmap
|
||||||
|
regex: 1
|
||||||
|
- action: labeldrop
|
||||||
|
regex: d
|
||||||
|
- action: labelkeep
|
||||||
|
regex: k
|
||||||
|
|
||||||
|
metric_relabel_configs:
|
||||||
|
- source_labels: [__name__]
|
||||||
|
regex: expensive_metric.*
|
||||||
|
action: drop
|
||||||
|
|
||||||
|
- job_name: service-y
|
||||||
|
|
||||||
|
consul_sd_configs:
|
||||||
|
- server: "localhost:1234"
|
||||||
|
token: mysecret
|
||||||
|
services: ["nginx", "cache", "mysql"]
|
||||||
|
tags: ["canary", "v1"]
|
||||||
|
node_meta:
|
||||||
|
rack: "123"
|
||||||
|
allow_stale: true
|
||||||
|
scheme: https
|
||||||
|
tls_config:
|
||||||
|
ca_file: valid_ca_file
|
||||||
|
cert_file: valid_cert_file
|
||||||
|
key_file: valid_key_file
|
||||||
|
insecure_skip_verify: false
|
||||||
|
|
||||||
|
relabel_configs:
|
||||||
|
- source_labels: [__meta_sd_consul_tags]
|
||||||
|
separator: ","
|
||||||
|
regex: label:([^=]+)=([^,]+)
|
||||||
|
target_label: ${1}
|
||||||
|
replacement: ${2}
|
||||||
|
|
||||||
|
- job_name: service-z
|
||||||
|
|
||||||
auth_token: "mysecret"
|
|
||||||
tls_config:
|
tls_config:
|
||||||
cert_file: valid_cert_file
|
cert_file: valid_cert_file
|
||||||
key_file: valid_key_file
|
key_file: valid_key_file
|
||||||
|
|
||||||
- job_name: service-ec2
|
authorization:
|
||||||
ec2_sd_configs:
|
credentials: mysecret
|
||||||
- region: us-east-1
|
|
||||||
access_key: access
|
|
||||||
secret_key: mysecret
|
|
||||||
profile: profile
|
|
||||||
filters:
|
|
||||||
- name: tag:environment
|
|
||||||
values:
|
|
||||||
- prod
|
|
||||||
|
|
||||||
- name: tag:service
|
- job_name: service-kubernetes
|
||||||
values:
|
|
||||||
- web
|
|
||||||
- db
|
|
||||||
|
|
||||||
- job_name: service-lightsail
|
kubernetes_sd_configs:
|
||||||
lightsail_sd_configs:
|
- role: endpoints
|
||||||
- region: us-east-1
|
api_server: "https://localhost:1234"
|
||||||
access_key: access
|
tls_config:
|
||||||
secret_key: mysecret
|
cert_file: valid_cert_file
|
||||||
profile: profile
|
key_file: valid_key_file
|
||||||
|
|
||||||
- job_name: service-azure
|
basic_auth:
|
||||||
azure_sd_configs:
|
username: "myusername"
|
||||||
- environment: AzurePublicCloud
|
password: "mysecret"
|
||||||
authentication_method: OAuth
|
|
||||||
subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
|
||||||
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
|
||||||
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
|
||||||
client_secret: mysecret
|
|
||||||
port: 9100
|
|
||||||
|
|
||||||
- job_name: service-nerve
|
- job_name: service-kubernetes-namespaces
|
||||||
nerve_sd_configs:
|
|
||||||
- servers:
|
|
||||||
- localhost
|
|
||||||
paths:
|
|
||||||
- /monitoring
|
|
||||||
|
|
||||||
- job_name: 0123service-xxx
|
kubernetes_sd_configs:
|
||||||
metrics_path: /metrics
|
- role: endpoints
|
||||||
static_configs:
|
api_server: "https://localhost:1234"
|
||||||
- targets:
|
namespaces:
|
||||||
- localhost:9090
|
names:
|
||||||
|
- default
|
||||||
|
|
||||||
- job_name: badfederation
|
basic_auth:
|
||||||
honor_timestamps: false
|
username: "myusername"
|
||||||
metrics_path: /federate
|
password_file: valid_password_file
|
||||||
static_configs:
|
|
||||||
- targets:
|
|
||||||
- localhost:9090
|
|
||||||
|
|
||||||
- job_name: 測試
|
- job_name: service-marathon
|
||||||
metrics_path: /metrics
|
marathon_sd_configs:
|
||||||
static_configs:
|
- servers:
|
||||||
- targets:
|
- "https://marathon.example.com:443"
|
||||||
- localhost:9090
|
|
||||||
|
|
||||||
- job_name: httpsd
|
auth_token: "mysecret"
|
||||||
http_sd_configs:
|
tls_config:
|
||||||
- url: 'http://example.com/prometheus'
|
cert_file: valid_cert_file
|
||||||
|
key_file: valid_key_file
|
||||||
|
|
||||||
- job_name: service-triton
|
- job_name: service-ec2
|
||||||
triton_sd_configs:
|
ec2_sd_configs:
|
||||||
- account: 'testAccount'
|
- region: us-east-1
|
||||||
dns_suffix: 'triton.example.com'
|
access_key: access
|
||||||
endpoint: 'triton.example.com'
|
secret_key: mysecret
|
||||||
port: 9163
|
profile: profile
|
||||||
refresh_interval: 1m
|
filters:
|
||||||
version: 1
|
- name: tag:environment
|
||||||
tls_config:
|
values:
|
||||||
cert_file: valid_cert_file
|
- prod
|
||||||
key_file: valid_key_file
|
|
||||||
|
|
||||||
- job_name: digitalocean-droplets
|
- name: tag:service
|
||||||
digitalocean_sd_configs:
|
values:
|
||||||
- authorization:
|
- web
|
||||||
credentials: abcdef
|
- db
|
||||||
|
|
||||||
- job_name: docker
|
- job_name: service-lightsail
|
||||||
docker_sd_configs:
|
lightsail_sd_configs:
|
||||||
- host: unix:///var/run/docker.sock
|
- region: us-east-1
|
||||||
|
access_key: access
|
||||||
|
secret_key: mysecret
|
||||||
|
profile: profile
|
||||||
|
|
||||||
- job_name: dockerswarm
|
- job_name: service-azure
|
||||||
dockerswarm_sd_configs:
|
azure_sd_configs:
|
||||||
- host: http://127.0.0.1:2375
|
- environment: AzurePublicCloud
|
||||||
role: nodes
|
authentication_method: OAuth
|
||||||
|
subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
||||||
|
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
||||||
|
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
||||||
|
client_secret: mysecret
|
||||||
|
port: 9100
|
||||||
|
|
||||||
- job_name: service-openstack
|
- job_name: service-nerve
|
||||||
openstack_sd_configs:
|
nerve_sd_configs:
|
||||||
- role: instance
|
- servers:
|
||||||
region: RegionOne
|
- localhost
|
||||||
port: 80
|
paths:
|
||||||
refresh_interval: 1m
|
- /monitoring
|
||||||
tls_config:
|
|
||||||
ca_file: valid_ca_file
|
|
||||||
cert_file: valid_cert_file
|
|
||||||
key_file: valid_key_file
|
|
||||||
|
|
||||||
- job_name: hetzner
|
- job_name: 0123service-xxx
|
||||||
hetzner_sd_configs:
|
metrics_path: /metrics
|
||||||
- role: hcloud
|
static_configs:
|
||||||
authorization:
|
- targets:
|
||||||
credentials: abcdef
|
- localhost:9090
|
||||||
- role: robot
|
|
||||||
basic_auth:
|
|
||||||
username: abcdef
|
|
||||||
password: abcdef
|
|
||||||
|
|
||||||
- job_name: service-eureka
|
- job_name: badfederation
|
||||||
eureka_sd_configs:
|
honor_timestamps: false
|
||||||
- server: 'http://eureka.example.com:8761/eureka'
|
metrics_path: /federate
|
||||||
|
static_configs:
|
||||||
|
- targets:
|
||||||
|
- localhost:9090
|
||||||
|
|
||||||
- job_name: scaleway
|
- job_name: 測試
|
||||||
scaleway_sd_configs:
|
metrics_path: /metrics
|
||||||
- role: instance
|
static_configs:
|
||||||
project_id: 11111111-1111-1111-1111-111111111112
|
- targets:
|
||||||
access_key: SCWXXXXXXXXXXXXXXXXX
|
- localhost:9090
|
||||||
secret_key: 11111111-1111-1111-1111-111111111111
|
|
||||||
- role: baremetal
|
|
||||||
project_id: 11111111-1111-1111-1111-111111111112
|
|
||||||
access_key: SCWXXXXXXXXXXXXXXXXX
|
|
||||||
secret_key: 11111111-1111-1111-1111-111111111111
|
|
||||||
|
|
||||||
- job_name: linode-instances
|
- job_name: httpsd
|
||||||
linode_sd_configs:
|
http_sd_configs:
|
||||||
- authorization:
|
- url: "http://example.com/prometheus"
|
||||||
credentials: abcdef
|
|
||||||
|
- job_name: service-triton
|
||||||
|
triton_sd_configs:
|
||||||
|
- account: "testAccount"
|
||||||
|
dns_suffix: "triton.example.com"
|
||||||
|
endpoint: "triton.example.com"
|
||||||
|
port: 9163
|
||||||
|
refresh_interval: 1m
|
||||||
|
version: 1
|
||||||
|
tls_config:
|
||||||
|
cert_file: valid_cert_file
|
||||||
|
key_file: valid_key_file
|
||||||
|
|
||||||
|
- job_name: digitalocean-droplets
|
||||||
|
digitalocean_sd_configs:
|
||||||
|
- authorization:
|
||||||
|
credentials: abcdef
|
||||||
|
|
||||||
|
- job_name: docker
|
||||||
|
docker_sd_configs:
|
||||||
|
- host: unix:///var/run/docker.sock
|
||||||
|
|
||||||
|
- job_name: dockerswarm
|
||||||
|
dockerswarm_sd_configs:
|
||||||
|
- host: http://127.0.0.1:2375
|
||||||
|
role: nodes
|
||||||
|
|
||||||
|
- job_name: service-openstack
|
||||||
|
openstack_sd_configs:
|
||||||
|
- role: instance
|
||||||
|
region: RegionOne
|
||||||
|
port: 80
|
||||||
|
refresh_interval: 1m
|
||||||
|
tls_config:
|
||||||
|
ca_file: valid_ca_file
|
||||||
|
cert_file: valid_cert_file
|
||||||
|
key_file: valid_key_file
|
||||||
|
|
||||||
|
- job_name: hetzner
|
||||||
|
hetzner_sd_configs:
|
||||||
|
- role: hcloud
|
||||||
|
authorization:
|
||||||
|
credentials: abcdef
|
||||||
|
- role: robot
|
||||||
|
basic_auth:
|
||||||
|
username: abcdef
|
||||||
|
password: abcdef
|
||||||
|
|
||||||
|
- job_name: service-eureka
|
||||||
|
eureka_sd_configs:
|
||||||
|
- server: "http://eureka.example.com:8761/eureka"
|
||||||
|
|
||||||
|
- job_name: scaleway
|
||||||
|
scaleway_sd_configs:
|
||||||
|
- role: instance
|
||||||
|
project_id: 11111111-1111-1111-1111-111111111112
|
||||||
|
access_key: SCWXXXXXXXXXXXXXXXXX
|
||||||
|
secret_key: 11111111-1111-1111-1111-111111111111
|
||||||
|
- role: baremetal
|
||||||
|
project_id: 11111111-1111-1111-1111-111111111112
|
||||||
|
access_key: SCWXXXXXXXXXXXXXXXXX
|
||||||
|
secret_key: 11111111-1111-1111-1111-111111111111
|
||||||
|
|
||||||
|
- job_name: linode-instances
|
||||||
|
linode_sd_configs:
|
||||||
|
- authorization:
|
||||||
|
credentials: abcdef
|
||||||
|
|
||||||
alerting:
|
alerting:
|
||||||
alertmanagers:
|
alertmanagers:
|
||||||
- scheme: https
|
- scheme: https
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
- "1.2.3.4:9093"
|
- "1.2.3.4:9093"
|
||||||
- "1.2.3.5:9093"
|
- "1.2.3.5:9093"
|
||||||
- "1.2.3.6:9093"
|
- "1.2.3.6:9093"
|
||||||
|
|
|
@ -2,8 +2,7 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
ec2_sd_configs:
|
ec2_sd_configs:
|
||||||
- region: 'us-east-1'
|
- region: "us-east-1"
|
||||||
filters:
|
filters:
|
||||||
- name: 'tag:environment'
|
- name: "tag:environment"
|
||||||
values:
|
values:
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
alerting:
|
alerting:
|
||||||
alert_relabel_configs:
|
alert_relabel_configs:
|
||||||
-
|
-
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
alerting:
|
alerting:
|
||||||
alertmanagers:
|
alertmanagers:
|
||||||
- relabel_configs:
|
- relabel_configs:
|
||||||
-
|
-
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: "test"
|
- job_name: "test"
|
||||||
metric_relabel_configs:
|
metric_relabel_configs:
|
||||||
-
|
-
|
||||||
|
|
2
config/testdata/empty_rr_config.bad.yml
vendored
2
config/testdata/empty_rr_config.bad.yml
vendored
|
@ -1,2 +1,2 @@
|
||||||
remote_read:
|
remote_read:
|
||||||
-
|
-
|
||||||
|
|
2
config/testdata/empty_rw_config.bad.yml
vendored
2
config/testdata/empty_rw_config.bad.yml
vendored
|
@ -1,2 +1,2 @@
|
||||||
remote_write:
|
remote_write:
|
||||||
-
|
-
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
remote_write:
|
remote_write:
|
||||||
- url: "foo"
|
- url: "foo"
|
||||||
write_relabel_configs:
|
write_relabel_configs:
|
||||||
-
|
-
|
||||||
|
|
2
config/testdata/empty_scrape_config.bad.yml
vendored
2
config/testdata/empty_scrape_config.bad.yml
vendored
|
@ -1,2 +1,2 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
-
|
-
|
||||||
|
|
6
config/testdata/empty_static_config.bad.yml
vendored
6
config/testdata/empty_static_config.bad.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: "test"
|
- job_name: "test"
|
||||||
static_configs:
|
static_configs:
|
||||||
-
|
-
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: "test"
|
- job_name: "test"
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
-
|
-
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
|
- job_name: eureka
|
||||||
- job_name: eureka
|
eureka_sd_configs:
|
||||||
eureka_sd_configs:
|
- server: eureka.com
|
||||||
- server: eureka.com
|
|
||||||
|
|
7
config/testdata/eureka_no_server.bad.yml
vendored
7
config/testdata/eureka_no_server.bad.yml
vendored
|
@ -1,5 +1,4 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
|
- job_name: eureka
|
||||||
- job_name: eureka
|
eureka_sd_configs:
|
||||||
eureka_sd_configs:
|
- server:
|
||||||
- server:
|
|
||||||
|
|
5
config/testdata/hetzner_role.bad.yml
vendored
5
config/testdata/hetzner_role.bad.yml
vendored
|
@ -1,4 +1,3 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- hetzner_sd_configs:
|
- hetzner_sd_configs:
|
||||||
- role: invalid
|
- role: invalid
|
||||||
|
|
||||||
|
|
4
config/testdata/http_url_bad_scheme.bad.yml
vendored
4
config/testdata/http_url_bad_scheme.bad.yml
vendored
|
@ -1,3 +1,3 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- http_sd_configs:
|
- http_sd_configs:
|
||||||
- url: ftp://example.com
|
- url: ftp://example.com
|
||||||
|
|
4
config/testdata/http_url_no_host.bad.yml
vendored
4
config/testdata/http_url_no_host.bad.yml
vendored
|
@ -1,3 +1,3 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- http_sd_configs:
|
- http_sd_configs:
|
||||||
- url: http://
|
- url: http://
|
||||||
|
|
4
config/testdata/http_url_no_scheme.bad.yml
vendored
4
config/testdata/http_url_no_scheme.bad.yml
vendored
|
@ -1,3 +1,3 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- http_sd_configs:
|
- http_sd_configs:
|
||||||
- url: invalid
|
- url: invalid
|
||||||
|
|
|
@ -2,12 +2,11 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: pod
|
- role: pod
|
||||||
api_server: 'https://localhost:1234'
|
api_server: "https://localhost:1234"
|
||||||
|
|
||||||
authorization:
|
authorization:
|
||||||
credentials: 1234
|
credentials: 1234
|
||||||
basic_auth:
|
basic_auth:
|
||||||
username: user
|
username: user
|
||||||
password: password
|
password: password
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,8 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: node
|
- role: node
|
||||||
api_server: 'https://localhost:1234'
|
api_server: "https://localhost:1234"
|
||||||
|
|
||||||
bearer_token: 1234
|
|
||||||
bearer_token_file: somefile
|
|
||||||
|
|
||||||
|
bearer_token: 1234
|
||||||
|
bearer_token_file: somefile
|
||||||
|
|
|
@ -2,11 +2,10 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: pod
|
- role: pod
|
||||||
api_server: 'https://localhost:1234'
|
api_server: "https://localhost:1234"
|
||||||
|
|
||||||
bearer_token: 1234
|
|
||||||
basic_auth:
|
|
||||||
username: user
|
|
||||||
password: password
|
|
||||||
|
|
||||||
|
bearer_token: 1234
|
||||||
|
basic_auth:
|
||||||
|
username: user
|
||||||
|
password: password
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: endpoints
|
- role: endpoints
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: pod
|
- role: pod
|
||||||
authorization:
|
authorization:
|
||||||
credentials: 1234
|
credentials: 1234
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- kubernetes_sd_configs:
|
- kubernetes_sd_configs:
|
||||||
- api_server: kubernetes:443
|
- api_server: kubernetes:443
|
||||||
role: endpoints
|
role: endpoints
|
||||||
namespaces:
|
namespaces:
|
||||||
foo: bar
|
foo: bar
|
||||||
|
|
7
config/testdata/kubernetes_role.bad.yml
vendored
7
config/testdata/kubernetes_role.bad.yml
vendored
|
@ -1,5 +1,4 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- kubernetes_sd_configs:
|
- kubernetes_sd_configs:
|
||||||
- api_server: kubernetes:443
|
- api_server: kubernetes:443
|
||||||
role: vacation
|
role: vacation
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: endpoints
|
- role: endpoints
|
||||||
selectors:
|
selectors:
|
||||||
- role: "pod"
|
- role: "pod"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
- role: "pod"
|
- role: "pod"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -3,12 +3,12 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: endpoints
|
- role: endpoints
|
||||||
selectors:
|
selectors:
|
||||||
- role: "node"
|
- role: "node"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
- role: "service"
|
- role: "service"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
- role: "endpoints"
|
- role: "endpoints"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -3,12 +3,12 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: endpoints
|
- role: endpoints
|
||||||
selectors:
|
selectors:
|
||||||
- role: "pod"
|
- role: "pod"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
- role: "service"
|
- role: "service"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
- role: "endpoints"
|
- role: "endpoints"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: endpoints
|
- role: endpoints
|
||||||
selectors:
|
selectors:
|
||||||
- role: "pod"
|
- role: "pod"
|
||||||
field: "metadata.status-Running"
|
field: "metadata.status-Running"
|
||||||
|
|
|
@ -3,6 +3,6 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: ingress
|
- role: ingress
|
||||||
selectors:
|
selectors:
|
||||||
- role: "node"
|
- role: "node"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -3,6 +3,6 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: ingress
|
- role: ingress
|
||||||
selectors:
|
selectors:
|
||||||
- role: "ingress"
|
- role: "ingress"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -3,6 +3,6 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: node
|
- role: node
|
||||||
selectors:
|
selectors:
|
||||||
- role: "pod"
|
- role: "pod"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -3,6 +3,6 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: node
|
- role: node
|
||||||
selectors:
|
selectors:
|
||||||
- role: "node"
|
- role: "node"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -3,6 +3,6 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: pod
|
- role: pod
|
||||||
selectors:
|
selectors:
|
||||||
- role: "node"
|
- role: "node"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -3,11 +3,11 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: pod
|
- role: pod
|
||||||
selectors:
|
selectors:
|
||||||
- role: "pod"
|
- role: "pod"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
- role: pod
|
- role: pod
|
||||||
selectors:
|
selectors:
|
||||||
- role: "pod"
|
- role: "pod"
|
||||||
label: "foo in (bar,baz)"
|
label: "foo in (bar,baz)"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -3,6 +3,6 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: service
|
- role: service
|
||||||
selectors:
|
selectors:
|
||||||
- role: "pod"
|
- role: "pod"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
|
@ -3,6 +3,6 @@ scrape_configs:
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: service
|
- role: service
|
||||||
selectors:
|
selectors:
|
||||||
- role: "service"
|
- role: "service"
|
||||||
label: "foo=bar"
|
label: "foo=bar"
|
||||||
field: "metadata.status=Running"
|
field: "metadata.status=Running"
|
||||||
|
|
2
config/testdata/labeldrop2.bad.yml
vendored
2
config/testdata/labeldrop2.bad.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- modulus: 8
|
- modulus: 8
|
||||||
action: labeldrop
|
action: labeldrop
|
||||||
|
|
2
config/testdata/labeldrop3.bad.yml
vendored
2
config/testdata/labeldrop3.bad.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- separator: ','
|
- separator: ","
|
||||||
action: labeldrop
|
action: labeldrop
|
||||||
|
|
2
config/testdata/labeldrop4.bad.yml
vendored
2
config/testdata/labeldrop4.bad.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- replacement: yolo-{1}
|
- replacement: yolo-{1}
|
||||||
action: labeldrop
|
action: labeldrop
|
||||||
|
|
2
config/testdata/labelkeep2.bad.yml
vendored
2
config/testdata/labelkeep2.bad.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- modulus: 8
|
- modulus: 8
|
||||||
action: labelkeep
|
action: labelkeep
|
||||||
|
|
2
config/testdata/labelkeep3.bad.yml
vendored
2
config/testdata/labelkeep3.bad.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- separator: ','
|
- separator: ","
|
||||||
action: labelkeep
|
action: labelkeep
|
||||||
|
|
2
config/testdata/labelkeep4.bad.yml
vendored
2
config/testdata/labelkeep4.bad.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- replacement: yolo-{1}
|
- replacement: yolo-{1}
|
||||||
action: labelkeep
|
action: labelkeep
|
||||||
|
|
2
config/testdata/labelvalue.bad.yml
vendored
2
config/testdata/labelvalue.bad.yml
vendored
|
@ -1,3 +1,3 @@
|
||||||
global:
|
global:
|
||||||
external_labels:
|
external_labels:
|
||||||
name: !!binary "/w=="
|
name: !!binary "/w=="
|
||||||
|
|
|
@ -2,9 +2,9 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
marathon_sd_configs:
|
marathon_sd_configs:
|
||||||
- servers:
|
- servers:
|
||||||
- 'https://localhost:1234'
|
- "https://localhost:1234"
|
||||||
|
|
||||||
auth_token: 1234
|
auth_token: 1234
|
||||||
authorization:
|
authorization:
|
||||||
credentials: 4567
|
credentials: 4567
|
||||||
|
|
|
@ -2,8 +2,8 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
marathon_sd_configs:
|
marathon_sd_configs:
|
||||||
- servers:
|
- servers:
|
||||||
- 'https://localhost:1234'
|
- "https://localhost:1234"
|
||||||
|
|
||||||
auth_token: 1234
|
auth_token: 1234
|
||||||
auth_token_file: somefile
|
auth_token_file: somefile
|
||||||
|
|
|
@ -2,10 +2,10 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
marathon_sd_configs:
|
marathon_sd_configs:
|
||||||
- servers:
|
- servers:
|
||||||
- 'https://localhost:1234'
|
- "https://localhost:1234"
|
||||||
|
|
||||||
auth_token: 1234
|
auth_token: 1234
|
||||||
basic_auth:
|
basic_auth:
|
||||||
username: user
|
username: user
|
||||||
password: password
|
password: password
|
||||||
|
|
|
@ -2,8 +2,8 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
marathon_sd_configs:
|
marathon_sd_configs:
|
||||||
- servers:
|
- servers:
|
||||||
- 'https://localhost:1234'
|
- "https://localhost:1234"
|
||||||
|
|
||||||
auth_token: 1234
|
auth_token: 1234
|
||||||
bearer_token: 4567
|
bearer_token: 4567
|
||||||
|
|
9
config/testdata/marathon_no_servers.bad.yml
vendored
9
config/testdata/marathon_no_servers.bad.yml
vendored
|
@ -1,10 +1,9 @@
|
||||||
# my global config
|
# my global config
|
||||||
global:
|
global:
|
||||||
scrape_interval: 15s
|
scrape_interval: 15s
|
||||||
evaluation_interval: 30s
|
evaluation_interval: 30s
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
|
- job_name: service-marathon
|
||||||
- job_name: service-marathon
|
marathon_sd_configs:
|
||||||
marathon_sd_configs:
|
- servers:
|
||||||
- servers:
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- openstack_sd_configs:
|
- openstack_sd_configs:
|
||||||
- availability: invalid
|
- availability: invalid
|
||||||
|
|
||||||
|
|
5
config/testdata/openstack_role.bad.yml
vendored
5
config/testdata/openstack_role.bad.yml
vendored
|
@ -1,4 +1,3 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- openstack_sd_configs:
|
- openstack_sd_configs:
|
||||||
- role: invalid
|
- role: invalid
|
||||||
|
|
||||||
|
|
2
config/testdata/remote_read_header.bad.yml
vendored
2
config/testdata/remote_read_header.bad.yml
vendored
|
@ -2,4 +2,4 @@ remote_read:
|
||||||
- url: localhost:9090
|
- url: localhost:9090
|
||||||
name: queue1
|
name: queue1
|
||||||
headers:
|
headers:
|
||||||
"x-prometheus-remote-write-version": "somehack"
|
"x-prometheus-remote-write-version": "somehack"
|
||||||
|
|
1
config/testdata/remote_write_dup.bad.yml
vendored
1
config/testdata/remote_write_dup.bad.yml
vendored
|
@ -3,4 +3,3 @@ remote_write:
|
||||||
name: queue1
|
name: queue1
|
||||||
- url: localhost:9091
|
- url: localhost:9091
|
||||||
name: queue1
|
name: queue1
|
||||||
|
|
||||||
|
|
277
config/testdata/roundtrip.good.yml
vendored
277
config/testdata/roundtrip.good.yml
vendored
|
@ -1,147 +1,146 @@
|
||||||
alerting:
|
alerting:
|
||||||
alertmanagers:
|
alertmanagers:
|
||||||
- scheme: https
|
- scheme: https
|
||||||
|
|
||||||
|
file_sd_configs:
|
||||||
|
- files:
|
||||||
|
- foo/*.slow.json
|
||||||
|
- foo/*.slow.yml
|
||||||
|
refresh_interval: 10m
|
||||||
|
- files:
|
||||||
|
- bar/*.yaml
|
||||||
|
|
||||||
|
static_configs:
|
||||||
|
- targets:
|
||||||
|
- 1.2.3.4:9093
|
||||||
|
- 1.2.3.5:9093
|
||||||
|
- 1.2.3.6:9093
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: foo
|
||||||
|
static_configs:
|
||||||
|
- targets:
|
||||||
|
- localhost:9090
|
||||||
|
- localhost:9191
|
||||||
|
labels:
|
||||||
|
my: label
|
||||||
|
your: label
|
||||||
|
|
||||||
|
- job_name: bar
|
||||||
|
|
||||||
|
azure_sd_configs:
|
||||||
|
- environment: AzurePublicCloud
|
||||||
|
authentication_method: OAuth
|
||||||
|
subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
||||||
|
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
||||||
|
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
||||||
|
client_secret: <secret>
|
||||||
|
port: 9100
|
||||||
|
|
||||||
|
consul_sd_configs:
|
||||||
|
- server: localhost:1234
|
||||||
|
token: <secret>
|
||||||
|
services: [nginx, cache, mysql]
|
||||||
|
tags: [canary, v1]
|
||||||
|
node_meta:
|
||||||
|
rack: "123"
|
||||||
|
allow_stale: true
|
||||||
|
scheme: https
|
||||||
|
tls_config:
|
||||||
|
ca_file: valid_ca_file
|
||||||
|
cert_file: valid_cert_file
|
||||||
|
key_file: valid_key_file
|
||||||
|
|
||||||
|
digitalocean_sd_configs:
|
||||||
|
- authorization:
|
||||||
|
credentials: <secret>
|
||||||
|
|
||||||
|
docker_sd_configs:
|
||||||
|
- host: unix:///var/run/docker.sock
|
||||||
|
|
||||||
|
dockerswarm_sd_configs:
|
||||||
|
- host: http://127.0.0.1:2375
|
||||||
|
role: nodes
|
||||||
|
|
||||||
|
dns_sd_configs:
|
||||||
|
- refresh_interval: 15s
|
||||||
|
names:
|
||||||
|
- first.dns.address.domain.com
|
||||||
|
- second.dns.address.domain.com
|
||||||
|
- names:
|
||||||
|
- first.dns.address.domain.com
|
||||||
|
|
||||||
|
ec2_sd_configs:
|
||||||
|
- region: us-east-1
|
||||||
|
access_key: access
|
||||||
|
secret_key: <secret>
|
||||||
|
profile: profile
|
||||||
|
filters:
|
||||||
|
- name: tag:environment
|
||||||
|
values:
|
||||||
|
- prod
|
||||||
|
- name: tag:service
|
||||||
|
values:
|
||||||
|
- web
|
||||||
|
- db
|
||||||
|
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
- files:
|
- files:
|
||||||
- foo/*.slow.json
|
- single/file.yml
|
||||||
- foo/*.slow.yml
|
|
||||||
refresh_interval: 10m
|
kubernetes_sd_configs:
|
||||||
- files:
|
- role: endpoints
|
||||||
- bar/*.yaml
|
api_server: https://localhost:1234
|
||||||
|
tls_config:
|
||||||
|
cert_file: valid_cert_file
|
||||||
|
key_file: valid_key_file
|
||||||
|
basic_auth:
|
||||||
|
username: username
|
||||||
|
password: <secret>
|
||||||
|
- role: endpoints
|
||||||
|
api_server: https://localhost:1234
|
||||||
|
namespaces:
|
||||||
|
names:
|
||||||
|
- default
|
||||||
|
basic_auth:
|
||||||
|
username: username
|
||||||
|
password_file: valid_password_file
|
||||||
|
|
||||||
|
marathon_sd_configs:
|
||||||
|
- servers:
|
||||||
|
- https://marathon.example.com:443
|
||||||
|
auth_token: <secret>
|
||||||
|
tls_config:
|
||||||
|
cert_file: valid_cert_file
|
||||||
|
key_file: valid_key_file
|
||||||
|
|
||||||
|
nerve_sd_configs:
|
||||||
|
- servers:
|
||||||
|
- localhost
|
||||||
|
paths:
|
||||||
|
- /monitoring
|
||||||
|
|
||||||
|
openstack_sd_configs:
|
||||||
|
- role: instance
|
||||||
|
region: RegionOne
|
||||||
|
port: 80
|
||||||
|
refresh_interval: 1m
|
||||||
|
tls_config:
|
||||||
|
ca_file: valid_ca_file
|
||||||
|
cert_file: valid_cert_file
|
||||||
|
key_file: valid_key_file
|
||||||
|
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
- 1.2.3.4:9093
|
- localhost:9093
|
||||||
- 1.2.3.5:9093
|
|
||||||
- 1.2.3.6:9093
|
|
||||||
|
|
||||||
scrape_configs:
|
triton_sd_configs:
|
||||||
|
- account: testAccount
|
||||||
- job_name: foo
|
dns_suffix: triton.example.com
|
||||||
static_configs:
|
endpoint: triton.example.com
|
||||||
- targets:
|
port: 9163
|
||||||
- localhost:9090
|
refresh_interval: 1m
|
||||||
- localhost:9191
|
version: 1
|
||||||
labels:
|
tls_config:
|
||||||
my: label
|
cert_file: valid_cert_file
|
||||||
your: label
|
key_file: valid_key_file
|
||||||
|
|
||||||
- job_name: bar
|
|
||||||
|
|
||||||
azure_sd_configs:
|
|
||||||
- environment: AzurePublicCloud
|
|
||||||
authentication_method: OAuth
|
|
||||||
subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
|
|
||||||
tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
|
|
||||||
client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
|
|
||||||
client_secret: <secret>
|
|
||||||
port: 9100
|
|
||||||
|
|
||||||
consul_sd_configs:
|
|
||||||
- server: localhost:1234
|
|
||||||
token: <secret>
|
|
||||||
services: [nginx, cache, mysql]
|
|
||||||
tags: [canary, v1]
|
|
||||||
node_meta:
|
|
||||||
rack: "123"
|
|
||||||
allow_stale: true
|
|
||||||
scheme: https
|
|
||||||
tls_config:
|
|
||||||
ca_file: valid_ca_file
|
|
||||||
cert_file: valid_cert_file
|
|
||||||
key_file: valid_key_file
|
|
||||||
|
|
||||||
digitalocean_sd_configs:
|
|
||||||
- authorization:
|
|
||||||
credentials: <secret>
|
|
||||||
|
|
||||||
docker_sd_configs:
|
|
||||||
- host: unix:///var/run/docker.sock
|
|
||||||
|
|
||||||
dockerswarm_sd_configs:
|
|
||||||
- host: http://127.0.0.1:2375
|
|
||||||
role: nodes
|
|
||||||
|
|
||||||
dns_sd_configs:
|
|
||||||
- refresh_interval: 15s
|
|
||||||
names:
|
|
||||||
- first.dns.address.domain.com
|
|
||||||
- second.dns.address.domain.com
|
|
||||||
- names:
|
|
||||||
- first.dns.address.domain.com
|
|
||||||
|
|
||||||
ec2_sd_configs:
|
|
||||||
- region: us-east-1
|
|
||||||
access_key: access
|
|
||||||
secret_key: <secret>
|
|
||||||
profile: profile
|
|
||||||
filters:
|
|
||||||
- name: tag:environment
|
|
||||||
values:
|
|
||||||
- prod
|
|
||||||
- name: tag:service
|
|
||||||
values:
|
|
||||||
- web
|
|
||||||
- db
|
|
||||||
|
|
||||||
file_sd_configs:
|
|
||||||
- files:
|
|
||||||
- single/file.yml
|
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: endpoints
|
|
||||||
api_server: https://localhost:1234
|
|
||||||
tls_config:
|
|
||||||
cert_file: valid_cert_file
|
|
||||||
key_file: valid_key_file
|
|
||||||
basic_auth:
|
|
||||||
username: username
|
|
||||||
password: <secret>
|
|
||||||
- role: endpoints
|
|
||||||
api_server: https://localhost:1234
|
|
||||||
namespaces:
|
|
||||||
names:
|
|
||||||
- default
|
|
||||||
basic_auth:
|
|
||||||
username: username
|
|
||||||
password_file: valid_password_file
|
|
||||||
|
|
||||||
marathon_sd_configs:
|
|
||||||
- servers:
|
|
||||||
- https://marathon.example.com:443
|
|
||||||
auth_token: <secret>
|
|
||||||
tls_config:
|
|
||||||
cert_file: valid_cert_file
|
|
||||||
key_file: valid_key_file
|
|
||||||
|
|
||||||
nerve_sd_configs:
|
|
||||||
- servers:
|
|
||||||
- localhost
|
|
||||||
paths:
|
|
||||||
- /monitoring
|
|
||||||
|
|
||||||
openstack_sd_configs:
|
|
||||||
- role: instance
|
|
||||||
region: RegionOne
|
|
||||||
port: 80
|
|
||||||
refresh_interval: 1m
|
|
||||||
tls_config:
|
|
||||||
ca_file: valid_ca_file
|
|
||||||
cert_file: valid_cert_file
|
|
||||||
key_file: valid_key_file
|
|
||||||
|
|
||||||
static_configs:
|
|
||||||
- targets:
|
|
||||||
- localhost:9093
|
|
||||||
|
|
||||||
triton_sd_configs:
|
|
||||||
- account: testAccount
|
|
||||||
dns_suffix: triton.example.com
|
|
||||||
endpoint: triton.example.com
|
|
||||||
port: 9163
|
|
||||||
refresh_interval: 1m
|
|
||||||
version: 1
|
|
||||||
tls_config:
|
|
||||||
cert_file: valid_cert_file
|
|
||||||
key_file: valid_key_file
|
|
||||||
|
|
8
config/testdata/scaleway_no_secret.bad.yml
vendored
8
config/testdata/scaleway_no_secret.bad.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- scaleway_sd_configs:
|
- scaleway_sd_configs:
|
||||||
- role: instance
|
- role: instance
|
||||||
project_id: 11111111-1111-1111-1111-111111111112
|
project_id: 11111111-1111-1111-1111-111111111112
|
||||||
access_key: SCWXXXXXXXXXXXXXXXXX
|
access_key: SCWXXXXXXXXXXXXXXXXX
|
||||||
|
|
11
config/testdata/scaleway_role.bad.yml
vendored
11
config/testdata/scaleway_role.bad.yml
vendored
|
@ -1,7 +1,6 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- scaleway_sd_configs:
|
- scaleway_sd_configs:
|
||||||
- role: invalid
|
- role: invalid
|
||||||
project_id: 11111111-1111-1111-1111-111111111112
|
project_id: 11111111-1111-1111-1111-111111111112
|
||||||
access_key: SCWXXXXXXXXXXXXXXXXX
|
access_key: SCWXXXXXXXXXXXXXXXXX
|
||||||
secret_key_file: bar
|
secret_key_file: bar
|
||||||
|
|
||||||
|
|
13
config/testdata/scaleway_two_secrets.bad.yml
vendored
13
config/testdata/scaleway_two_secrets.bad.yml
vendored
|
@ -1,8 +1,7 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- scaleway_sd_configs:
|
- scaleway_sd_configs:
|
||||||
- role: instance
|
- role: instance
|
||||||
project_id: 11111111-1111-1111-1111-111111111112
|
project_id: 11111111-1111-1111-1111-111111111112
|
||||||
access_key: SCWXXXXXXXXXXXXXXXXX
|
access_key: SCWXXXXXXXXXXXXXXXXX
|
||||||
secret_key_file: bar
|
secret_key_file: bar
|
||||||
secret_key: 11111111-1111-1111-1111-111111111112
|
secret_key: 11111111-1111-1111-1111-111111111112
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
body_size_limit: 100
|
body_size_limit: 100
|
||||||
|
|
6
config/testdata/scrape_interval.bad.yml
vendored
6
config/testdata/scrape_interval.bad.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
scrape_interval: 5s
|
scrape_interval: 5s
|
||||||
scrape_timeout: 6s
|
scrape_timeout: 6s
|
||||||
|
|
22
config/testdata/scrape_interval_larger.good.yml
vendored
22
config/testdata/scrape_interval_larger.good.yml
vendored
|
@ -1,16 +1,16 @@
|
||||||
global:
|
global:
|
||||||
scrape_interval: 15s
|
scrape_interval: 15s
|
||||||
scrape_timeout: 15s
|
scrape_timeout: 15s
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
scrape_interval: 5s
|
scrape_interval: 5s
|
||||||
|
|
||||||
dns_sd_configs:
|
dns_sd_configs:
|
||||||
- refresh_interval: 15s
|
- refresh_interval: 15s
|
||||||
names:
|
names:
|
||||||
- first.dns.address.domain.com
|
- first.dns.address.domain.com
|
||||||
- second.dns.address.domain.com
|
- second.dns.address.domain.com
|
||||||
- names:
|
- names:
|
||||||
- first.dns.address.domain.com
|
- first.dns.address.domain.com
|
||||||
|
|
|
@ -2,5 +2,5 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- source_labels: [__address__]
|
- source_labels: [__address__]
|
||||||
modulus: 8
|
modulus: 8
|
||||||
action: hashmod
|
action: hashmod
|
||||||
|
|
8
config/testdata/unknown_attr.bad.yml
vendored
8
config/testdata/unknown_attr.bad.yml
vendored
|
@ -1,12 +1,12 @@
|
||||||
# my global config
|
# my global config
|
||||||
global:
|
global:
|
||||||
scrape_interval: 15s
|
scrape_interval: 15s
|
||||||
evaluation_interval: 30s
|
evaluation_interval: 30s
|
||||||
# scrape_timeout is set to the global default (10s).
|
# scrape_timeout is set to the global default (10s).
|
||||||
|
|
||||||
external_labels:
|
external_labels:
|
||||||
monitor: codelab
|
monitor: codelab
|
||||||
foo: bar
|
foo: bar
|
||||||
|
|
||||||
rule_files:
|
rule_files:
|
||||||
- "first.rules"
|
- "first.rules"
|
||||||
|
@ -17,4 +17,4 @@ scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
consult_sd_configs:
|
consult_sd_configs:
|
||||||
- server: 'localhost:1234'
|
- server: "localhost:1234"
|
||||||
|
|
8
config/testdata/url_in_targetgroup.bad.yml
vendored
8
config/testdata/url_in_targetgroup.bad.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
- http://bad
|
- http://bad
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# the YAML structure is identical to valid.yml but the raw data is different.
|
# the YAML structure is identical to valid.yml but the raw data is different.
|
||||||
- targets: ['localhost:9090', 'example.org:443']
|
- targets: ["localhost:9090", "example.org:443"]
|
||||||
labels:
|
labels:
|
||||||
foo: bar
|
foo: bar
|
||||||
|
|
||||||
- targets: ['my.domain']
|
- targets: ["my.domain"]
|
||||||
|
|
||||||
|
|
|
@ -13,15 +13,15 @@ spec:
|
||||||
app: rabbitmq
|
app: rabbitmq
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: rabbitmq:3.5.4-management
|
- image: rabbitmq:3.5.4-management
|
||||||
name: rabbitmq
|
name: rabbitmq
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5672
|
- containerPort: 5672
|
||||||
name: service
|
name: service
|
||||||
- containerPort: 15672
|
- containerPort: 15672
|
||||||
name: management
|
name: management
|
||||||
- image: kbudde/rabbitmq-exporter
|
- image: kbudde/rabbitmq-exporter
|
||||||
name: rabbitmq-exporter
|
name: rabbitmq-exporter
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9090
|
- containerPort: 9090
|
||||||
name: exporter
|
name: exporter
|
||||||
|
|
|
@ -6,9 +6,9 @@ metadata:
|
||||||
name: rabbitmq
|
name: rabbitmq
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- port: 9090
|
- port: 9090
|
||||||
name: exporter
|
name: exporter
|
||||||
targetPort: exporter
|
targetPort: exporter
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
selector:
|
selector:
|
||||||
app: rabbitmq
|
app: rabbitmq
|
||||||
|
|
|
@ -2,14 +2,13 @@
|
||||||
# DigitalOcean.
|
# DigitalOcean.
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
|
|
||||||
# Make Prometheus scrape itself for metrics.
|
# Make Prometheus scrape itself for metrics.
|
||||||
- job_name: 'prometheus'
|
- job_name: "prometheus"
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['localhost:9090']
|
- targets: ["localhost:9090"]
|
||||||
|
|
||||||
# Discover Node Exporter instances to scrape.
|
# Discover Node Exporter instances to scrape.
|
||||||
- job_name: 'node'
|
- job_name: "node"
|
||||||
|
|
||||||
digitalocean_sd_configs:
|
digitalocean_sd_configs:
|
||||||
- authorization:
|
- authorization:
|
||||||
|
@ -17,10 +16,10 @@ scrape_configs:
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
# Only scrape targets that have a tag 'monitoring'.
|
# Only scrape targets that have a tag 'monitoring'.
|
||||||
- source_labels: [__meta_digitalocean_tags]
|
- source_labels: [__meta_digitalocean_tags]
|
||||||
regex: '.*,monitoring,.*'
|
regex: ".*,monitoring,.*"
|
||||||
action: keep
|
action: keep
|
||||||
|
|
||||||
# Use the public IPv6 address and port 9100 to scrape the target.
|
# Use the public IPv6 address and port 9100 to scrape the target.
|
||||||
- source_labels: [__meta_digitalocean_public_ipv6]
|
- source_labels: [__meta_digitalocean_public_ipv6]
|
||||||
target_label: __address__
|
target_label: __address__
|
||||||
replacement: '[$1]:9100'
|
replacement: "[$1]:9100"
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
# A example scrape configuration for running Prometheus with Docker.
|
# A example scrape configuration for running Prometheus with Docker.
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
|
|
||||||
# Make Prometheus scrape itself for metrics.
|
# Make Prometheus scrape itself for metrics.
|
||||||
- job_name: 'prometheus'
|
- job_name: "prometheus"
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['localhost:9090']
|
- targets: ["localhost:9090"]
|
||||||
|
|
||||||
# Create a job for Docker daemon.
|
# Create a job for Docker daemon.
|
||||||
#
|
#
|
||||||
# This example requires Docker daemon to be configured to expose
|
# This example requires Docker daemon to be configured to expose
|
||||||
# Prometheus metrics, as documented here:
|
# Prometheus metrics, as documented here:
|
||||||
# https://docs.docker.com/config/daemon/prometheus/
|
# https://docs.docker.com/config/daemon/prometheus/
|
||||||
- job_name: 'docker'
|
- job_name: "docker"
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['localhost:9323']
|
- targets: ["localhost:9323"]
|
||||||
|
|
||||||
# Create a job for Docker Swarm containers.
|
# Create a job for Docker Swarm containers.
|
||||||
#
|
#
|
||||||
|
@ -26,7 +25,7 @@ scrape_configs:
|
||||||
# --mount type=bind,src=/sys,dst=/sys,ro
|
# --mount type=bind,src=/sys,dst=/sys,ro
|
||||||
# --mount type=bind,src=/var/lib/docker,dst=/var/lib/docker,ro
|
# --mount type=bind,src=/var/lib/docker,dst=/var/lib/docker,ro
|
||||||
# google/cadvisor -docker_only
|
# google/cadvisor -docker_only
|
||||||
- job_name: 'docker-containers'
|
- job_name: "docker-containers"
|
||||||
docker_sd_configs:
|
docker_sd_configs:
|
||||||
- host: unix:///var/run/docker.sock # You can also use http/https to connect to the Docker daemon.
|
- host: unix:///var/run/docker.sock # You can also use http/https to connect to the Docker daemon.
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
|
|
|
@ -2,18 +2,17 @@
|
||||||
# Docker Swarm.
|
# Docker Swarm.
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
|
|
||||||
# Make Prometheus scrape itself for metrics.
|
# Make Prometheus scrape itself for metrics.
|
||||||
- job_name: 'prometheus'
|
- job_name: "prometheus"
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['localhost:9090']
|
- targets: ["localhost:9090"]
|
||||||
|
|
||||||
# Create a job for Docker daemons.
|
# Create a job for Docker daemons.
|
||||||
#
|
#
|
||||||
# This example requires Docker daemons to be configured to expose
|
# This example requires Docker daemons to be configured to expose
|
||||||
# Prometheus metrics, as documented here:
|
# Prometheus metrics, as documented here:
|
||||||
# https://docs.docker.com/config/daemon/prometheus/
|
# https://docs.docker.com/config/daemon/prometheus/
|
||||||
- job_name: 'docker'
|
- job_name: "docker"
|
||||||
dockerswarm_sd_configs:
|
dockerswarm_sd_configs:
|
||||||
- host: unix:///var/run/docker.sock # You can also use http/https to connect to the Docker daemon.
|
- host: unix:///var/run/docker.sock # You can also use http/https to connect to the Docker daemon.
|
||||||
role: nodes
|
role: nodes
|
||||||
|
@ -34,7 +33,7 @@ scrape_configs:
|
||||||
# --mount type=bind,src=/sys,dst=/sys,ro
|
# --mount type=bind,src=/sys,dst=/sys,ro
|
||||||
# --mount type=bind,src=/var/lib/docker,dst=/var/lib/docker,ro
|
# --mount type=bind,src=/var/lib/docker,dst=/var/lib/docker,ro
|
||||||
# google/cadvisor -docker_only
|
# google/cadvisor -docker_only
|
||||||
- job_name: 'dockerswarm'
|
- job_name: "dockerswarm"
|
||||||
dockerswarm_sd_configs:
|
dockerswarm_sd_configs:
|
||||||
- host: unix:///var/run/docker.sock # You can also use http/https to connect to the Docker daemon.
|
- host: unix:///var/run/docker.sock # You can also use http/https to connect to the Docker daemon.
|
||||||
role: tasks
|
role: tasks
|
||||||
|
@ -51,4 +50,3 @@ scrape_configs:
|
||||||
- regex: __meta_dockerswarm_service_label_prometheus_(.+)
|
- regex: __meta_dockerswarm_service_label_prometheus_(.+)
|
||||||
action: labelmap
|
action: labelmap
|
||||||
replacement: $1
|
replacement: $1
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,13 @@
|
||||||
# Hetzner.
|
# Hetzner.
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
|
|
||||||
# Make Prometheus scrape itself for metrics.
|
# Make Prometheus scrape itself for metrics.
|
||||||
- job_name: 'prometheus'
|
- job_name: "prometheus"
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['localhost:9090']
|
- targets: ["localhost:9090"]
|
||||||
|
|
||||||
# Discover Node Exporter instances to scrape.
|
# Discover Node Exporter instances to scrape.
|
||||||
- job_name: 'node'
|
- job_name: "node"
|
||||||
|
|
||||||
hetzner_sd_configs:
|
hetzner_sd_configs:
|
||||||
- authorization:
|
- authorization:
|
||||||
|
@ -19,10 +18,10 @@ scrape_configs:
|
||||||
# Use the public IPv4 and port 9100 to scrape the target.
|
# Use the public IPv4 and port 9100 to scrape the target.
|
||||||
- source_labels: [__meta_hetzner_public_ipv4]
|
- source_labels: [__meta_hetzner_public_ipv4]
|
||||||
target_label: __address__
|
target_label: __address__
|
||||||
replacement: '$1:9100'
|
replacement: "$1:9100"
|
||||||
|
|
||||||
# Discover Node Exporter instances to scrape using a Hetzner Cloud Network called mynet.
|
# Discover Node Exporter instances to scrape using a Hetzner Cloud Network called mynet.
|
||||||
- job_name: 'node_private'
|
- job_name: "node_private"
|
||||||
|
|
||||||
hetzner_sd_configs:
|
hetzner_sd_configs:
|
||||||
- authorization:
|
- authorization:
|
||||||
|
@ -32,10 +31,10 @@ scrape_configs:
|
||||||
# Use the private IPv4 within the Hetzner Cloud Network and port 9100 to scrape the target.
|
# Use the private IPv4 within the Hetzner Cloud Network and port 9100 to scrape the target.
|
||||||
- source_labels: [__meta_hetzner_hcloud_private_ipv4_mynet]
|
- source_labels: [__meta_hetzner_hcloud_private_ipv4_mynet]
|
||||||
target_label: __address__
|
target_label: __address__
|
||||||
replacement: '$1:9100'
|
replacement: "$1:9100"
|
||||||
|
|
||||||
# Discover Node Exporter instances to scrape.
|
# Discover Node Exporter instances to scrape.
|
||||||
- job_name: 'node_robot'
|
- job_name: "node_robot"
|
||||||
|
|
||||||
hetzner_sd_configs:
|
hetzner_sd_configs:
|
||||||
- basic_auth:
|
- basic_auth:
|
||||||
|
@ -46,4 +45,4 @@ scrape_configs:
|
||||||
# Use the public IPv4 and port 9100 to scrape the target.
|
# Use the public IPv4 and port 9100 to scrape the target.
|
||||||
- source_labels: [__meta_hetzner_public_ipv4]
|
- source_labels: [__meta_hetzner_public_ipv4]
|
||||||
target_label: __address__
|
target_label: __address__
|
||||||
replacement: '$1:9100'
|
replacement: "$1:9100"
|
||||||
|
|
|
@ -16,275 +16,285 @@
|
||||||
# default named port `https`. This works for single API server deployments as
|
# default named port `https`. This works for single API server deployments as
|
||||||
# well as HA API server deployments.
|
# well as HA API server deployments.
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: 'kubernetes-apiservers'
|
- job_name: "kubernetes-apiservers"
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: endpoints
|
- role: endpoints
|
||||||
|
|
||||||
# Default to scraping over https. If required, just disable this or change to
|
# Default to scraping over https. If required, just disable this or change to
|
||||||
# `http`.
|
# `http`.
|
||||||
scheme: https
|
scheme: https
|
||||||
|
|
||||||
# This TLS & authorization config is used to connect to the actual scrape
|
# This TLS & authorization config is used to connect to the actual scrape
|
||||||
# endpoints for cluster components. This is separate to discovery auth
|
# endpoints for cluster components. This is separate to discovery auth
|
||||||
# configuration because discovery & scraping are two separate concerns in
|
# configuration because discovery & scraping are two separate concerns in
|
||||||
# Prometheus. The discovery auth config is automatic if Prometheus runs inside
|
# Prometheus. The discovery auth config is automatic if Prometheus runs inside
|
||||||
# the cluster. Otherwise, more config options have to be provided within the
|
# the cluster. Otherwise, more config options have to be provided within the
|
||||||
# <kubernetes_sd_config>.
|
# <kubernetes_sd_config>.
|
||||||
tls_config:
|
tls_config:
|
||||||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
||||||
# If your node certificates are self-signed or use a different CA to the
|
# If your node certificates are self-signed or use a different CA to the
|
||||||
# master CA, then disable certificate verification below. Note that
|
# master CA, then disable certificate verification below. Note that
|
||||||
# certificate verification is an integral part of a secure infrastructure
|
# certificate verification is an integral part of a secure infrastructure
|
||||||
# so this should only be disabled in a controlled environment. You can
|
# so this should only be disabled in a controlled environment. You can
|
||||||
# disable certificate verification by uncommenting the line below.
|
# disable certificate verification by uncommenting the line below.
|
||||||
#
|
#
|
||||||
# insecure_skip_verify: true
|
# insecure_skip_verify: true
|
||||||
authorization:
|
authorization:
|
||||||
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
||||||
|
|
||||||
# Keep only the default/kubernetes service endpoints for the https port. This
|
# Keep only the default/kubernetes service endpoints for the https port. This
|
||||||
# will add targets for each API server which Kubernetes adds an endpoint to
|
# will add targets for each API server which Kubernetes adds an endpoint to
|
||||||
# the default/kubernetes service.
|
# the default/kubernetes service.
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
|
- source_labels:
|
||||||
action: keep
|
[
|
||||||
regex: default;kubernetes;https
|
__meta_kubernetes_namespace,
|
||||||
|
__meta_kubernetes_service_name,
|
||||||
|
__meta_kubernetes_endpoint_port_name,
|
||||||
|
]
|
||||||
|
action: keep
|
||||||
|
regex: default;kubernetes;https
|
||||||
|
|
||||||
# Scrape config for nodes (kubelet).
|
# Scrape config for nodes (kubelet).
|
||||||
#
|
|
||||||
# Rather than connecting directly to the node, the scrape is proxied though the
|
|
||||||
# Kubernetes apiserver. This means it will work if Prometheus is running out of
|
|
||||||
# cluster, or can't connect to nodes for some other reason (e.g. because of
|
|
||||||
# firewalling).
|
|
||||||
- job_name: 'kubernetes-nodes'
|
|
||||||
|
|
||||||
# Default to scraping over https. If required, just disable this or change to
|
|
||||||
# `http`.
|
|
||||||
scheme: https
|
|
||||||
|
|
||||||
# This TLS & authorization config is used to connect to the actual scrape
|
|
||||||
# endpoints for cluster components. This is separate to discovery auth
|
|
||||||
# configuration because discovery & scraping are two separate concerns in
|
|
||||||
# Prometheus. The discovery auth config is automatic if Prometheus runs inside
|
|
||||||
# the cluster. Otherwise, more config options have to be provided within the
|
|
||||||
# <kubernetes_sd_config>.
|
|
||||||
tls_config:
|
|
||||||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
||||||
# If your node certificates are self-signed or use a different CA to the
|
|
||||||
# master CA, then disable certificate verification below. Note that
|
|
||||||
# certificate verification is an integral part of a secure infrastructure
|
|
||||||
# so this should only be disabled in a controlled environment. You can
|
|
||||||
# disable certificate verification by uncommenting the line below.
|
|
||||||
#
|
|
||||||
# insecure_skip_verify: true
|
|
||||||
authorization:
|
|
||||||
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: node
|
|
||||||
|
|
||||||
relabel_configs:
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_node_label_(.+)
|
|
||||||
|
|
||||||
# Scrape config for Kubelet cAdvisor.
|
|
||||||
#
|
|
||||||
# This is required for Kubernetes 1.7.3 and later, where cAdvisor metrics
|
|
||||||
# (those whose names begin with 'container_') have been removed from the
|
|
||||||
# Kubelet metrics endpoint. This job scrapes the cAdvisor endpoint to
|
|
||||||
# retrieve those metrics.
|
|
||||||
#
|
|
||||||
# In Kubernetes 1.7.0-1.7.2, these metrics are only exposed on the cAdvisor
|
|
||||||
# HTTP endpoint; use the "/metrics" endpoint on the 4194 port of nodes. In
|
|
||||||
# that case (and ensure cAdvisor's HTTP server hasn't been disabled with the
|
|
||||||
# --cadvisor-port=0 Kubelet flag).
|
|
||||||
#
|
|
||||||
# This job is not necessary and should be removed in Kubernetes 1.6 and
|
|
||||||
# earlier versions, or it will cause the metrics to be scraped twice.
|
|
||||||
- job_name: 'kubernetes-cadvisor'
|
|
||||||
|
|
||||||
# Default to scraping over https. If required, just disable this or change to
|
|
||||||
# `http`.
|
|
||||||
scheme: https
|
|
||||||
|
|
||||||
# Starting Kubernetes 1.7.3 the cAdvisor metrics are under /metrics/cadvisor.
|
|
||||||
# Kubernetes CIS Benchmark recommends against enabling the insecure HTTP
|
|
||||||
# servers of Kubernetes, therefore the cAdvisor metrics on the secure handler
|
|
||||||
# are used.
|
|
||||||
metrics_path: /metrics/cadvisor
|
|
||||||
|
|
||||||
# This TLS & authorization config is used to connect to the actual scrape
|
|
||||||
# endpoints for cluster components. This is separate to discovery auth
|
|
||||||
# configuration because discovery & scraping are two separate concerns in
|
|
||||||
# Prometheus. The discovery auth config is automatic if Prometheus runs inside
|
|
||||||
# the cluster. Otherwise, more config options have to be provided within the
|
|
||||||
# <kubernetes_sd_config>.
|
|
||||||
tls_config:
|
|
||||||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
||||||
# If your node certificates are self-signed or use a different CA to the
|
|
||||||
# master CA, then disable certificate verification below. Note that
|
|
||||||
# certificate verification is an integral part of a secure infrastructure
|
|
||||||
# so this should only be disabled in a controlled environment. You can
|
|
||||||
# disable certificate verification by uncommenting the line below.
|
|
||||||
#
|
|
||||||
# insecure_skip_verify: true
|
|
||||||
authorization:
|
|
||||||
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: node
|
|
||||||
|
|
||||||
relabel_configs:
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_node_label_(.+)
|
|
||||||
|
|
||||||
# Example scrape config for service endpoints.
|
|
||||||
#
|
|
||||||
# The relabeling allows the actual service scrape endpoint to be configured
|
|
||||||
# for all or only some endpoints.
|
|
||||||
- job_name: 'kubernetes-service-endpoints'
|
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: endpoints
|
|
||||||
|
|
||||||
relabel_configs:
|
|
||||||
# Example relabel to scrape only endpoints that have
|
|
||||||
# "example.io/should_be_scraped = true" annotation.
|
|
||||||
# - source_labels: [__meta_kubernetes_service_annotation_example_io_should_be_scraped]
|
|
||||||
# action: keep
|
|
||||||
# regex: true
|
|
||||||
#
|
#
|
||||||
# Example relabel to customize metric path based on endpoints
|
# Rather than connecting directly to the node, the scrape is proxied though the
|
||||||
# "example.io/metric_path = <metric path>" annotation.
|
# Kubernetes apiserver. This means it will work if Prometheus is running out of
|
||||||
# - source_labels: [__meta_kubernetes_service_annotation_example_io_metric_path]
|
# cluster, or can't connect to nodes for some other reason (e.g. because of
|
||||||
# action: replace
|
# firewalling).
|
||||||
# target_label: __metrics_path__
|
- job_name: "kubernetes-nodes"
|
||||||
# regex: (.+)
|
|
||||||
|
# Default to scraping over https. If required, just disable this or change to
|
||||||
|
# `http`.
|
||||||
|
scheme: https
|
||||||
|
|
||||||
|
# This TLS & authorization config is used to connect to the actual scrape
|
||||||
|
# endpoints for cluster components. This is separate to discovery auth
|
||||||
|
# configuration because discovery & scraping are two separate concerns in
|
||||||
|
# Prometheus. The discovery auth config is automatic if Prometheus runs inside
|
||||||
|
# the cluster. Otherwise, more config options have to be provided within the
|
||||||
|
# <kubernetes_sd_config>.
|
||||||
|
tls_config:
|
||||||
|
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
||||||
|
# If your node certificates are self-signed or use a different CA to the
|
||||||
|
# master CA, then disable certificate verification below. Note that
|
||||||
|
# certificate verification is an integral part of a secure infrastructure
|
||||||
|
# so this should only be disabled in a controlled environment. You can
|
||||||
|
# disable certificate verification by uncommenting the line below.
|
||||||
|
#
|
||||||
|
# insecure_skip_verify: true
|
||||||
|
authorization:
|
||||||
|
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
||||||
|
|
||||||
|
kubernetes_sd_configs:
|
||||||
|
- role: node
|
||||||
|
|
||||||
|
relabel_configs:
|
||||||
|
- action: labelmap
|
||||||
|
regex: __meta_kubernetes_node_label_(.+)
|
||||||
|
|
||||||
|
# Scrape config for Kubelet cAdvisor.
|
||||||
#
|
#
|
||||||
# Example relabel to scrape only single, desired port for the service based
|
# This is required for Kubernetes 1.7.3 and later, where cAdvisor metrics
|
||||||
# on endpoints "example.io/scrape_port = <port>" annotation.
|
# (those whose names begin with 'container_') have been removed from the
|
||||||
# - source_labels: [__address__, __meta_kubernetes_service_annotation_example_io_scrape_port]
|
# Kubelet metrics endpoint. This job scrapes the cAdvisor endpoint to
|
||||||
# action: replace
|
# retrieve those metrics.
|
||||||
# regex: ([^:]+)(?::\d+)?;(\d+)
|
|
||||||
# replacement: $1:$2
|
|
||||||
# target_label: __address__
|
|
||||||
#
|
#
|
||||||
# Example relabel to configure scrape scheme for all service scrape targets
|
# In Kubernetes 1.7.0-1.7.2, these metrics are only exposed on the cAdvisor
|
||||||
# based on endpoints "example.io/scrape_scheme = <scheme>" annotation.
|
# HTTP endpoint; use the "/metrics" endpoint on the 4194 port of nodes. In
|
||||||
# - source_labels: [__meta_kubernetes_service_annotation_example_io_scrape_scheme]
|
# that case (and ensure cAdvisor's HTTP server hasn't been disabled with the
|
||||||
# action: replace
|
# --cadvisor-port=0 Kubelet flag).
|
||||||
# target_label: __scheme__
|
|
||||||
# regex: (https?)
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_service_label_(.+)
|
|
||||||
- source_labels: [__meta_kubernetes_namespace]
|
|
||||||
action: replace
|
|
||||||
target_label: kubernetes_namespace
|
|
||||||
- source_labels: [__meta_kubernetes_service_name]
|
|
||||||
action: replace
|
|
||||||
target_label: kubernetes_name
|
|
||||||
|
|
||||||
# Example scrape config for probing services via the Blackbox Exporter.
|
|
||||||
#
|
|
||||||
# The relabeling allows the actual service scrape endpoint to be configured
|
|
||||||
# for all or only some services.
|
|
||||||
- job_name: 'kubernetes-services'
|
|
||||||
|
|
||||||
metrics_path: /probe
|
|
||||||
params:
|
|
||||||
module: [http_2xx]
|
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: service
|
|
||||||
|
|
||||||
relabel_configs:
|
|
||||||
# Example relabel to probe only some services that have "example.io/should_be_probed = true" annotation
|
|
||||||
# - source_labels: [__meta_kubernetes_service_annotation_example_io_should_be_probed]
|
|
||||||
# action: keep
|
|
||||||
# regex: true
|
|
||||||
- source_labels: [__address__]
|
|
||||||
target_label: __param_target
|
|
||||||
- target_label: __address__
|
|
||||||
replacement: blackbox-exporter.example.com:9115
|
|
||||||
- source_labels: [__param_target]
|
|
||||||
target_label: instance
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_service_label_(.+)
|
|
||||||
- source_labels: [__meta_kubernetes_namespace]
|
|
||||||
target_label: kubernetes_namespace
|
|
||||||
- source_labels: [__meta_kubernetes_service_name]
|
|
||||||
target_label: kubernetes_name
|
|
||||||
|
|
||||||
# Example scrape config for probing ingresses via the Blackbox Exporter.
|
|
||||||
#
|
|
||||||
# The relabeling allows the actual ingress scrape endpoint to be configured
|
|
||||||
# for all or only some services.
|
|
||||||
- job_name: 'kubernetes-ingresses'
|
|
||||||
|
|
||||||
metrics_path: /probe
|
|
||||||
params:
|
|
||||||
module: [http_2xx]
|
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: ingress
|
|
||||||
|
|
||||||
relabel_configs:
|
|
||||||
# Example relabel to probe only some ingresses that have "example.io/should_be_probed = true" annotation
|
|
||||||
# - source_labels: [__meta_kubernetes_ingress_annotation_example_io_should_be_probed]
|
|
||||||
# action: keep
|
|
||||||
# regex: true
|
|
||||||
- source_labels: [__meta_kubernetes_ingress_scheme,__address__,__meta_kubernetes_ingress_path]
|
|
||||||
regex: (.+);(.+);(.+)
|
|
||||||
replacement: ${1}://${2}${3}
|
|
||||||
target_label: __param_target
|
|
||||||
- target_label: __address__
|
|
||||||
replacement: blackbox-exporter.example.com:9115
|
|
||||||
- source_labels: [__param_target]
|
|
||||||
target_label: instance
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_ingress_label_(.+)
|
|
||||||
- source_labels: [__meta_kubernetes_namespace]
|
|
||||||
target_label: kubernetes_namespace
|
|
||||||
- source_labels: [__meta_kubernetes_ingress_name]
|
|
||||||
target_label: kubernetes_name
|
|
||||||
|
|
||||||
# Example scrape config for pods
|
|
||||||
#
|
|
||||||
# The relabeling allows the actual pod scrape to be configured
|
|
||||||
# for all the declared ports (or port-free target if none is declared)
|
|
||||||
# or only some ports.
|
|
||||||
- job_name: 'kubernetes-pods'
|
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: pod
|
|
||||||
|
|
||||||
relabel_configs:
|
|
||||||
# Example relabel to scrape only pods that have
|
|
||||||
# "example.io/should_be_scraped = true" annotation.
|
|
||||||
# - source_labels: [__meta_kubernetes_pod_annotation_example_io_should_be_scraped]
|
|
||||||
# action: keep
|
|
||||||
# regex: true
|
|
||||||
#
|
#
|
||||||
# Example relabel to customize metric path based on pod
|
# This job is not necessary and should be removed in Kubernetes 1.6 and
|
||||||
# "example.io/metric_path = <metric path>" annotation.
|
# earlier versions, or it will cause the metrics to be scraped twice.
|
||||||
# - source_labels: [__meta_kubernetes_pod_annotation_example_io_metric_path]
|
- job_name: "kubernetes-cadvisor"
|
||||||
# action: replace
|
|
||||||
# target_label: __metrics_path__
|
# Default to scraping over https. If required, just disable this or change to
|
||||||
# regex: (.+)
|
# `http`.
|
||||||
|
scheme: https
|
||||||
|
|
||||||
|
# Starting Kubernetes 1.7.3 the cAdvisor metrics are under /metrics/cadvisor.
|
||||||
|
# Kubernetes CIS Benchmark recommends against enabling the insecure HTTP
|
||||||
|
# servers of Kubernetes, therefore the cAdvisor metrics on the secure handler
|
||||||
|
# are used.
|
||||||
|
metrics_path: /metrics/cadvisor
|
||||||
|
|
||||||
|
# This TLS & authorization config is used to connect to the actual scrape
|
||||||
|
# endpoints for cluster components. This is separate to discovery auth
|
||||||
|
# configuration because discovery & scraping are two separate concerns in
|
||||||
|
# Prometheus. The discovery auth config is automatic if Prometheus runs inside
|
||||||
|
# the cluster. Otherwise, more config options have to be provided within the
|
||||||
|
# <kubernetes_sd_config>.
|
||||||
|
tls_config:
|
||||||
|
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
||||||
|
# If your node certificates are self-signed or use a different CA to the
|
||||||
|
# master CA, then disable certificate verification below. Note that
|
||||||
|
# certificate verification is an integral part of a secure infrastructure
|
||||||
|
# so this should only be disabled in a controlled environment. You can
|
||||||
|
# disable certificate verification by uncommenting the line below.
|
||||||
|
#
|
||||||
|
# insecure_skip_verify: true
|
||||||
|
authorization:
|
||||||
|
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
||||||
|
|
||||||
|
kubernetes_sd_configs:
|
||||||
|
- role: node
|
||||||
|
|
||||||
|
relabel_configs:
|
||||||
|
- action: labelmap
|
||||||
|
regex: __meta_kubernetes_node_label_(.+)
|
||||||
|
|
||||||
|
# Example scrape config for service endpoints.
|
||||||
#
|
#
|
||||||
# Example relabel to scrape only single, desired port for the pod
|
# The relabeling allows the actual service scrape endpoint to be configured
|
||||||
# based on pod "example.io/scrape_port = <port>" annotation.
|
# for all or only some endpoints.
|
||||||
# - source_labels: [__address__, __meta_kubernetes_pod_annotation_example_io_scrape_port]
|
- job_name: "kubernetes-service-endpoints"
|
||||||
# action: replace
|
|
||||||
# regex: ([^:]+)(?::\d+)?;(\d+)
|
kubernetes_sd_configs:
|
||||||
# replacement: $1:$2
|
- role: endpoints
|
||||||
# target_label: __address__
|
|
||||||
- action: labelmap
|
relabel_configs:
|
||||||
regex: __meta_kubernetes_pod_label_(.+)
|
# Example relabel to scrape only endpoints that have
|
||||||
- source_labels: [__meta_kubernetes_namespace]
|
# "example.io/should_be_scraped = true" annotation.
|
||||||
action: replace
|
# - source_labels: [__meta_kubernetes_service_annotation_example_io_should_be_scraped]
|
||||||
target_label: kubernetes_namespace
|
# action: keep
|
||||||
- source_labels: [__meta_kubernetes_pod_name]
|
# regex: true
|
||||||
action: replace
|
#
|
||||||
target_label: kubernetes_pod_name
|
# Example relabel to customize metric path based on endpoints
|
||||||
|
# "example.io/metric_path = <metric path>" annotation.
|
||||||
|
# - source_labels: [__meta_kubernetes_service_annotation_example_io_metric_path]
|
||||||
|
# action: replace
|
||||||
|
# target_label: __metrics_path__
|
||||||
|
# regex: (.+)
|
||||||
|
#
|
||||||
|
# Example relabel to scrape only single, desired port for the service based
|
||||||
|
# on endpoints "example.io/scrape_port = <port>" annotation.
|
||||||
|
# - source_labels: [__address__, __meta_kubernetes_service_annotation_example_io_scrape_port]
|
||||||
|
# action: replace
|
||||||
|
# regex: ([^:]+)(?::\d+)?;(\d+)
|
||||||
|
# replacement: $1:$2
|
||||||
|
# target_label: __address__
|
||||||
|
#
|
||||||
|
# Example relabel to configure scrape scheme for all service scrape targets
|
||||||
|
# based on endpoints "example.io/scrape_scheme = <scheme>" annotation.
|
||||||
|
# - source_labels: [__meta_kubernetes_service_annotation_example_io_scrape_scheme]
|
||||||
|
# action: replace
|
||||||
|
# target_label: __scheme__
|
||||||
|
# regex: (https?)
|
||||||
|
- action: labelmap
|
||||||
|
regex: __meta_kubernetes_service_label_(.+)
|
||||||
|
- source_labels: [__meta_kubernetes_namespace]
|
||||||
|
action: replace
|
||||||
|
target_label: kubernetes_namespace
|
||||||
|
- source_labels: [__meta_kubernetes_service_name]
|
||||||
|
action: replace
|
||||||
|
target_label: kubernetes_name
|
||||||
|
|
||||||
|
# Example scrape config for probing services via the Blackbox Exporter.
|
||||||
|
#
|
||||||
|
# The relabeling allows the actual service scrape endpoint to be configured
|
||||||
|
# for all or only some services.
|
||||||
|
- job_name: "kubernetes-services"
|
||||||
|
|
||||||
|
metrics_path: /probe
|
||||||
|
params:
|
||||||
|
module: [http_2xx]
|
||||||
|
|
||||||
|
kubernetes_sd_configs:
|
||||||
|
- role: service
|
||||||
|
|
||||||
|
relabel_configs:
|
||||||
|
# Example relabel to probe only some services that have "example.io/should_be_probed = true" annotation
|
||||||
|
# - source_labels: [__meta_kubernetes_service_annotation_example_io_should_be_probed]
|
||||||
|
# action: keep
|
||||||
|
# regex: true
|
||||||
|
- source_labels: [__address__]
|
||||||
|
target_label: __param_target
|
||||||
|
- target_label: __address__
|
||||||
|
replacement: blackbox-exporter.example.com:9115
|
||||||
|
- source_labels: [__param_target]
|
||||||
|
target_label: instance
|
||||||
|
- action: labelmap
|
||||||
|
regex: __meta_kubernetes_service_label_(.+)
|
||||||
|
- source_labels: [__meta_kubernetes_namespace]
|
||||||
|
target_label: kubernetes_namespace
|
||||||
|
- source_labels: [__meta_kubernetes_service_name]
|
||||||
|
target_label: kubernetes_name
|
||||||
|
|
||||||
|
# Example scrape config for probing ingresses via the Blackbox Exporter.
|
||||||
|
#
|
||||||
|
# The relabeling allows the actual ingress scrape endpoint to be configured
|
||||||
|
# for all or only some services.
|
||||||
|
- job_name: "kubernetes-ingresses"
|
||||||
|
|
||||||
|
metrics_path: /probe
|
||||||
|
params:
|
||||||
|
module: [http_2xx]
|
||||||
|
|
||||||
|
kubernetes_sd_configs:
|
||||||
|
- role: ingress
|
||||||
|
|
||||||
|
relabel_configs:
|
||||||
|
# Example relabel to probe only some ingresses that have "example.io/should_be_probed = true" annotation
|
||||||
|
# - source_labels: [__meta_kubernetes_ingress_annotation_example_io_should_be_probed]
|
||||||
|
# action: keep
|
||||||
|
# regex: true
|
||||||
|
- source_labels:
|
||||||
|
[
|
||||||
|
__meta_kubernetes_ingress_scheme,
|
||||||
|
__address__,
|
||||||
|
__meta_kubernetes_ingress_path,
|
||||||
|
]
|
||||||
|
regex: (.+);(.+);(.+)
|
||||||
|
replacement: ${1}://${2}${3}
|
||||||
|
target_label: __param_target
|
||||||
|
- target_label: __address__
|
||||||
|
replacement: blackbox-exporter.example.com:9115
|
||||||
|
- source_labels: [__param_target]
|
||||||
|
target_label: instance
|
||||||
|
- action: labelmap
|
||||||
|
regex: __meta_kubernetes_ingress_label_(.+)
|
||||||
|
- source_labels: [__meta_kubernetes_namespace]
|
||||||
|
target_label: kubernetes_namespace
|
||||||
|
- source_labels: [__meta_kubernetes_ingress_name]
|
||||||
|
target_label: kubernetes_name
|
||||||
|
|
||||||
|
# Example scrape config for pods
|
||||||
|
#
|
||||||
|
# The relabeling allows the actual pod scrape to be configured
|
||||||
|
# for all the declared ports (or port-free target if none is declared)
|
||||||
|
# or only some ports.
|
||||||
|
- job_name: "kubernetes-pods"
|
||||||
|
|
||||||
|
kubernetes_sd_configs:
|
||||||
|
- role: pod
|
||||||
|
|
||||||
|
relabel_configs:
|
||||||
|
# Example relabel to scrape only pods that have
|
||||||
|
# "example.io/should_be_scraped = true" annotation.
|
||||||
|
# - source_labels: [__meta_kubernetes_pod_annotation_example_io_should_be_scraped]
|
||||||
|
# action: keep
|
||||||
|
# regex: true
|
||||||
|
#
|
||||||
|
# Example relabel to customize metric path based on pod
|
||||||
|
# "example.io/metric_path = <metric path>" annotation.
|
||||||
|
# - source_labels: [__meta_kubernetes_pod_annotation_example_io_metric_path]
|
||||||
|
# action: replace
|
||||||
|
# target_label: __metrics_path__
|
||||||
|
# regex: (.+)
|
||||||
|
#
|
||||||
|
# Example relabel to scrape only single, desired port for the pod
|
||||||
|
# based on pod "example.io/scrape_port = <port>" annotation.
|
||||||
|
# - source_labels: [__address__, __meta_kubernetes_pod_annotation_example_io_scrape_port]
|
||||||
|
# action: replace
|
||||||
|
# regex: ([^:]+)(?::\d+)?;(\d+)
|
||||||
|
# replacement: $1:$2
|
||||||
|
# target_label: __address__
|
||||||
|
- action: labelmap
|
||||||
|
regex: __meta_kubernetes_pod_label_(.+)
|
||||||
|
- source_labels: [__meta_kubernetes_namespace]
|
||||||
|
action: replace
|
||||||
|
target_label: kubernetes_namespace
|
||||||
|
- source_labels: [__meta_kubernetes_pod_name]
|
||||||
|
action: replace
|
||||||
|
target_label: kubernetes_pod_name
|
||||||
|
|
|
@ -3,22 +3,22 @@
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
# Make Prometheus scrape itself for metrics.
|
# Make Prometheus scrape itself for metrics.
|
||||||
- job_name: 'prometheus'
|
- job_name: "prometheus"
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['localhost:9090']
|
- targets: ["localhost:9090"]
|
||||||
|
|
||||||
# Discover Node Exporter instances to scrape.
|
# Discover Node Exporter instances to scrape.
|
||||||
- job_name: 'node'
|
- job_name: "node"
|
||||||
linode_sd_configs:
|
linode_sd_configs:
|
||||||
- authorization:
|
- authorization:
|
||||||
credentials: "<replace with a Personal Access Token with linodes:read_only + ips:read_only access>"
|
credentials: "<replace with a Personal Access Token with linodes:read_only + ips:read_only access>"
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
# Only scrape targets that have a tag 'monitoring'.
|
# Only scrape targets that have a tag 'monitoring'.
|
||||||
- source_labels: [__meta_linode_tags]
|
- source_labels: [__meta_linode_tags]
|
||||||
regex: '.*,monitoring,.*'
|
regex: ".*,monitoring,.*"
|
||||||
action: keep
|
action: keep
|
||||||
|
|
||||||
# Use the public IPv6 address and port 9100 to scrape the target.
|
# Use the public IPv6 address and port 9100 to scrape the target.
|
||||||
- source_labels: [__meta_linode_public_ipv6]
|
- source_labels: [__meta_linode_public_ipv6]
|
||||||
target_label: __address__
|
target_label: __address__
|
||||||
replacement: '[$1]:9100'
|
replacement: "[$1]:9100"
|
||||||
|
|
|
@ -2,23 +2,21 @@
|
||||||
# (or DC/OS) cluster.
|
# (or DC/OS) cluster.
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
|
|
||||||
# Make Prometheus scrape itself for metrics.
|
# Make Prometheus scrape itself for metrics.
|
||||||
- job_name: 'prometheus'
|
- job_name: "prometheus"
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['localhost:9090']
|
- targets: ["localhost:9090"]
|
||||||
|
|
||||||
# Discover Marathon services to scrape.
|
# Discover Marathon services to scrape.
|
||||||
- job_name: 'marathon'
|
- job_name: "marathon"
|
||||||
|
|
||||||
# Scrape Marathon itself to discover new services every minute.
|
# Scrape Marathon itself to discover new services every minute.
|
||||||
marathon_sd_configs:
|
marathon_sd_configs:
|
||||||
- servers:
|
- servers:
|
||||||
- http://marathon.mesos:8080
|
- http://marathon.mesos:8080
|
||||||
refresh_interval: 60s
|
refresh_interval: 60s
|
||||||
|
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
|
|
||||||
# Only scrape targets that have a port label called 'metrics' specified on a port
|
# Only scrape targets that have a port label called 'metrics' specified on a port
|
||||||
# in their app definitions. Example using a port mapping (container or bridge networking):
|
# in their app definitions. Example using a port mapping (container or bridge networking):
|
||||||
#
|
#
|
||||||
|
@ -45,7 +43,11 @@ scrape_configs:
|
||||||
# ]
|
# ]
|
||||||
|
|
||||||
# Match a slash-prefixed string either in a portMapping or a portDefinition label.
|
# Match a slash-prefixed string either in a portMapping or a portDefinition label.
|
||||||
- source_labels: [__meta_marathon_port_mapping_label_metrics,__meta_marathon_port_definition_label_metrics]
|
- source_labels:
|
||||||
|
[
|
||||||
|
__meta_marathon_port_mapping_label_metrics,
|
||||||
|
__meta_marathon_port_definition_label_metrics,
|
||||||
|
]
|
||||||
regex: (\/.+;|;\/.+)
|
regex: (\/.+;|;\/.+)
|
||||||
action: keep
|
action: keep
|
||||||
|
|
||||||
|
@ -53,7 +55,7 @@ scrape_configs:
|
||||||
- source_labels: [__meta_marathon_port_mapping_label_metrics]
|
- source_labels: [__meta_marathon_port_mapping_label_metrics]
|
||||||
regex: (\/.+)
|
regex: (\/.+)
|
||||||
target_label: __metrics_path__
|
target_label: __metrics_path__
|
||||||
|
|
||||||
# If a portDefinition 'metrics' label is set, use the label value as the URI to scrape.
|
# If a portDefinition 'metrics' label is set, use the label value as the URI to scrape.
|
||||||
- source_labels: [__meta_marathon_port_definition_label_metrics]
|
- source_labels: [__meta_marathon_port_definition_label_metrics]
|
||||||
regex: (\/.+)
|
regex: (\/.+)
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
# my global config
|
# my global config
|
||||||
global:
|
global:
|
||||||
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
||||||
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
|
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
|
||||||
# scrape_timeout is set to the global default (10s).
|
# scrape_timeout is set to the global default (10s).
|
||||||
|
|
||||||
# Alertmanager configuration
|
# Alertmanager configuration
|
||||||
alerting:
|
alerting:
|
||||||
alertmanagers:
|
alertmanagers:
|
||||||
- static_configs:
|
- static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
# - alertmanager:9093
|
# - alertmanager:9093
|
||||||
|
|
||||||
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
||||||
rule_files:
|
rule_files:
|
||||||
|
@ -20,10 +20,10 @@ rule_files:
|
||||||
# Here it's Prometheus itself.
|
# Here it's Prometheus itself.
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||||
- job_name: 'prometheus'
|
- job_name: "prometheus"
|
||||||
|
|
||||||
# metrics_path defaults to '/metrics'
|
# metrics_path defaults to '/metrics'
|
||||||
# scheme defaults to 'http'.
|
# scheme defaults to 'http'.
|
||||||
|
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['localhost:9090']
|
- targets: ["localhost:9090"]
|
||||||
|
|
|
@ -10,22 +10,22 @@ kind: ClusterRole
|
||||||
metadata:
|
metadata:
|
||||||
name: prometheus
|
name: prometheus
|
||||||
rules:
|
rules:
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources:
|
resources:
|
||||||
- nodes
|
- nodes
|
||||||
- nodes/metrics
|
- nodes/metrics
|
||||||
- services
|
- services
|
||||||
- endpoints
|
- endpoints
|
||||||
- pods
|
- pods
|
||||||
verbs: ["get", "list", "watch"]
|
verbs: ["get", "list", "watch"]
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- extensions
|
- extensions
|
||||||
- networking.k8s.io
|
- networking.k8s.io
|
||||||
resources:
|
resources:
|
||||||
- ingresses
|
- ingresses
|
||||||
verbs: ["get", "list", "watch"]
|
verbs: ["get", "list", "watch"]
|
||||||
- nonResourceURLs: ["/metrics", "/metrics/cadvisor"]
|
- nonResourceURLs: ["/metrics", "/metrics/cadvisor"]
|
||||||
verbs: ["get"]
|
verbs: ["get"]
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
|
@ -42,6 +42,6 @@ roleRef:
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
name: prometheus
|
name: prometheus
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: prometheus
|
name: prometheus
|
||||||
namespace: default
|
namespace: default
|
||||||
|
|
8
pkg/rulefmt/testdata/bad_annotation.bad.yaml
vendored
8
pkg/rulefmt/testdata/bad_annotation.bad.yaml
vendored
|
@ -1,7 +1,7 @@
|
||||||
groups:
|
groups:
|
||||||
- name: yolo
|
- name: yolo
|
||||||
rules:
|
rules:
|
||||||
- alert: hola
|
- alert: hola
|
||||||
expr: 1
|
expr: 1
|
||||||
annotations:
|
annotations:
|
||||||
ins-tance: localhost
|
ins-tance: localhost
|
||||||
|
|
8
pkg/rulefmt/testdata/bad_expr.bad.yaml
vendored
8
pkg/rulefmt/testdata/bad_expr.bad.yaml
vendored
|
@ -1,5 +1,5 @@
|
||||||
groups:
|
groups:
|
||||||
- name: yolo
|
- name: yolo
|
||||||
rules:
|
rules:
|
||||||
- record: yolo
|
- record: yolo
|
||||||
expr: rate(hi)
|
expr: rate(hi)
|
||||||
|
|
1
pkg/rulefmt/testdata/bad_field.bad.yaml
vendored
1
pkg/rulefmt/testdata/bad_field.bad.yaml
vendored
|
@ -7,4 +7,3 @@ groups:
|
||||||
instance: localhost
|
instance: localhost
|
||||||
annotation:
|
annotation:
|
||||||
summary: annonations is written without s above
|
summary: annonations is written without s above
|
||||||
|
|
||||||
|
|
4
pkg/rulefmt/testdata/duplicate_grp.bad.yaml
vendored
4
pkg/rulefmt/testdata/duplicate_grp.bad.yaml
vendored
|
@ -1,3 +1,3 @@
|
||||||
groups:
|
groups:
|
||||||
- name: yolo
|
- name: yolo
|
||||||
- name: yolo
|
- name: yolo
|
||||||
|
|
12
pkg/rulefmt/testdata/invalid_label_name.bad.yaml
vendored
12
pkg/rulefmt/testdata/invalid_label_name.bad.yaml
vendored
|
@ -1,7 +1,7 @@
|
||||||
groups:
|
groups:
|
||||||
- name: yolo
|
- name: yolo
|
||||||
rules:
|
rules:
|
||||||
- record: hola
|
- record: hola
|
||||||
expr: 1
|
expr: 1
|
||||||
labels:
|
labels:
|
||||||
__name__: anything
|
__name__: anything
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
groups:
|
groups:
|
||||||
- name: yolo
|
- name: yolo
|
||||||
rules:
|
rules:
|
||||||
- record: strawberry{flavor="sweet"}
|
- record: strawberry{flavor="sweet"}
|
||||||
expr: 1
|
expr: 1
|
||||||
|
|
2
pkg/rulefmt/testdata/noexpr.bad.yaml
vendored
2
pkg/rulefmt/testdata/noexpr.bad.yaml
vendored
|
@ -1,4 +1,4 @@
|
||||||
groups:
|
groups:
|
||||||
- name: yolo
|
- name: yolo
|
||||||
rules:
|
rules:
|
||||||
- record: ylo
|
- record: ylo
|
||||||
|
|
10
pkg/rulefmt/testdata/record_and_alert.bad.yaml
vendored
10
pkg/rulefmt/testdata/record_and_alert.bad.yaml
vendored
|
@ -1,6 +1,6 @@
|
||||||
groups:
|
groups:
|
||||||
- name: yolo
|
- name: yolo
|
||||||
rules:
|
rules:
|
||||||
- record: Hi
|
- record: Hi
|
||||||
alert: Hello
|
alert: Hello
|
||||||
expr: 1
|
expr: 1
|
||||||
|
|
118
pkg/rulefmt/testdata/test.yaml
vendored
118
pkg/rulefmt/testdata/test.yaml
vendored
|
@ -1,64 +1,64 @@
|
||||||
groups:
|
groups:
|
||||||
- name: my-group-name
|
- name: my-group-name
|
||||||
interval: 30s # defaults to global interval
|
interval: 30s # defaults to global interval
|
||||||
rules:
|
rules:
|
||||||
- alert: HighErrors
|
- alert: HighErrors
|
||||||
expr: |
|
expr: |
|
||||||
sum without(instance) (rate(errors_total[5m]))
|
sum without(instance) (rate(errors_total[5m]))
|
||||||
/
|
/
|
||||||
sum without(instance) (rate(requests_total[5m]))
|
sum without(instance) (rate(requests_total[5m]))
|
||||||
for: 5m
|
for: 5m
|
||||||
labels:
|
labels:
|
||||||
severity: critical
|
severity: critical
|
||||||
annotations:
|
annotations:
|
||||||
description: "stuff's happening with {{ $.labels.service }}"
|
description: "stuff's happening with {{ $.labels.service }}"
|
||||||
|
|
||||||
# Mix recording rules in the same list
|
# Mix recording rules in the same list
|
||||||
- record: "new_metric"
|
- record: "new_metric"
|
||||||
expr: |
|
expr: |
|
||||||
sum without(instance) (rate(errors_total[5m]))
|
sum without(instance) (rate(errors_total[5m]))
|
||||||
/
|
/
|
||||||
sum without(instance) (rate(requests_total[5m]))
|
sum without(instance) (rate(requests_total[5m]))
|
||||||
labels:
|
labels:
|
||||||
abc: edf
|
abc: edf
|
||||||
uvw: xyz
|
uvw: xyz
|
||||||
|
|
||||||
- alert: HighErrors
|
- alert: HighErrors
|
||||||
expr: |
|
expr: |
|
||||||
sum without(instance) (rate(errors_total[5m]))
|
sum without(instance) (rate(errors_total[5m]))
|
||||||
/
|
/
|
||||||
sum without(instance) (rate(requests_total[5m]))
|
sum without(instance) (rate(requests_total[5m]))
|
||||||
for: 5m
|
for: 5m
|
||||||
labels:
|
labels:
|
||||||
severity: critical
|
severity: critical
|
||||||
annotations:
|
annotations:
|
||||||
description: "stuff's happening with {{ $.labels.service }}"
|
description: "stuff's happening with {{ $.labels.service }}"
|
||||||
|
|
||||||
- name: my-another-name
|
|
||||||
interval: 30s # defaults to global interval
|
|
||||||
rules:
|
|
||||||
- alert: HighErrors
|
|
||||||
expr: |
|
|
||||||
sum without(instance) (rate(errors_total[5m]))
|
|
||||||
/
|
|
||||||
sum without(instance) (rate(requests_total[5m]))
|
|
||||||
for: 5m
|
|
||||||
labels:
|
|
||||||
severity: critical
|
|
||||||
|
|
||||||
- record: "new_metric"
|
- name: my-another-name
|
||||||
expr: |
|
interval: 30s # defaults to global interval
|
||||||
sum without(instance) (rate(errors_total[5m]))
|
rules:
|
||||||
/
|
- alert: HighErrors
|
||||||
sum without(instance) (rate(requests_total[5m]))
|
expr: |
|
||||||
|
sum without(instance) (rate(errors_total[5m]))
|
||||||
|
/
|
||||||
|
sum without(instance) (rate(requests_total[5m]))
|
||||||
|
for: 5m
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
|
||||||
- alert: HighErrors
|
- record: "new_metric"
|
||||||
expr: |
|
expr: |
|
||||||
sum without(instance) (rate(errors_total[5m]))
|
sum without(instance) (rate(errors_total[5m]))
|
||||||
/
|
/
|
||||||
sum without(instance) (rate(requests_total[5m]))
|
sum without(instance) (rate(requests_total[5m]))
|
||||||
for: 5m
|
|
||||||
labels:
|
- alert: HighErrors
|
||||||
severity: critical
|
expr: |
|
||||||
annotations:
|
sum without(instance) (rate(errors_total[5m]))
|
||||||
description: "stuff's happening with {{ $.labels.service }}"
|
/
|
||||||
|
sum without(instance) (rate(requests_total[5m]))
|
||||||
|
for: 5m
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
description: "stuff's happening with {{ $.labels.service }}"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
groups:
|
groups:
|
||||||
- name: test
|
- name: test
|
||||||
rules:
|
rules:
|
||||||
- record: job:http_requests:rate5m
|
- record: job:http_requests:rate5m
|
||||||
expr: sum by (job)(rate(http_requests_total[5m]))
|
expr: sum by (job)(rate(http_requests_total[5m]))
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue