Commit Graph

1568 Commits

Author SHA1 Message Date
Bartlomiej Plotka 2280fb19f6
Revert "change api http.client to interface" 2023-12-22 11:16:00 +00:00
Arthur Silva Sens 239b12347d
Merge pull request #1387 from tsipo/main
change api http.client to interface
2023-12-20 19:08:36 -03:00
github-actions[bot] 3f8bd73e9b
Merge pull request #1370 from prometheus/dependabot/go_modules/tutorial/whatsup/google.golang.org/grpc-1.56.3
Bump google.golang.org/grpc from 1.53.0 to 1.56.3 in /tutorial/whatsup
2023-12-12 22:01:51 +00:00
dependabot[bot] 5e55b312c0
Bump google.golang.org/grpc from 1.53.0 to 1.56.3 in /tutorial/whatsup
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.53.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-12 21:58:26 +00:00
github-actions[bot] e96fb182c2
Merge pull request #1401 from prometheus/dependabot/go_modules/golang.org/x/sys-0.15.0
Bump golang.org/x/sys from 0.13.0 to 0.15.0
2023-12-01 09:37:23 +00:00
dependabot[bot] 2a8fc90b9b
Bump golang.org/x/sys from 0.13.0 to 0.15.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.13.0 to 0.15.0.
- [Commits](https://github.com/golang/sys/compare/v0.13.0...v0.15.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 09:34:06 +00:00
Roy Reshef 24d59e9b9b change client to interface, allow override by other implementations (e.g. github.com/hashicorp/go-retryablehttp)
Signed-off-by: Roy Reshef <rreshef@densify.com>
2023-11-22 16:52:47 -05:00
Billy Keyes 80d3f0b5b3
Normalize empty help values in CollectAndCompare (#1378)
Due to an inconsistency in the text protocol between encoding and
decoding, it was not possible to use the testutil.CollectAndCompare
function to test metrics with empty help values. To fix this, normalize
empty help values from the expected/want side of the test so that they
compare correctly with empty values on the actual/got side of the test.

Signed-off-by: Billy Keyes <bluekeyes@gmail.com>
2023-11-20 09:57:30 +00:00
Arthur Silva Sens 3f80cd1055
Add example of NewConstMetricWithCreatedTimestamp (#1375)
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
2023-11-20 09:56:35 +00:00
Arthur Silva Sens e160b505d3
Bump prometheus/common to 0.45.0 (#1374)
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
2023-11-20 09:55:43 +00:00
王卿 38794570f4
This way the import is more readable (#1383)
Signed-off-by: wangqing <wangqing@uniontech.com>
Co-authored-by: wangqing <wangqing@uniontech.com>
2023-11-20 09:55:08 +00:00
Arthur Silva Sens 0356577e9b
Merge pull request #1376 from prometheus/repo_sync 2023-11-03 21:19:16 -03:00
prombot f66184f2c5 Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-11-03 17:48:38 +00:00
github-actions[bot] f030c3d062
Merge pull request #1373 from prometheus/dependabot/go_modules/tutorial/whatsup/github.com/prometheus/common-0.45.0
Bump github.com/prometheus/common from 0.44.0 to 0.45.0 in /tutorial/whatsup
2023-11-01 09:48:45 +00:00
dependabot[bot] 4e4691d2fc
Bump github.com/prometheus/common in /tutorial/whatsup
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.44.0 to 0.45.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.44.0...v0.45.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 09:43:56 +00:00
github-actions[bot] 884bc8e242
Merge pull request #1371 from prometheus/dependabot/go_modules/github.com/prometheus/client_model-0.5.0
Bump github.com/prometheus/client_model from 0.4.1-0.20230718164431-9a2bf3000d16 to 0.5.0
2023-11-01 09:14:31 +00:00
dependabot[bot] 16b91f8f6c
Bump github.com/prometheus/client_model
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.4.1-0.20230718164431-9a2bf3000d16 to 0.5.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/commits/v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 09:08:46 +00:00
github-actions[bot] 13a208d0b3
Merge pull request #1366 from prometheus/dependabot/go_modules/golang.org/x/net-0.17.0
Bump golang.org/x/net from 0.15.0 to 0.17.0
2023-10-19 18:36:58 +00:00
Björn Rabenstein cd8cba2ceb
histograms: Add timer to reset ASAP after bucket limiting has happened (#1367)
Fixes #1248. See issue description for all the details.

Signed-off-by: beorn7 <beorn@grafana.com>
2023-10-19 14:22:02 +01:00
dependabot[bot] 5046a13c60
Bump golang.org/x/net from 0.15.0 to 0.17.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.15.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.15.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 22:44:18 +00:00
github-actions[bot] c3e797ebb3
Merge pull request #1365 from prometheus/dependabot/go_modules/tutorial/whatsup/golang.org/x/net-0.17.0
Bump golang.org/x/net from 0.10.0 to 0.17.0 in /tutorial/whatsup
2023-10-11 22:43:28 +00:00
dependabot[bot] 5b7580751a
Bump golang.org/x/net from 0.10.0 to 0.17.0 in /tutorial/whatsup
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 22:40:53 +00:00
João Vilaça 60a85133ed
Add support for custom validations in promlint (#1311)
* Refactor promlint validation structure

Signed-off-by: João Vilaça <jvilaca@redhat.com>

* Add support for custom validations in promlint

Signed-off-by: João Vilaça <jvilaca@redhat.com>

* Keep backwards compatibility

Signed-off-by: João Vilaça <jvilaca@redhat.com>

---------

Signed-off-by: João Vilaça <jvilaca@redhat.com>
2023-10-10 10:38:10 +01:00
Jorge Alberto Díaz Orozco (Akiel) 486d514e63
Update dependency golang.org/x/net to v0.15.0 (#1342)
to use a version of the package not affected by [CVE-2023-3978](https://www.cve.org/CVERecord?id=CVE-2023-3978)

Other indirect upgrades
golang.org/x/sys v0.11.0 => v0.12.0
golang.org/x/text v0.9.0 => v0.13.0

Signed-off-by: Jorge Alberto Diaz Orozco (Akiel) <diazorozcoj@gmail.com>
Signed-off-by: Jorge Alberto Díaz Orozco (Akiel) <diazorozcoj@gmail.com>
2023-10-10 09:48:25 +01:00
Stephan Renatus 64e51f50df
proccess_collector: add wasip1 stub (#1350)
* proccess_collector: add wasip1 stub

This resolves build failures like this when using the wasip1 support:

    # github.com/prometheus/procfs
    ../../../go/pkg/mod/github.com/prometheus/procfs@v0.11.1/fs_statfs_type.go:25:18: undefined: syscall.Statfs_t
    ../../../go/pkg/mod/github.com/prometheus/procfs@v0.11.1/fs_statfs_type.go:26:17: undefined: syscall.Statfs

See https://go.dev/blog/wasi.

Signed-off-by: Stephan Renatus <stephan@styra.com>

* add build tags

Signed-off-by: Stephan Renatus <stephan@styra.com>

---------

Signed-off-by: Stephan Renatus <stephan@styra.com>
2023-10-10 09:46:36 +01:00
Bartlomiej Plotka d81c33f6ad
Update MAINTAINERS.md (#1362)
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2023-10-05 14:14:58 +01:00
PrometheusBot 1803eb906e
Update common Prometheus files (#1361)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-10-05 14:08:54 +01:00
Arthur Silva Sens 51714a5a30
Merge pull request #1360 from colega/improve-performance-of-with-label-values
Improve performance of WithLabelValues(...)
2023-10-05 09:26:24 -03:00
Oleg Zaytsev 005d8de006
Improve performance of WithLabelValues(...)
The slice with variadic arguments passed to MetricVec.WithLabelValues()
was escaping to heap. This change fixes that by performing a copy of the
slice before passing it to fmt.Errorf(), which is where the slice was
escaping. This keeps the hot path without that allocation.

Meaningful benchmark results (skipping ~0 CPU and 0 alloc ones):

                                                               │    old.txt    │               new.txt                │
                                                               │    sec/op     │    sec/op     vs base                │
Counter/With_Label_Values-16                                     108.00n ±  6%   58.06n ±  1%  -46.24% (p=0.000 n=10)
Counter/With_Label_Values_and_Constraint-16                       174.5n ± 15%   136.8n ±  6%  -21.63% (p=0.000 n=10)
Counter/With_triple_Label_Values-16                               309.3n ± 12%   172.9n ±  1%  -44.08% (p=0.000 n=10)
Counter/With_triple_Label_Values_and_Constraint-16                591.5n ± 11%   418.9n ±  3%  -29.17% (p=0.000 n=10)
Counter/With_repeated_Label_Values-16                             212.9n ± 10%   116.8n ± 23%  -45.16% (p=0.000 n=10)
Counter/With_repeated_Label_Values_and_Constraint-16              406.2n ± 14%   275.1n ±  4%  -32.30% (p=0.000 n=10)
CounterWithLabelValuesConcurrent-16                               85.45n ±  2%   89.09n ±  2%   +4.26% (p=0.003 n=10)

                                                               │    old.txt     │                  new.txt                  │
                                                               │      B/op      │     B/op      vs base                     │
Counter/With_Label_Values-16                                       48.00 ± 0%        0.00 ± 0%  -100.00% (p=0.000 n=10)
Counter/With_Label_Values_and_Constraint-16                        96.00 ± 0%       48.00 ± 0%   -50.00% (p=0.000 n=10)
Counter/With_triple_Label_Values-16                                144.0 ± 0%         0.0 ± 0%  -100.00% (p=0.000 n=10)
Counter/With_triple_Label_Values_and_Constraint-16                 288.0 ± 0%       144.0 ± 0%   -50.00% (p=0.000 n=10)
Counter/With_repeated_Label_Values-16                              96.00 ± 0%        0.00 ± 0%  -100.00% (p=0.000 n=10)
Counter/With_repeated_Label_Values_and_Constraint-16              192.00 ± 0%       96.00 ± 0%   -50.00% (p=0.000 n=10)
CounterWithLabelValuesConcurrent-16                                48.00 ± 0%        0.00 ± 0%  -100.00% (p=0.000 n=10)

                                                               │   old.txt    │                 new.txt                 │
                                                               │  allocs/op   │ allocs/op   vs base                     │
Counter/With_Label_Values-16                                     1.000 ± 0%     0.000 ± 0%  -100.00% (p=0.000 n=10)
Counter/With_Label_Values_and_Constraint-16                      2.000 ± 0%     1.000 ± 0%   -50.00% (p=0.000 n=10)
Counter/With_triple_Label_Values-16                              3.000 ± 0%     0.000 ± 0%  -100.00% (p=0.000 n=10)
Counter/With_triple_Label_Values_and_Constraint-16               6.000 ± 0%     3.000 ± 0%   -50.00% (p=0.000 n=10)
Counter/With_repeated_Label_Values-16                            2.000 ± 0%     0.000 ± 0%  -100.00% (p=0.000 n=10)
Counter/With_repeated_Label_Values_and_Constraint-16             4.000 ± 0%     2.000 ± 0%   -50.00% (p=0.000 n=10)
CounterWithLabelValuesConcurrent-16                              1.000 ± 0%     0.000 ± 0%  -100.00% (p=0.000 n=10)

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2023-10-04 18:09:15 +02:00
github-actions[bot] dac14aae41
Merge pull request #1356 from prometheus/dependabot/go_modules/github.com/prometheus/procfs-0.12.0
Bump github.com/prometheus/procfs from 0.11.1 to 0.12.0
2023-10-04 14:54:05 +00:00
dependabot[bot] 87a016c909
Bump github.com/prometheus/procfs from 0.11.1 to 0.12.0
Bumps [github.com/prometheus/procfs](https://github.com/prometheus/procfs) from 0.11.1 to 0.12.0.
- [Release notes](https://github.com/prometheus/procfs/releases)
- [Commits](https://github.com/prometheus/procfs/compare/v0.11.1...v0.12.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/procfs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-04 14:51:07 +00:00
github-actions[bot] 556bf30066
Merge pull request #1357 from prometheus/dependabot/go_modules/golang.org/x/sys-0.12.0
Bump golang.org/x/sys from 0.11.0 to 0.12.0
2023-10-04 14:50:12 +00:00
dependabot[bot] 7004b66eda
Bump golang.org/x/sys from 0.11.0 to 0.12.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.11.0 to 0.12.0.
- [Commits](https://github.com/golang/sys/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-04 14:47:05 +00:00
Arthur Silva Sens 22540dc438
Configure CI to automerge dependabot PRs (#1359)
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
2023-10-04 15:41:39 +01:00
Arthur Silva Sens 4c10365899
Merge pull request #1358 from prometheus/dependabot/go_modules/tutorial/whatsup/github.com/prometheus/client_golang-1.17.0
Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 in /tutorial/whatsup
2023-10-02 14:28:43 +02:00
Arthur Silva Sens 40c7d2fa8b
Merge pull request #1355 from prometheus/dependabot/go_modules/examples/middleware/github.com/prometheus/client_golang-1.17.0
Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 in /examples/middleware
2023-10-02 14:28:30 +02:00
dependabot[bot] 1844c50e03
Bump github.com/prometheus/client_golang in /tutorial/whatsup
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 09:55:17 +00:00
dependabot[bot] e43edfcedc
Bump github.com/prometheus/client_golang in /examples/middleware
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 09:13:35 +00:00
Arthur Silva Sens 3278043c6d
Add changelog entry for 1.17 (#1353)
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
2023-09-30 10:23:27 +01:00
Oleksandr Redko 1bae6c1e63
Deprecated comment should begin with "Deprecated:" (#1347)
See https://go.dev/blog/godoc

Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2023-09-21 12:31:45 +01:00
Oleksandr Redko bbab8fe770
Fix typos in comments, tests, and errors (#1346)
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2023-09-21 12:31:08 +01:00
Arthur Silva Sens df7fa49417
Extend Counters, Summaries and Histograms with creation timestamp (#1313)
* Extend Counters, Summaries and Histograms with creation timestamp

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>

* Backport created timestamp to existing tests

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>

* Last touches (readability and consistency)

Changes:

* Comments for "now" are more explicit and not inlined.
* populateMetrics is simpler and bit more efficient without timestamp to time to timestamp conversionts for more common code.
* Test consistency and simplicity - the fewer variables the better.
* Fixed inconsistency for v2 and MetricVec - let's pass opt.now consistently.
* We don't need TestCounterXXXTimestamp - we test CT in many other places already.
* Added more involved test for counter vectors with created timestamp.
* Refactored normalization for simplicity.
* Make histogram, summaries now consistent.
* Simplified histograms CT flow and implemented proper CT on reset.

TODO for next PRs:
* NewConstSummary and NewConstHistogram - ability to specify CTs there.

Signed-off-by: bwplotka <bwplotka@gmail.com>

* Update prometheus/counter_test.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

---------

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: bwplotka <bwplotka@gmail.com>
2023-09-21 10:46:54 +01:00
Oleksandr Redko 74cc26257c
Add go_godebug_non_default_behavior_tlsmaxrsasize_events_total (#1348)
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2023-09-21 10:46:14 +01:00
Ben Kochie d03abf3a31
Cleanup golangci-lint errcheck (#1339)
Move the errcheck excludes list from an external file to inline in the golangci-lint config file.

Signed-off-by: SuperQ <superq@gmail.com>
2023-09-03 18:34:37 +01:00
PrometheusBot ca6ba04f2f
Update common Prometheus files (#1338)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-09-03 18:34:10 +01:00
PrometheusBot 51d24f8680
Update common Prometheus files (#1332)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-08-15 09:39:13 +02:00
Ben Kochie c17edf09ed
Merge pull request #1304 from prometheus/dependabot/go_modules/google.golang.org/protobuf-1.31.0
Bump google.golang.org/protobuf from 1.30.0 to 1.31.0
2023-08-14 22:18:20 +02:00
dependabot[bot] 8483c5dab8
Bump google.golang.org/protobuf from 1.30.0 to 1.31.0
Bumps google.golang.org/protobuf from 1.30.0 to 1.31.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 14:54:09 +00:00
Ben Kochie 760a55a415
Merge pull request #1330 from prometheus/dependabot/go_modules/tutorial/whatsup/github.com/prometheus/common-0.44.0
Bump github.com/prometheus/common from 0.42.0 to 0.44.0 in /tutorial/whatsup
2023-08-14 16:53:27 +02:00
Ben Kochie f58d0fd655
Merge pull request #1284 from prometheus/dependabot/go_modules/github.com/prometheus/common-0.44.0
Bump github.com/prometheus/common from 0.42.0 to 0.44.0
2023-08-14 16:53:10 +02:00