Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Merge upstream, and add aggregate labels to build faster graphs #2

Merged
merged 42 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
23680cc
Update common Prometheus files (#1235)
prombot Aug 27, 2024
1d75633
Add type to parse date and time (#1234)
phibos Aug 30, 2024
683caef
Update common Prometheus files (#1238)
prombot Aug 30, 2024
50f4cdd
Bump github.com/prometheus/common from 0.55.0 to 0.57.0
dependabot[bot] Sep 1, 2024
3e52d46
Update common Prometheus files
prombot Sep 5, 2024
77b8a81
Merge pull request #1242 from prometheus/dependabot/go_modules/github…
bastischubert Sep 8, 2024
d62dc6f
Bump github.com/prometheus/client_golang from 1.20.0 to 1.20.3
dependabot[bot] Sep 8, 2024
cec9c33
Merge pull request #1245 from prometheus/dependabot/go_modules/github…
bastischubert Sep 8, 2024
693785d
Merge branch 'main' into repo_sync
bastischubert Sep 8, 2024
b6f33fb
Bump github.com/gosnmp/gosnmp from 1.37.0 to 1.38.0
dependabot[bot] Sep 8, 2024
3e59d0f
Merge pull request #1243 from prometheus/dependabot/go_modules/github…
bastischubert Sep 11, 2024
807f199
Merge pull request #1244 from prometheus/repo_sync
bastischubert Sep 12, 2024
f1e5797
Add support for Sophos XG devices (#1239)
phibos Sep 12, 2024
bacd059
Update common Prometheus files
prombot Sep 17, 2024
af7d9a2
Merge pull request #1246 from prometheus/repo_sync
bastischubert Sep 20, 2024
efa792c
Set UseUnconnectedUDPSocket option if one of the modules has if set
unarep Sep 21, 2024
a005e3e
Bump github.com/prometheus/client_golang from 1.20.3 to 1.20.4
dependabot[bot] Oct 1, 2024
b9f0e96
Merge pull request #1251 from prometheus/dependabot/go_modules/github…
bastischubert Oct 2, 2024
1992ef1
Update common Prometheus files (#1255)
prombot Oct 3, 2024
dd39255
Bump github.com/prometheus/common from 0.57.0 to 0.60.0 (#1254)
dependabot[bot] Oct 3, 2024
dc96963
chore!: adopt log/slog, drop go-kit/log (#1249)
tjhop Oct 3, 2024
cf28621
Update common Prometheus files (#1260)
prombot Oct 10, 2024
e7309c4
Fix Sophos mibs unpack (#1266)
subuk Oct 12, 2024
1195562
Add HPE MIBs
dsgnr Oct 15, 2024
acb8d71
Merge pull request #1247 from unarep/use-unconnected-UDP-socket
bastischubert Oct 17, 2024
5e3f68c
updated generator doc; fixes #1268
bastischubert Oct 17, 2024
df1b28d
Merge pull request #1270 from bastischubert/bastischubert/1729196855
bastischubert Oct 17, 2024
c2b6a57
Descriptions for HPE OIDs
dsgnr Oct 18, 2024
a411322
Improve config error message
SuperQ Oct 29, 2024
1cc1e66
Merge pull request #1274 from prometheus/superq/config_error
bastischubert Oct 30, 2024
0c6b6ed
Merge pull request #1267 from dsgnr/hpe_mibs
bastischubert Oct 30, 2024
493176b
Bump github.com/prometheus/common from 0.60.0 to 0.60.1
dependabot[bot] Nov 1, 2024
2be1a53
Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5
dependabot[bot] Nov 1, 2024
c993bae
Update common Prometheus files
prombot Nov 5, 2024
e12a46c
Merge pull request #1277 from prometheus/dependabot/go_modules/github…
bastischubert Nov 6, 2024
1e985e6
Merge branch 'main' into dependabot/go_modules/github.com/prometheus/…
bastischubert Nov 6, 2024
842b1fe
Bump github.com/prometheus/exporter-toolkit from 0.13.0 to 0.13.1
dependabot[bot] Nov 6, 2024
e000dfb
Merge pull request #1278 from prometheus/dependabot/go_modules/github…
bastischubert Nov 6, 2024
1eca12c
Merge pull request #1279 from prometheus/dependabot/go_modules/github…
bastischubert Nov 6, 2024
5a6abf3
Merge pull request #1282 from prometheus/repo_sync
bastischubert Nov 6, 2024
a806f84
Merge remote-tracking branch 'refs/remotes/upstream/main' into promet…
nicko170 Nov 7, 2024
d65a517
fix: merge upstream, add aggregate to labels
nicko170 Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
version: 2.1

orbs:
prometheus: prometheus/[email protected]

executors:
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
golang:
docker:
- image: cimg/go:1.22
parameters:
working_dir:
type: string
default: ~/project
working_directory: << parameters.working_dir >>

jobs:
test:
executor: golang

steps:
- prometheus/setup_environment
- run: sudo apt-get update
- run: sudo apt-get -y install build-essential libsnmp-dev
- run: make
- run: git diff --exit-code
- prometheus/store_artifact:
file: snmp_exporter

generator:
executor:
name: golang
working_dir: ~/project/generator

environment:
MIBDIRS: mibs
steps:
- checkout:
path: ~/project
- run: sudo apt-get update
- run: sudo apt-get -y install build-essential diffutils libsnmp-dev p7zip-full
- run: make mibs
- run: make generator
- run: make parse_errors
- run: make generate
- run: diff -u ../snmp.yml snmp.yml

publish_generator_main:
executor: golang

steps:
- prometheus/setup_build_environment:
docker_version: ""
- run: make -C generator docker REPO_TAG=main DOCKER_IMAGE_TAG=main
- run: make -C generator docker REPO_TAG=main DOCKER_REPO=quay.io/prometheus DOCKER_IMAGE_TAG=main
- run: docker images
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
- run: make -C generator docker-publish DOCKER_IMAGE_TAG=main
- run: make -C generator docker-publish DOCKER_REPO=quay.io/prometheus DOCKER_IMAGE_TAG=main

publish_generator_release:
executor: golang

steps:
- prometheus/setup_build_environment:
docker_version: ""
- run: make -C generator docker REPO_TAG=$CIRCLE_TAG DOCKER_IMAGE_TAG=$CIRCLE_TAG
- run: make -C generator docker REPO_TAG=$CIRCLE_TAG DOCKER_IMAGE_TAG=$CIRCLE_TAG DOCKER_REPO=quay.io/prometheus
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
- run: |
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
make -C generator docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG"
make -C generator docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=quay.io/prometheus
fi
- run: make -C generator docker-publish DOCKER_IMAGE_TAG=$CIRCLE_TAG
- run: make -C generator docker-publish DOCKER_IMAGE_TAG=$CIRCLE_TAG DOCKER_REPO=quay.io/prometheus
- run: |
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
make -C generator docker-publish DOCKER_IMAGE_TAG="latest"
make -C generator docker-publish DOCKER_IMAGE_TAG="latest" DOCKER_REPO=quay.io/prometheus
fi

mixin:
executor: golang

steps:
- checkout
- run: go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest
- run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
- run: make -C snmp-mixin lint build

workflows:
version: 2
snmp_exporter:
jobs:
- test:
filters:
tags:
only: /.*/
- mixin:
filters:
tags:
only: /.*/
- prometheus/build:
name: build
filters:
tags:
only: /.*/
- generator:
filters:
tags:
only: /.*/
- prometheus/publish_main:
context: org-context
requires:
- test
- build
- generator
filters:
branches:
only: main
- prometheus/publish_release:
context: org-context
requires:
- test
- build
- generator
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
branches:
ignore: /.*/
- publish_generator_main:
context: org-context
requires:
- test
- build
- generator
filters:
branches:
only: main
- publish_generator_release:
context: org-context
requires:
- test
- build
- generator
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
branches:
ignore: /.*/
57 changes: 57 additions & 0 deletions .github/workflows/container_description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Push README to Docker Hub
on:
push:
paths:
- "README.md"
- "README-containers.md"
- ".github/workflows/container_description.yml"
branches: [ main, master ]

permissions:
contents: read

jobs:
PushDockerHubReadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set docker hub repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to Dockerhub
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }}
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: dockerhub
short_description: ${{ env.DOCKER_REPO_NAME }}
# Empty string results in README-containers.md being pushed if it
# exists. Otherwise, README.md is pushed.
readme_file: ''

PushQuayIoReadme:
runs-on: ubuntu-latest
name: Push README to quay.io
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set quay.io org name
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
- name: Set quay.io repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to quay.io
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: quay
# Empty string results in README-containers.md being pushed if it
# exists. Otherwise, README.md is pushed.
readme_file: ''
39 changes: 39 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# This action is synced from https://github.com/prometheus/prometheus
name: golangci-lint
on:
push:
paths:
- "go.sum"
- "go.mod"
- "**.go"
- "scripts/errcheck_excludes.txt"
- ".github/workflows/golangci-lint.yml"
- ".golangci.yml"
pull_request:

permissions: # added using https://github.com/step-security/secure-repo
contents: read

jobs:
golangci:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Install Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: 1.23.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
args: --verbose
version: v1.60.2
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ linters:
enable:
- misspell
- revive
- sloglint
disable:
# Disable soon to deprecated[1] linters that lead to false
# positives when build tags disable certain files[2]
Expand All @@ -24,8 +25,6 @@ linters-settings:
exclude-functions:
# Used in HTTP handlers, any error is handled by the server itself.
- (net/http.ResponseWriter).Write
# Never check for logger errors.
- (github.com/go-kit/log.Logger).Log
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
Expand Down
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
go:
# Whenever the Go version is updated here,
# .circle/config.yml should also be updated.
version: 1.22
version: 1.23
repository:
path: github.com/prometheus/snmp_exporter
build:
Expand Down
8 changes: 7 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.59.1
GOLANGCI_LINT_VERSION ?= v1.60.2
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
Expand Down Expand Up @@ -275,3 +275,9 @@ $(1)_precheck:
exit 1; \
fi
endef

govulncheck: install-govulncheck
govulncheck ./...

install-govulncheck:
command -v govulncheck > /dev/null || go install golang.org/x/vuln/cmd/govulncheck@latest
Loading
Loading