Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prometheus/client_golang
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.16.0
Choose a base ref
...
head repository: prometheus/client_golang
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.19.1
Choose a head ref

Commits on Jun 15, 2023

  1. Merge pull request #1293 from prometheus/release-1.16

    Merge v1.16.0 to main
    bwplotka authored Jun 15, 2023
    Copy the full SHA
    c3fa5a7 View commit details

Commits on Jun 19, 2023

  1. Update common Prometheus files (#1297)

    Signed-off-by: prombot <prometheus-team@googlegroups.com>
    prombot authored Jun 19, 2023
    Copy the full SHA
    f6bb79e View commit details
  2. ci: define minimal permissions to github workflows (#1295)

    Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
    diogoteles08 authored Jun 19, 2023
    Copy the full SHA
    553eb4c View commit details

Commits on Jun 27, 2023

  1. Do not allocate memory when there's no constraints (#1296)

    Signed-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com>
    Okhoshi authored Jun 27, 2023
    Copy the full SHA
    644c80d View commit details

Commits on Jul 20, 2023

  1. histograms: Small code comment and code formatting improvements

    Signed-off-by: beorn7 <beorn@grafana.com>
    beorn7 committed Jul 20, 2023
    Copy the full SHA
    f9db382 View commit details
  2. histogram: Add a no-op span for an otherwise empty histogram

    Fixes #1127.
    
    If a native histogram has no observations and a zero threshold of
    zero, then it is indistinguishable from a classic histogram. To give
    scrapers a hint that it is indeed a native histogram, we add a no-op
    span.
    
    This needs follow-up PRs in prometheus/prometheus and
    prometheus/client_model.
    
    Signed-off-by: beorn7 <beorn@grafana.com>
    beorn7 committed Jul 20, 2023
    Copy the full SHA
    3d82c94 View commit details

Commits on Jul 26, 2023

  1. Bump golang.org/x/sys from 0.8.0 to 0.9.0 (#1306)

    Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.8.0 to 0.9.0.
    - [Commits](golang/sys@v0.8.0...v0.9.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>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 26, 2023
    Copy the full SHA
    3b6fb7a View commit details
  2. Bump google.golang.org/grpc from 1.45.0 to 1.53.0 in /tutorial/whatsup (

    #1307)
    
    Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.45.0 to 1.53.0.
    - [Release notes](https://github.com/grpc/grpc-go/releases)
    - [Commits](grpc/grpc-go@v1.45.0...v1.53.0)
    
    ---
    updated-dependencies:
    - dependency-name: google.golang.org/grpc
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 26, 2023
    Copy the full SHA
    98025d8 View commit details
  3. Merge pull request #1314 from prometheus/beorn7/histogram

    histogram: Enable detection of a native histogram without observations
    bwplotka authored Jul 26, 2023
    Copy the full SHA
    90b169a View commit details
  4. Bump github.com/prometheus/procfs from 0.10.1 to 0.11.0 (#1305)

    Bumps [github.com/prometheus/procfs](https://github.com/prometheus/procfs) from 0.10.1 to 0.11.0.
    - [Release notes](https://github.com/prometheus/procfs/releases)
    - [Commits](prometheus/procfs@v0.10.1...v0.11.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>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 26, 2023
    Copy the full SHA
    6e3b962 View commit details
  5. Update common Prometheus files (#1302)

    Signed-off-by: prombot <prometheus-team@googlegroups.com>
    prombot authored Jul 26, 2023
    Copy the full SHA
    7f2db5f View commit details

Commits on Aug 1, 2023

  1. Fix data-race in metric without code and method but with `WithLabelFr…

    …omCtx` (#1318)
    
    This commit fixes a data race that exists when the metric used in any
    `promhttp` middleware doesn't collect the `code` and `method` but uses
    `WithLabelFromCtx` to collect values from context.
    
    The problem happens because when no `code` and `method` tags are
    collected, the `labels` function returns a pre-initialized map
    `emptyLabels` for every request.
    
    When one or multipe `WithLabelFromCtx` options are configured, the
    returned map from the `labels` function call is used to collect the
    metrics from context which creates a multi-write data race.
    
    Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
    tigrato authored Aug 1, 2023
    Copy the full SHA
    59c00e3 View commit details
  2. Add missing tick "`" in README (#1321)

    Cosmetic change
    
    Signed-off-by: ZiViZiViZ <95288998+ZiViZiViZ@users.noreply.github.com>
    ZiViZiViZ authored Aug 1, 2023
    Copy the full SHA
    23387fe View commit details
  3. Bump golang.org/x/sys from 0.9.0 to 0.10.0 (#1320)

    Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.9.0 to 0.10.0.
    - [Commits](golang/sys@v0.9.0...v0.10.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>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Aug 1, 2023
    Copy the full SHA
    99e905a View commit details
  4. Bump github.com/prometheus/procfs from 0.11.0 to 0.11.1 (#1319)

    Bumps [github.com/prometheus/procfs](https://github.com/prometheus/procfs) from 0.11.0 to 0.11.1.
    - [Release notes](https://github.com/prometheus/procfs/releases)
    - [Commits](prometheus/procfs@v0.11.0...v0.11.1)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/prometheus/procfs
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Aug 1, 2023
    Copy the full SHA
    e6d9092 View commit details

Commits on Aug 5, 2023

  1. docs: trivial grammar fixes to improve readability

    Fix a few typos / grammatical errors in the Godoc comments for promauto.
    Only trivial stuff but slightly helps readability of the docs.
    
    Signed-off-by: Chris Banks <chris.banks@digital.cabinet-office.gov.uk>
    sengi committed Aug 5, 2023
    Copy the full SHA
    f16b435 View commit details

Commits on Aug 8, 2023

  1. Merge pull request #1322 from sengi/docs

    docs: trivial grammar fixes to improve readability in promauto Godoc
    beorn7 authored Aug 8, 2023
    Copy the full SHA
    cdd7f45 View commit details

Commits on Aug 11, 2023

  1. Add Go 1.21 support (#1325)

    * Add Go 1.21 support
    
    Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
    
    * Update README.md
    
    Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
    
    ---------
    
    Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
    kakkoyun authored Aug 11, 2023
    Copy the full SHA
    06d4592 View commit details
  2. Bump prometheus/client_model (#1323)

    By upgrading prometheus/client_model, several test functions had to be re-written due to 2 breaking changes made in protobuf when parsing messages to text:
    1. '<' and '>' characters were replaced with '{' and '}' respectively.
    2. The text format is non-deterministic. More information in golang/protobuf#1121
    
    Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
    ArthurSens authored Aug 11, 2023
    Copy the full SHA
    1a88780 View commit details

Commits on Aug 13, 2023

  1. histogram docs: Fixed minor nit. (#1324)

    Signed-off-by: bwplotka <bwplotka@gmail.com>
    bwplotka authored Aug 13, 2023
    Copy the full SHA
    6f576e2 View commit details

Commits on Aug 14, 2023

  1. Update building (#1326)

    * Remove unused / non-standard .go-version.
    * Cleanup indenting in Makefile.
    * Enable dependabot for subdirs.
    * Update golanci-lint CI.
    * Update go.mod version directives to match supported versions.
    * Disable golanci-lint unused-parameter.
    
    Signed-off-by: SuperQ <superq@gmail.com>
    SuperQ authored Aug 14, 2023
    Copy the full SHA
    4abd83d View commit details
  2. Bump github.com/prometheus/client_golang in /examples/middleware

    Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.13.1 to 1.16.0.
    - [Release notes](https://github.com/prometheus/client_golang/releases)
    - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
    - [Commits](v1.13.1...v1.16.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>
    dependabot[bot] authored Aug 14, 2023
    Copy the full SHA
    0e33cf9 View commit details
  3. Bump github.com/prometheus/client_golang in /tutorial/whatsup

    Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1-0.20230416215738-0963f595c689 to 1.16.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/commits/v1.16.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>
    dependabot[bot] authored Aug 14, 2023
    Copy the full SHA
    390448f View commit details
  4. Bump golang.org/x/sys from 0.10.0 to 0.11.0

    Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.10.0 to 0.11.0.
    - [Commits](golang/sys@v0.10.0...v0.11.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>
    dependabot[bot] authored Aug 14, 2023
    Copy the full SHA
    f215f75 View commit details
  5. Merge pull request #1331 from prometheus/dependabot/go_modules/golang…

    ….org/x/sys-0.11.0
    
    Bump golang.org/x/sys from 0.10.0 to 0.11.0
    SuperQ authored Aug 14, 2023
    Copy the full SHA
    301a7bd View commit details
  6. Merge pull request #1329 from prometheus/dependabot/go_modules/tutori…

    …al/whatsup/github.com/prometheus/client_golang-1.16.0
    
    Bump github.com/prometheus/client_golang from 1.15.1-0.20230416215738-0963f595c689 to 1.16.0 in /tutorial/whatsup
    SuperQ authored Aug 14, 2023
    Copy the full SHA
    adb0180 View commit details
  7. Merge pull request #1328 from prometheus/dependabot/go_modules/exampl…

    …es/middleware/github.com/prometheus/client_golang-1.16.0
    
    Bump github.com/prometheus/client_golang from 1.13.1 to 1.16.0 in /examples/middleware
    SuperQ authored Aug 14, 2023
    Copy the full SHA
    fa04b7b View commit details
  8. Bump github.com/prometheus/common in /tutorial/whatsup

    Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.42.0 to 0.44.0.
    - [Release notes](https://github.com/prometheus/common/releases)
    - [Commits](prometheus/common@v0.42.0...v0.44.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>
    dependabot[bot] authored Aug 14, 2023
    Copy the full SHA
    802a963 View commit details
  9. Bump github.com/prometheus/common from 0.42.0 to 0.44.0

    Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.42.0 to 0.44.0.
    - [Release notes](https://github.com/prometheus/common/releases)
    - [Commits](prometheus/common@v0.42.0...v0.44.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>
    dependabot[bot] authored Aug 14, 2023
    Copy the full SHA
    85f4592 View commit details
  10. 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
    SuperQ authored Aug 14, 2023
    Copy the full SHA
    f58d0fd View commit details
  11. Merge pull request #1330 from prometheus/dependabot/go_modules/tutori…

    …al/whatsup/github.com/prometheus/common-0.44.0
    
    Bump github.com/prometheus/common from 0.42.0 to 0.44.0 in /tutorial/whatsup
    SuperQ authored Aug 14, 2023
    Copy the full SHA
    760a55a View commit details
  12. 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>
    dependabot[bot] authored Aug 14, 2023
    Copy the full SHA
    8483c5d View commit details
  13. 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
    SuperQ authored Aug 14, 2023
    Copy the full SHA
    c17edf0 View commit details

Commits on Aug 15, 2023

  1. Update common Prometheus files (#1332)

    Signed-off-by: prombot <prometheus-team@googlegroups.com>
    prombot authored Aug 15, 2023
    Copy the full SHA
    51d24f8 View commit details

Commits on Sep 3, 2023

  1. Update common Prometheus files (#1338)

    Signed-off-by: prombot <prometheus-team@googlegroups.com>
    prombot authored Sep 3, 2023
    Copy the full SHA
    ca6ba04 View commit details
  2. 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>
    SuperQ authored Sep 3, 2023
    Copy the full SHA
    d03abf3 View commit details

Commits on Sep 21, 2023

  1. Add go_godebug_non_default_behavior_tlsmaxrsasize_events_total (#1348)

    Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
    alexandear authored Sep 21, 2023
    Copy the full SHA
    74cc262 View commit details
  2. 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>
    Arthur Silva Sens and bwplotka authored Sep 21, 2023
    Copy the full SHA
    df7fa49 View commit details
  3. Fix typos in comments, tests, and errors (#1346)

    Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
    alexandear authored Sep 21, 2023
    Copy the full SHA
    bbab8fe View commit details
  4. Deprecated comment should begin with "Deprecated:" (#1347)

    See https://go.dev/blog/godoc
    
    Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
    alexandear authored Sep 21, 2023
    Copy the full SHA
    1bae6c1 View commit details

Commits on Sep 30, 2023

  1. Add changelog entry for 1.17 (#1353)

    Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
    Arthur Silva Sens authored Sep 30, 2023
    Copy the full SHA
    3278043 View commit details

Commits on Oct 1, 2023

  1. 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](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>
    dependabot[bot] authored Oct 1, 2023
    Copy the full SHA
    e43edfc View commit details
  2. 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](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>
    dependabot[bot] authored Oct 1, 2023
    Copy the full SHA
    1844c50 View commit details

Commits on Oct 2, 2023

  1. Merge pull request #1355 from prometheus/dependabot/go_modules/exampl…

    …es/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
    Arthur Silva Sens authored Oct 2, 2023
    Copy the full SHA
    40c7d2f View commit details
  2. Merge pull request #1358 from prometheus/dependabot/go_modules/tutori…

    …al/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
    Arthur Silva Sens authored Oct 2, 2023
    Copy the full SHA
    4c10365 View commit details

Commits on Oct 4, 2023

  1. Configure CI to automerge dependabot PRs (#1359)

    Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
    Arthur Silva Sens authored Oct 4, 2023
    Copy the full SHA
    22540dc View commit details
  2. 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](golang/sys@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>
    dependabot[bot] authored Oct 4, 2023
    Copy the full SHA
    7004b66 View commit details
  3. 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
    github-actions[bot] authored Oct 4, 2023
    Copy the full SHA
    556bf30 View commit details
  4. 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](prometheus/procfs@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>
    dependabot[bot] authored Oct 4, 2023
    Copy the full SHA
    87a016c View commit details
  5. 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
    github-actions[bot] authored Oct 4, 2023
    Copy the full SHA
    dac14aa View commit details
Showing with 2,788 additions and 1,635 deletions.
  1. +16 −0 .github/dependabot.yml
  2. +23 −0 .github/workflows/automerge-dependabot.yml
  3. +8 −4 .github/workflows/codeql-analysis.yml
  4. +10 −6 .github/workflows/go.yml
  5. +11 −11 .github/workflows/golangci-lint.yml
  6. +0 −1 .go-version
  7. +28 −5 .golangci.yml
  8. +22 −1 CHANGELOG.md
  9. +1 −0 MAINTAINERS.md
  10. +9 −5 Makefile
  11. +4 −4 Makefile.common
  12. +4 −3 README.md
  13. +1 −1 VERSION
  14. +1 −1 api/prometheus/v1/api_test.go
  15. +1 −1 api/prometheus/v1/example_test.go
  16. +9 −10 examples/middleware/go.mod
  17. +17 −472 examples/middleware/go.sum
  18. +1 −3 examples/middleware/httpmiddleware/httpmiddleware.go
  19. +51 −0 examples/versioncollector/main.go
  20. +7 −0 generate-go-collector.bash
  21. +9 −11 go.mod
  22. +19 −416 go.sum
  23. +88 −43 prometheus/benchmark_test.go
  24. +1 −1 prometheus/collectors/expvar_collector.go
  25. +174 −0 prometheus/collectors/go_collector_go121_test.go
  26. +196 −0 prometheus/collectors/go_collector_go122_test.go
  27. +6 −3 prometheus/collectors/go_collector_latest.go
  28. +47 −0 prometheus/collectors/version/version.go
  29. +18 −8 prometheus/counter.go
  30. +122 −9 prometheus/counter_test.go
  31. +18 −10 prometheus/desc.go
  32. +2 −2 prometheus/example_metricvec_test.go
  33. +67 −18 prometheus/examples_test.go
  34. +1 −1 prometheus/expvar_collector.go
  35. +7 −7 prometheus/expvar_collector_test.go
  36. +4 −4 prometheus/gauge.go
  37. +14 −3 prometheus/gauge_test.go
  38. +1 −1 prometheus/gen_go_collector_metrics_set.go
  39. +1 −1 prometheus/go_collector_latest_test.go
  40. +82 −0 prometheus/go_collector_metrics_go121_test.go
  41. +93 −0 prometheus/go_collector_metrics_go122_test.go
  42. +124 −46 prometheus/histogram.go
  43. +437 −41 prometheus/histogram_test.go
  44. +1 −1 prometheus/internal/difflib.go
  45. +44 −16 prometheus/labels.go
  46. +3 −0 prometheus/metric.go
  47. +2 −2 prometheus/process_collector_other.go
  48. +26 −0 prometheus/process_collector_wasip1.go
  49. +3 −3 prometheus/promauto/auto.go
  50. +2 −2 prometheus/promhttp/http_test.go
  51. +3 −6 prometheus/promhttp/instrument_server.go
  52. +1 −1 prometheus/promhttp/instrument_server_test.go
  53. +2 −2 prometheus/push/push.go
  54. +1 −1 prometheus/push/push_test.go
  55. +3 −3 prometheus/registry.go
  56. +32 −25 prometheus/registry_test.go
  57. +30 −11 prometheus/summary.go
  58. +56 −2 prometheus/summary_test.go
  59. +33 −0 prometheus/testutil/promlint/problem.go
  60. +24 −286 prometheus/testutil/promlint/promlint.go
  61. +54 −0 prometheus/testutil/promlint/promlint_test.go
  62. +33 −0 prometheus/testutil/promlint/validation.go
  63. +40 −0 prometheus/testutil/promlint/validations/counter_validations.go
  64. +101 −0 prometheus/testutil/promlint/validations/generic_name_validations.go
  65. +32 −0 prometheus/testutil/promlint/validations/help_validations.go
  66. +63 −0 prometheus/testutil/promlint/validations/histogram_validations.go
  67. +118 −0 prometheus/testutil/promlint/validations/units.go
  68. +17 −2 prometheus/testutil/testutil.go
  69. +21 −1 prometheus/testutil/testutil_test.go
  70. +64 −0 prometheus/utils_test.go
  71. +47 −8 prometheus/value.go
  72. +55 −0 prometheus/value_test.go
  73. +56 −50 prometheus/vec.go
  74. +28 −14 prometheus/wrap_test.go
  75. +0 −5 scripts/errcheck_excludes.txt
  76. +11 −13 tutorial/whatsup/go.mod
  77. +26 −27 tutorial/whatsup/go.sum
  78. +1 −1 tutorial/whatsup/internal/playground_test.go
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -4,3 +4,19 @@ updates:
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "gomod"
directory: "/examples/middleware"
schedule:
interval: "monthly"
- package-ecosystem: "gomod"
directory: "/tutorial/whatsup"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
23 changes: 23 additions & 0 deletions .github/workflows/automerge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526 # v1.6.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
12 changes: 8 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -20,6 +20,10 @@ on:
schedule:
- cron: '31 21 * * 6'

# Minimal permissions to be inherited by any job that don't declare it's own permissions
permissions:
contents: read

jobs:
analyze:
name: Analyze
@@ -38,11 +42,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +57,7 @@ jobs:
# 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)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -67,4 +71,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
16 changes: 10 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,11 @@ on:
push:
branches:
- main
- 'release-*'
- "release-*"

# Minimal permissions to be inherited by any job that don't declare it's own permissions
permissions:
contents: read

jobs:
test:
@@ -14,20 +18,20 @@ jobs:

strategy:
matrix:
go_version: ["1.18", "1.19", "1.20"]
go_version: ["1.20", "1.21", "1.22"]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1

- name: Set up Go ${{ matrix.go_version }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5.0.0
with:
go-version: ${{ matrix.go_version }}

- name: Cache Go modules
id: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: v1-go${{ matrix.go_version }}
@@ -39,4 +43,4 @@ jobs:

- name: Run style and unused
if: ${{ matrix.go_version == '1.20' }}
run: make style unused
run: make style unused
22 changes: 11 additions & 11 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
# This action is synced from https://github.com/prometheus/prometheus
name: golangci-lint
on:
push:
@@ -10,29 +12,27 @@ on:
- ".golangci.yml"
pull_request:

permissions:
contents: read # to fetch code (actions/checkout)
permissions: # added using https://github.com/step-security/secure-repo
contents: read

jobs:
golangci:
permissions:
contents: read # to fetch code (actions/checkout)
pull-requests: read # to fetch pull requests (golangci/golangci-lint-action)

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@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.18.x
go-version: 1.20.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@v3.4.0
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
args: --verbose
version: v1.51.2
version: v1.54.2
1 change: 0 additions & 1 deletion .go-version

This file was deleted.

33 changes: 28 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---

run:
deadline: 5m
skip-files:
# Skip autogenerated files.
- ^.*\.(pb|y)\.go$

output:
sort-results: true

linters:
enable:
- deadcode
- depguard
- durationcheck
- errorlint
@@ -23,10 +24,8 @@ linters:
- predeclared
- revive
- staticcheck
- structcheck
- unconvert
- unused
- varcheck
- wastedassign

issues:
@@ -39,9 +38,33 @@ issues:
- structcheck

linters-settings:
depguard:
rules:
main:
deny:
#- pkg: "sync/atomic"
# desc: "Use go.uber.org/atomic instead of sync/atomic"
- pkg: "github.com/stretchr/testify/assert"
desc: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
- pkg: "github.com/go-kit/kit/log"
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
- pkg: "io/ioutil"
desc: "Use corresponding 'os' or 'io' functions instead."
#- pkg: "regexp"
# desc: "Use github.com/grafana/regexp instead of regexp"
errcheck:
exclude: scripts/errcheck_excludes.txt
exclude-functions:
# The following 2 methods always return nil as the error
- (*github.com/cespare/xxhash/v2.Digest).Write
- (*github.com/cespare/xxhash/v2.Digest).WriteString
- (*bufio.Writer).WriteRune
goimports:
local-prefixes: github.com/prometheus/client_golang
gofumpt:
extra-rules: true
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
severity: warning
disabled: true
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
## Unreleased

## 1.19.0 / 2023-02-27

The module `prometheus/common v0.48.0` introduced an incompatibility when used together with client_golang (See https://github.com/prometheus/client_golang/pull/1448 for more details). If your project uses client_golang and you want to use `prometheus/common v0.48.0` or higher, please update client_golang to v1.19.0.

* [CHANGE] Minimum required go version is now 1.20 (we also test client_golang against new 1.22 version). #1445 #1449
* [FEATURE] collectors: Add version collector. #1422 #1427

## 1.18.0 / 2023-12-22

* [FEATURE] promlint: Allow creation of custom metric validations. #1311
* [FEATURE] Go programs using client_golang can be built in wasip1 OS. #1350
* [BUGFIX] histograms: Add timer to reset ASAP after bucket limiting has happened. #1367
* [BUGFIX] testutil: Fix comparison of metrics with empty Help strings. #1378
* [ENHANCEMENT] Improved performance of `MetricVec.WithLabelValues(...)`. #1360

## 1.17.0 / 2023-09-27

* [CHANGE] Minimum required go version is now 1.19 (we also test client_golang against new 1.21 version). #1325
* [FEATURE] Add support for Created Timestamps in Counters, Summaries and Historams. #1313
* [ENHANCEMENT] Enable detection of a native histogram without observations. #1314

## 1.16.0 / 2023-06-15

* [BUGFIX] api: Switch to POST for LabelNames, Series, and QueryExemplars. #1252
@@ -295,7 +316,7 @@ _This release removes all previously deprecated features, resulting in the break
* [BUGFIX] Fixed goroutine leaks. #236 #472
* [BUGFIX] Fixed an error message for exponential histogram buckets. #467
* [BUGFIX] Fixed data race writing to the metric map. #401
* [BUGFIX] API client: Decode JSON on a 4xx respons but do not on 204
* [BUGFIX] API client: Decode JSON on a 4xx response but do not on 204
responses. #476 #414

## 0.8.0 / 2016-08-17
1 change: 1 addition & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Arthur Silva Sens <arthursens2005@gmail.com> @ArthurSens
* Bartłomiej Płotka <bwplotka@gmail.com> @bwplotka
* Kemal Akkoyun <kakkoyun@gmail.com> @kakkoyun
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -21,14 +21,18 @@ test: deps common-test
test-short: deps common-test-short

.PHONY: generate-go-collector-test-files
VERSIONS := 1.17 1.18 1.19 1.20
VERSIONS := 1.20 1.21 1.22
generate-go-collector-test-files:
for GO_VERSION in $(VERSIONS); do \
docker run --rm -v $(PWD):/workspace -w /workspace golang:$$GO_VERSION go run prometheus/gen_go_collector_metrics_set.go; \
mv -f go_collector_metrics* prometheus; \
done
docker run \
--platform linux/amd64 \
--rm -v $(PWD):/workspace \
-w /workspace \
golang:$$GO_VERSION \
bash ./generate-go-collector.bash; \
done; \
go mod tidy

.PHONY: fmt
fmt: common-format
$(GOIMPORTS) -local github.com/prometheus/client_golang -w .

8 changes: 4 additions & 4 deletions Makefile.common
Original file line number Diff line number Diff line change
@@ -49,19 +49,19 @@ endif
GOTEST := $(GO) test
GOTEST_DIR :=
ifneq ($(CIRCLE_JOB),)
ifneq ($(shell which gotestsum),)
ifneq ($(shell command -v gotestsum > /dev/null),)
GOTEST_DIR := test-results
GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml --
endif
endif

PROMU_VERSION ?= 0.14.0
PROMU_VERSION ?= 0.15.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz

SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.51.2
GOLANGCI_LINT_VERSION ?= v1.54.2
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
@@ -178,7 +178,7 @@ endif
.PHONY: common-yamllint
common-yamllint:
@echo ">> running yamllint on all YAML files in the repository"
ifeq (, $(shell which yamllint))
ifeq (, $(shell command -v yamllint > /dev/null))
@echo "yamllint not installed so skipping"
else
yamllint .
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -10,13 +10,14 @@ This is the [Go](http://golang.org) client library for
instrumenting application code, and one for creating clients that talk to the
Prometheus HTTP API.

__This library requires Go1.18 or later.__
**This library requires Go1.20 or later.**
> The library mandates the use of Go1.20 or subsequent versions. While it has demonstrated functionality with versions as old as Go 1.17, our commitment remains to offer support and rectifications for only the most recent three major releases.
## Important note about releases and stability

This repository generally follows [Semantic
Versioning](https://semver.org/). However, the API client in
prometheus/client_golang/api/… is still considered experimental. Breaking
`prometheus/client_golang/api/…` is still considered experimental. Breaking
changes of the API client will _not_ trigger a new major release. The same is
true for selected other new features explicitly marked as **EXPERIMENTAL** in
CHANGELOG.md.
@@ -83,7 +84,7 @@ To cut a minor version:
7. Announce on the prometheus-announce mailing list, slack and Twitter.
8. Merge the release branch back to the `main` using the "merge without squashing" approach (!).

> NOTE: In case of merge conflicts, you can checkout the release branch in a new branch, e.g. <yourname>/resolve-conflicts`, fix the merge problems there, and then do a PR into main from the new branch. In that way, you still get all the commits in the release branch back into `main`, but leave the release branch alone.
> NOTE: In case of merge conflicts, you can checkout the release branch in a new branch, e.g. `<yourname>/resolve-conflicts`, fix the merge problems there, and then do a PR into main from the new branch. In that way, you still get all the commits in the release branch back into `main`, but leave the release branch alone.
To cut the patch version:

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.0
1.19.1
2 changes: 1 addition & 1 deletion api/prometheus/v1/api_test.go
Original file line number Diff line number Diff line change
@@ -1441,7 +1441,7 @@ func TestAPIClientDo(t *testing.T) {
}
} else {
if warnings != nil {
t.Fatalf("unexpexted warnings: %v", warnings)
t.Fatalf("unexpected warnings: %v", warnings)
}
}

2 changes: 1 addition & 1 deletion api/prometheus/v1/example_test.go
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ func ExampleAPI_queryRangeWithBasicAuth() {
client, err := api.NewClient(api.Config{
Address: "http://demo.robustperception.io:9090",
// We can use amazing github.com/prometheus/common/config helper!
RoundTripper: config.NewBasicAuthRoundTripper("me", "defintely_me", "", api.DefaultRoundTripper),
RoundTripper: config.NewBasicAuthRoundTripper("me", "definitely_me", "", "", api.DefaultRoundTripper),
})
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
Loading