Skip to content

Commit 4c10dff

Browse files
committed
Merge branch 'master' into feature/add_ingest_metrics
# Conflicts: # .gitignore # collector/nodes_response.go
2 parents 6de3176 + 2645c58 commit 4c10dff

File tree

124 files changed

+16927
-6213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+16927
-6213
lines changed

.circleci/config.yml

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,36 @@
11
---
2+
# This project has switched to GitHub actions.
3+
# Circle CI is not disabled repository-wise so that previous pull requests
4+
# continue working.
5+
# This file does not generate any CircleCI workflow.
6+
27
version: 2.1
3-
orbs:
4-
prometheus: prometheus/[email protected]
8+
59
executors:
6-
# This must match .promu.yml.
10+
711
golang:
812
docker:
9-
- image: cimg/go:1.19
13+
- image: busybox
14+
1015
jobs:
11-
test:
16+
noopjob:
1217
executor: golang
18+
1319
steps:
14-
- prometheus/setup_environment
15-
- run: make
16-
- prometheus/store_artifact:
17-
file: elasticsearch_exporter
20+
- run:
21+
command: "true"
22+
23+
1824
workflows:
1925
version: 2
2026
elasticsearch_exporter:
2127
jobs:
22-
- test:
28+
- noopjob
29+
triggers:
30+
- schedule:
31+
cron: "0 0 30 2 *"
2332
filters:
24-
tags:
25-
only: /.*/
26-
- prometheus/build:
27-
name: build
28-
filters:
29-
tags:
30-
only: /.*/
31-
- prometheus/publish_master:
32-
context: org-context
33-
docker_hub_organization: prometheuscommunity
34-
quay_io_organization: prometheuscommunity
35-
requires:
36-
- test
37-
- build
38-
filters:
39-
branches:
40-
only: master
41-
- prometheus/publish_release:
42-
context: org-context
43-
docker_hub_organization: prometheuscommunity
44-
quay_io_organization: prometheuscommunity
45-
requires:
46-
- test
47-
- build
48-
filters:
49-
tags:
50-
only: /^v.*/
5133
branches:
52-
ignore: /.*/
34+
only:
35+
- main
36+
- master

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "monthly"
7+
groups:
8+
aws:
9+
patterns:
10+
- "github.com/aws/*"
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "monthly"

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
name: CI
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
test_go:
9+
name: Go tests
10+
runs-on: ubuntu-latest
11+
container:
12+
# Whenever the Go version is updated here, .promu.yml
13+
# should also be updated.
14+
image: quay.io/prometheus/golang-builder:1.23-base
15+
steps:
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
18+
- uses: ./.github/promci/actions/setup_environment
19+
- run: make GO_ONLY=1 SKIP_GOLANGCI_LINT=1
20+
21+
build:
22+
name: Build Prometheus for common architectures
23+
runs-on: ubuntu-latest
24+
if: |
25+
!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
26+
&&
27+
!(github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-'))
28+
&&
29+
!(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
30+
&&
31+
!(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
32+
strategy:
33+
matrix:
34+
thread: [ 0, 1, 2 ]
35+
steps:
36+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
38+
- uses: ./.github/promci/actions/build
39+
with:
40+
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
41+
parallelism: 3
42+
thread: ${{ matrix.thread }}
43+
44+
build_all:
45+
name: Build Prometheus for all architectures
46+
runs-on: ubuntu-latest
47+
if: |
48+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
49+
||
50+
(github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-'))
51+
||
52+
(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
53+
||
54+
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
55+
strategy:
56+
matrix:
57+
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
58+
59+
# Whenever the Go version is updated here, .promu.yml
60+
# should also be updated.
61+
steps:
62+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63+
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
64+
- uses: ./.github/promci/actions/build
65+
with:
66+
parallelism: 12
67+
thread: ${{ matrix.thread }}
68+
69+
publish_main:
70+
# https://github.com/prometheus/promci/blob/52c7012f5f0070d7281b8db4a119e21341d43c91/actions/publish_main/action.yml
71+
name: Publish main branch artifacts
72+
runs-on: ubuntu-latest
73+
needs: [test_go, build_all]
74+
if: |
75+
(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
76+
||
77+
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
78+
steps:
79+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80+
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
81+
- uses: ./.github/promci/actions/publish_main
82+
with:
83+
docker_hub_organization: prometheuscommunity
84+
docker_hub_login: ${{ secrets.docker_hub_login }}
85+
docker_hub_password: ${{ secrets.docker_hub_password }}
86+
quay_io_organization: prometheuscommunity
87+
quay_io_login: ${{ secrets.quay_io_login }}
88+
quay_io_password: ${{ secrets.quay_io_password }}
89+
90+
publish_release:
91+
name: Publish release artefacts
92+
runs-on: ubuntu-latest
93+
needs: [test_go, build_all]
94+
if: |
95+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
96+
steps:
97+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
98+
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
99+
- uses: ./.github/promci/actions/publish_release
100+
with:
101+
docker_hub_organization: prometheuscommunity
102+
docker_hub_login: ${{ secrets.docker_hub_login }}
103+
docker_hub_password: ${{ secrets.docker_hub_password }}
104+
quay_io_organization: prometheuscommunity
105+
quay_io_login: ${{ secrets.quay_io_login }}
106+
quay_io_password: ${{ secrets.quay_io_password }}
107+
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Push README to Docker Hub
3+
on:
4+
push:
5+
paths:
6+
- "README.md"
7+
- "README-containers.md"
8+
- ".github/workflows/container_description.yml"
9+
branches: [ main, master ]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
PushDockerHubReadme:
16+
runs-on: ubuntu-latest
17+
name: Push README to Docker Hub
18+
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
19+
steps:
20+
- name: git checkout
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
- name: Set docker hub repo name
23+
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
24+
- name: Push README to Dockerhub
25+
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
26+
env:
27+
DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }}
28+
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
29+
with:
30+
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
31+
provider: dockerhub
32+
short_description: ${{ env.DOCKER_REPO_NAME }}
33+
# Empty string results in README-containers.md being pushed if it
34+
# exists. Otherwise, README.md is pushed.
35+
readme_file: ''
36+
37+
PushQuayIoReadme:
38+
runs-on: ubuntu-latest
39+
name: Push README to quay.io
40+
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
41+
steps:
42+
- name: git checkout
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
- name: Set quay.io org name
45+
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
46+
- name: Set quay.io repo name
47+
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
48+
- name: Push README to quay.io
49+
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
50+
env:
51+
DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }}
52+
with:
53+
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
54+
provider: quay
55+
# Empty string results in README-containers.md being pushed if it
56+
# exists. Otherwise, README.md is pushed.
57+
readme_file: ''

.github/workflows/golangci-lint.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
2+
# This action is synced from https://github.com/prometheus/prometheus
13
name: golangci-lint
24
on:
35
push:
@@ -10,21 +12,28 @@ on:
1012
- ".golangci.yml"
1113
pull_request:
1214

15+
permissions: # added using https://github.com/step-security/secure-repo
16+
contents: read
17+
1318
jobs:
1419
golangci:
20+
permissions:
21+
contents: read # for actions/checkout to fetch code
22+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
1523
name: lint
1624
runs-on: ubuntu-latest
1725
steps:
1826
- name: Checkout repository
19-
uses: actions/checkout@v3
20-
- name: install Go
21-
uses: actions/setup-go@v2
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
- name: Install Go
29+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2230
with:
23-
go-version: 1.18.x
31+
go-version: 1.24.x
2432
- name: Install snmp_exporter/generator dependencies
2533
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
2634
if: github.repository == 'prometheus/snmp_exporter'
2735
- name: Lint
28-
uses: golangci/golangci-lint-action@v3.2.0
36+
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6.5.1
2937
with:
30-
version: v1.45.2
38+
args: --verbose
39+
version: v1.64.6

.github/workflows/mixin.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: mixin
3+
on:
4+
pull_request:
5+
paths:
6+
- "elasticsearch-mixin/**"
7+
8+
jobs:
9+
check-mixin:
10+
name: check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
- name: Setup Go
16+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
17+
with:
18+
go-version: 1.23.x
19+
- name: Install dependencies
20+
run: |
21+
go install github.com/google/go-jsonnet/cmd/[email protected]
22+
go install github.com/google/go-jsonnet/cmd/[email protected]
23+
go install github.com/google/go-jsonnet/cmd/[email protected]
24+
go install github.com/monitoring-mixins/mixtool/cmd/mixtool@16dc166166d91e93475b86b9355a4faed2400c18
25+
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected]
26+
- name: Lint
27+
run: bash ./scripts/lint-jsonnet.sh
28+
- name: Compile mixin
29+
run: bash ./scripts/compile-mixin.sh
30+
- name: Verify compiled mixin matches repo
31+
run: |
32+
git diff --exit-code -- ./elasticsearch-mixin || (echo "Compiled mixin does not match repo" && exit 1)
33+
# Check if there are any new untracked files
34+
test -z "$(git status --porcelain)" || (echo "Untracked files found, please run ./scripts/compile-mixin.sh" && exit 1)

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ elasticsearch_exporter
44
*-stamp
55
.tarballs
66
/vendor
7-
.idea
7+
vendor/

.golangci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
linters:
33
enable:
44
- revive
5+
- sloglint
56

67
issues:
78
exclude-rules:
89
- path: _test.go
910
linters:
1011
- errcheck
12+
13+
linters-settings:
14+
revive:
15+
rules:
16+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
17+
- name: unused-parameter
18+
severity: warning
19+
disabled: true

.promu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
go:
2-
# This must match .circle/config.yml.
3-
version: 1.19
2+
# Whenever the Go version is updated here,
3+
# .github/workflows should also be updated.
4+
version: 1.23
45
repository:
56
path: github.com/prometheus-community/elasticsearch_exporter
67
build:
78
binaries:
89
- name: elasticsearch_exporter
9-
flags: -a -tags netgo
1010
ldflags: |
1111
-s
1212
-X github.com/prometheus/common/version.Version={{.Version}}

.yamllint

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
extends: default
3+
ignore: |
4+
**/node_modules
35

46
rules:
57
braces:
@@ -20,9 +22,4 @@ rules:
2022
config/testdata/section_key_dup.bad.yml
2123
line-length: disable
2224
truthy:
23-
ignore: |
24-
.github/workflows/codeql-analysis.yml
25-
.github/workflows/funcbench.yml
26-
.github/workflows/fuzzing.yml
27-
.github/workflows/prombench.yml
28-
.github/workflows/golangci-lint.yml
25+
check-keys: false

0 commit comments

Comments
 (0)