Skip to content

Commit 6ea5892

Browse files
authored
Merge pull request #4 from prometheus-community/master
Bring the fork up to date.
2 parents 9d17bbd + e9d0a1c commit 6ea5892

21 files changed

+528
-286
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ executors:
66
# This must match .promu.yml.
77
golang:
88
docker:
9-
- image: cimg/go:1.22
9+
- image: cimg/go:1.24
1010
jobs:
1111
test:
1212
executor: golang

.github/workflows/container_description.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
1919
steps:
2020
- name: git checkout
21-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222
- name: Set docker hub repo name
2323
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
2424
- name: Push README to Dockerhub
@@ -40,7 +40,7 @@ jobs:
4040
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
4141
steps:
4242
- name: git checkout
43-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4444
- name: Set quay.io org name
4545
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
4646
- name: Set quay.io repo name

.github/workflows/golangci-lint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
- name: Install Go
29-
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
29+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
3030
with:
31-
go-version: 1.22.x
31+
go-version: 1.24.x
3232
- name: Install snmp_exporter/generator dependencies
3333
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
3434
if: github.repository == 'prometheus/snmp_exporter'
3535
- name: Lint
36-
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
36+
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
3737
with:
3838
args: --verbose
39-
version: v1.59.1
39+
version: v1.64.6

.golangci.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
---
2+
linters:
3+
enable:
4+
- sloglint
5+
26
run:
3-
deadline: 5m
4-
skip-files:
5-
# Skip autogenerated files.
6-
- ^.*\.(pb|y)\.go$
7+
timeout: 5m
78

89
issues:
910
exclude-rules:
1011
- path: _test.go
1112
linters:
1213
- errcheck
13-
14-
linters-settings:
15-
errcheck:
16-
exclude-functions:
17-
# Used in HTTP handlers, any error is handled by the server itself.
18-
- (net/http.ResponseWriter).Write
19-
# Never check for logger errors.
20-
- (github.com/go-kit/log.Logger).Log

.promu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
go:
22
# This must match .circle/config.yml.
3-
version: 1.22
3+
version: 1.24
44
repository:
55
path: github.com/prometheus-community/stackdriver_exporter
66
build:

.yamllint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
extends: default
33
ignore: |
4-
ui/react-app/node_modules
4+
**/node_modules
55

66
rules:
77
braces:

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
## master / unreleased
22

3+
## 0.18.0 / 2025-01-16
4+
5+
- [FEATURE] Support more specific prefixes in ?collect parameter #387
6+
- [FEATURE] Enabling monitoring metrics, aggregate deltas, and descriptor cache with ?collect #389
7+
8+
## 0.17.0 / 2024-11-04
9+
10+
Deprecation notice: The comma delimited flags `google.project-id` and `monitoring.metrics-type-prefixes` are being replaced by repeatable flags `google.project-ids` and `monitoring.metrics-prefixes`. The comma delimited flags will be supported for at least one more release.
11+
12+
- [CHANGE] Migrate logging to promslog #378
13+
- [ENHANCEMENT] Sanitize metric type prefixes to prevent duplicate metrics #319
14+
- [ENHANCEMENT] Add project ID to all logs from the collector #362
15+
- [FEATURE] Add support for specifying comma-delimited string flags as repeatable flags #355
16+
317
## 0.16.0 / 2024-07-15
418

519
* [FEATURE] Add ErrorLogger for promhttp #277

Makefile.common

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
6161
SKIP_GOLANGCI_LINT :=
6262
GOLANGCI_LINT :=
6363
GOLANGCI_LINT_OPTS ?=
64-
GOLANGCI_LINT_VERSION ?= v1.59.1
64+
GOLANGCI_LINT_VERSION ?= v1.64.6
6565
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
6666
# windows isn't included here because of the path separator being different.
6767
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
@@ -275,3 +275,9 @@ $(1)_precheck:
275275
exit 1; \
276276
fi
277277
endef
278+
279+
govulncheck: install-govulncheck
280+
govulncheck ./...
281+
282+
install-govulncheck:
283+
command -v govulncheck > /dev/null || go install golang.org/x/vuln/cmd/govulncheck@latest

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ If you are still using the legacy [Access scopes][access-scopes], the `https://w
7878

7979
| Flag | Required | Default | Description |
8080
| ----------------------------------- | -------- |---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
81-
| `google.project-id` | No | GCloud SDK auto-discovery | Comma seperated list of Google Project IDs |
81+
| `google.project-ids` | No | GCloud SDK auto-discovery | Repeatable flag of Google Project IDs |
8282
| `google.projects.filter` | No | | GCloud projects filter expression. See more [here](https://cloud.google.com/sdk/gcloud/reference/projects/list). |
8383
| `monitoring.metrics-ingest-delay` | No | | Offsets metric collection by a delay appropriate for each metric type, e.g. because bigquery metrics are slow to appear |
8484
| `monitoring.drop-delegated-projects` | No | No | Drop metrics from attached projects and fetch `project_id` only. |
85-
| `monitoring.metrics-type-prefixes` | Yes | | Comma separated Google Stackdriver Monitoring Metric Type prefixes (see [example][metrics-prefix-example] and [available metrics][metrics-list]) |
85+
| `monitoring.metrics-prefixes` | Yes | | Repeatable flag of Google Stackdriver Monitoring Metric Type prefixes (see [example][metrics-prefix-example] and [available metrics][metrics-list]) |
8686
| `monitoring.metrics-interval` | No | `5m` | Metric's timestamp interval to request from the Google Stackdriver Monitoring Metrics API. Only the most recent data point is used |
8787
| `monitoring.metrics-offset` | No | `0s` | Offset (into the past) for the metric's timestamp interval to request from the Google Stackdriver Monitoring Metrics API, to handle latency in published metrics |
8888
| `monitoring.filters` | No | | Additonal filters to be sent on the Monitoring API call. Add multiple filters by providing this parameter multiple times. See [monitoring.filters](#using-filters) for more info. |
@@ -143,8 +143,9 @@ If we want to get all `CPU` (`compute.googleapis.com/instance/cpu`) and `Disk` (
143143

144144
```
145145
stackdriver_exporter \
146-
--google.project-id=my-test-project \
147-
--monitoring.metrics-type-prefixes "compute.googleapis.com/instance/cpu,compute.googleapis.com/instance/disk"
146+
--google.project-ids=my-test-project \
147+
--monitoring.metrics-prefixes "compute.googleapis.com/instance/cpu"
148+
--monitoring.metrics-prefixes "compute.googleapis.com/instance/disk"
148149
```
149150

150151
### Using filters
@@ -163,17 +164,17 @@ Example: \
163164
pubsub.googleapis.com/subscription/num_undelivered_messages (apply to only the specific subscription metric) \
164165

165166
The `filter_query` will be applied to a final metrics API query when querying for metric data. You can read more about the metric API filter options in GCPs documentation https://cloud.google.com/monitoring/api/v3/filters
166-
167+
167168
The final query sent to the metrics API already includes filters for project and metric type. Each applicable `filter_query` will be appended to the query with an AND
168169

169170
Full example
170171
```
171172
stackdriver_exporter \
172-
--google.project-id=my-test-project \
173-
--monitoring.metrics-type-prefixes='pubsub.googleapis.com/subscription' \
174-
--monitoring.metrics-type-prefixes='compute.googleapis.com/instance/cpu' \
173+
--google.project-ids=my-test-project \
174+
--monitoring.metrics-prefixes='pubsub.googleapis.com/subscription' \
175+
--monitoring.metrics-prefixes='compute.googleapis.com/instance/cpu' \
175176
--monitoring.filters='pubsub.googleapis.com/subscription:resource.labels.subscription_id=monitoring.regex.full_match("us-west4.*my-team-subs.*")' \
176-
--monitoring.filters='compute.googleapis.com/instance/cpu:resource.labels.instance=monitoring.regex.full_match("us-west4.*my-team-subs.*")'
177+
--monitoring.filters='compute.googleapis.com/instance/cpu:resource.labels.instance=monitoring.regex.full_match("us-west4.*my-team-subs.*")'
177178
```
178179

179180
Using projects filter:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.16.0
1+
0.18.0

0 commit comments

Comments
 (0)