https://github.com/prometheus/client_golang
Score: 39.28466337036658
Last synced: about 16 hours ago
JSON representation
Repository metadata:
Prometheus instrumentation library for Go applications
- Host: GitHub
- URL: https://github.com/prometheus/client_golang
- Owner: prometheus
- License: apache-2.0
- Created: 2013-01-25T16:32:46.000Z (over 13 years ago)
- Default Branch: main
- Last Pushed: 2026-05-08T18:09:21.000Z (10 days ago)
- Last Synced: 2026-05-12T05:58:54.530Z (7 days ago)
- Language: Go
- Homepage: https://pkg.go.dev/github.com/prometheus/client_golang
- Size: 4.9 MB
- Stars: 5,959
- Watchers: 69
- Forks: 1,267
- Open Issues: 127
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
- Support: supported_go_versions.json
- Notice: NOTICE
- Maintainers: MAINTAINERS.md
Owner metadata:
- Name: Prometheus
- Login: prometheus
- Email:
- Kind: organization
- Description:
- Website: https://prometheus.io
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/3380462?v=4
- Repositories: 45
- Last Synced at: 2024-03-25T20:07:21.963Z
- Profile URL: https://github.com/prometheus
GitHub Events
Total
- Create event: 119
- Delete event: 121
- Fork event: 80
- Issue comment event: 344
- Issues event: 102
- Pull request event: 343
- Pull request review comment event: 232
- Pull request review event: 324
- Push event: 242
- Release event: 5
- Watch event: 430
- Total: 2342
Last Year
- Create event: 37
- Delete event: 46
- Fork event: 33
- Issue comment event: 133
- Issues event: 59
- Pull request event: 134
- Pull request review comment event: 38
- Pull request review event: 68
- Push event: 90
- Release event: 1
- Watch event: 165
- Total: 804
Committers metadata
Last synced: 4 days ago
Total Commits: 1,430
Total Committers: 260
Avg Commits per committer: 5.5
Development Distribution Score (DDS): 0.864
Commits in past year: 134
Committers in past year: 35
Avg Commits per committer in past year: 3.829
Development Distribution Score (DDS) in past year: 0.627
| Name | Commits | |
|---|---|---|
| beorn7 | b****n@s****m | 195 |
| dependabot[bot] | 4****] | 167 |
| beorn7 | b****n@g****m | 140 |
| prombot | p****m@g****m | 86 |
| Matt T. Proud | m****d@g****m | 64 |
| Bartlomiej Plotka | b****a@g****m | 58 |
| Kemal Akkoyun | k****n | 50 |
| Bjoern Rabenstein | b****n@s****m | 41 |
| Julius Volz | j****s@s****m | 36 |
| Ben Kochie | s****q@g****m | 22 |
| Fabian Reinartz | f****z@g****m | 17 |
| Thomas Jackson | j****9@g****m | 13 |
| Arthur Silva Sens | a****s@c****m | 12 |
| André Carvalho | a****c@g****m | 11 |
| Karsten Weiss | k****s@g****m | 11 |
| Simon Pasquier | s****e@r****m | 10 |
| Manuel Rüger | m****l@r****u | 10 |
| Bernerd Schaefer | b****r@g****m | 10 |
| Tobias Schmidt | t****s@s****m | 10 |
| Kevin Pike | k****e@d****e | 10 |
| Marco Jantke | m****e@g****m | 9 |
| Arthur Silva Sens | a****5@g****m | 9 |
| Brian Brazil | b****l@r****o | 8 |
| Sachin Sahu | 7****1 | 8 |
| Robert Vollmert | r****t@g****m | 8 |
| Arianna Vespri | 3****i | 8 |
| Sevag Hanssian | s****n@g****m | 7 |
| György Krajcsovits | g****s@g****m | 7 |
| Arve Knudsen | a****n@g****m | 7 |
| Michael Knyszek | m****k@g****m | 7 |
| and 230 more... | ||
Issue and Pull Request metadata
Last synced: 4 days ago
Total issues: 198
Total pull requests: 661
Average time to close issues: over 1 year
Average time to close pull requests: 15 days
Total issue authors: 137
Total pull request authors: 112
Average comments per issue: 2.7
Average comments per pull request: 1.14
Merged pull request: 458
Bot issues: 1
Bot pull requests: 189
Past year issues: 14
Past year pull requests: 67
Past year average time to close issues: 21 days
Past year average time to close pull requests: 11 days
Past year issue authors: 13
Past year pull request authors: 25
Past year average comments per issue: 0.5
Past year average comments per pull request: 0.43
Past year merged pull request: 36
Past year bot issues: 0
Past year bot pull requests: 13
Top Issue Authors
- beorn7 (23)
- bwplotka (18)
- ArthurSens (8)
- kakkoyun (4)
- krajorama (3)
- dswarbrick (3)
- bboreham (2)
- dashpole (2)
- jkroepke (2)
- ShivaliBandi (2)
- fabxc (2)
- notrobpike (2)
- metalmatze (2)
- ywwg (2)
- totorolee (1)
Top Pull Request Authors
- dependabot[bot] (186)
- prombot (79)
- bwplotka (56)
- ArthurSens (33)
- SuperQ (28)
- kakkoyun (19)
- SachinSahu431 (16)
- saswatamcode (13)
- vesari (9)
- imorph (9)
- ying-jeanne (8)
- mharbison72 (8)
- ywwg (8)
- mmorel-35 (7)
- aknuds1 (7)
Top Issue Labels
- stale (52)
- help wanted (25)
- bug (21)
- enhancement (18)
- good first issue (11)
- keep-open (10)
- feature request (10)
- OpenMetrics (6)
- question (6)
- dependencies (2)
- wip (1)
- low hanging fruit (1)
- github_actions (1)
- v2 (1)
- chore (1)
- kind/ENHANCEMENT (1)
Top Pull Request Labels
- dependencies (186)
- go (120)
- github_actions (47)
- release-note-none (26)
- stale (3)
- kind/ENHANCEMENT (3)
- kind/FEATURE (2)
- OpenMetrics (2)
- kind/BUGFIX (1)
- release (1)
- javascript (1)
- chore (1)
- wip (1)
- utf8 (1)
Package metadata
- Total packages: 30
- Total downloads: unknown
- Total docker downloads: 72,745,518,253
- Total dependent packages: 36,473 (may contain duplicates)
- Total dependent repositories: 107,337 (may contain duplicates)
- Total versions: 684
- Total advisories: 1
proxy.golang.org: github.com/prometheus/client_golang
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 9 months ago)
- Last Synced: 2026-05-18T06:30:57.384Z (about 18 hours ago)
- Versions: 54
- Dependent Packages: 36,473
- Dependent Repositories: 107,337
- Docker Downloads: 71,621,389,002
-
Rankings:
- Docker downloads count: 0.002%
- Dependent packages count: 0.003%
- Dependent repos count: 0.009%
- Average: 0.366%
- Forks count: 0.824%
- Stargazers count: 0.993%
- Advisories:
proxy.golang.org: github.com/prometheus/client_golang/prometheus/push
Package push provides functions to push metrics to a Pushgateway. It uses a builder approach. Create a Pusher with New and then add the various options by using its methods, finally calling Add or Push, like this: See the examples section for more detailed examples. See the documentation of the Pushgateway to understand the meaning of the grouping key and the differences between Push and Add: https://github.com/prometheus/pushgateway
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/push#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 7 days ago)
- Last Synced: 2026-05-17T08:07:51.259Z (1 day ago)
- Versions: 50
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 0.873%
- Stargazers count: 0.992%
- Average: 2.924%
- Dependent packages count: 4.756%
- Dependent repos count: 5.075%
proxy.golang.org: github.com/prometheus/client_golang/exp
package exp contains experimental utilities and APIs for Prometheus. This package is experimental and may contain breaking changes or be removed in the future.
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/exp#section-documentation
- Licenses: Apache-2.0
- Latest release: v0.0.0-20260512195842-e839fbaf72ad (published 6 days ago)
- Last Synced: 2026-05-17T08:14:11.278Z (1 day ago)
- Versions: 3
- Dependent Packages: 0
- Dependent Repositories: 0
- Docker Downloads: 1,124,129,251
-
Rankings:
- Forks count: 0.87%
- Stargazers count: 0.984%
- Average: 3.224%
- Dependent packages count: 5.342%
- Dependent repos count: 5.701%
proxy.golang.org: github.com/prometheus/client_golang/prometheus/internal
Copyright (c) 2015 Björn Rabenstein Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The code in this package is copy/paste to avoid a dependency. Hence this file carries the copyright of the original repo. https://github.com/beorn7/floats Copyright 2022 The Prometheus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. It provides tools to compare sequences of strings and generate textual diffs. Maintaining `GetUnifiedDiffString` here because original repository (https://github.com/pmezard/go-difflib) is no longer maintained.
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/internal#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 1 day ago)
- Last Synced: 2026-05-17T08:12:20.374Z (1 day ago)
- Versions: 50
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 0.713%
- Stargazers count: 0.84%
- Average: 3.567%
- Dependent packages count: 6.151%
- Dependent repos count: 6.563%
proxy.golang.org: github.com/prometheus/client_goLang
- Homepage: https://github.com/prometheus/client_goLang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_goLang#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 9 months ago)
- Last Synced: 2026-05-17T08:08:40.276Z (1 day ago)
- Versions: 52
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 0.583%
- Stargazers count: 0.624%
- Average: 4.388%
- Dependent packages count: 6.999%
- Dependent repos count: 9.346%
proxy.golang.org: github.com/prometheus/client_Golang
- Homepage: https://github.com/prometheus/client_Golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_Golang#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 9 months ago)
- Last Synced: 2026-05-17T08:06:27.781Z (1 day ago)
- Versions: 52
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 0.583%
- Stargazers count: 0.624%
- Average: 4.388%
- Dependent packages count: 6.999%
- Dependent repos count: 9.346%
proxy.golang.org: github.com/prometheus/Client_golang
- Homepage: https://github.com/prometheus/Client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/Client_golang#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 9 months ago)
- Last Synced: 2026-05-15T07:08:33.921Z (4 days ago)
- Versions: 52
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 0.583%
- Stargazers count: 0.624%
- Average: 4.388%
- Dependent packages count: 6.999%
- Dependent repos count: 9.346%
proxy.golang.org: github.com/Prometheus/client_golang
- Homepage: https://github.com/Prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/Prometheus/client_golang#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 9 months ago)
- Last Synced: 2026-04-26T11:42:15.591Z (23 days ago)
- Versions: 52
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 0.583%
- Stargazers count: 0.624%
- Average: 4.388%
- Dependent packages count: 6.999%
- Dependent repos count: 9.346%
proxy.golang.org: github.com/prometheus/client_golang/prometheus/collectors/version
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/collectors/version#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 6 days ago)
- Last Synced: 2026-05-17T08:10:10.529Z (1 day ago)
- Versions: 18
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 4.751%
- Average: 4.91%
- Dependent repos count: 5.07%
proxy.golang.org: github.com/prometheus/client_golang/prometheus/collectors
Package collectors provides implementations of prometheus.Collector to conveniently collect process and Go-related metrics.
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/collectors#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 9 days ago)
- Last Synced: 2026-05-17T08:09:39.664Z (1 day ago)
- Versions: 32
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 4.76%
- Average: 4.92%
- Dependent repos count: 5.08%
proxy.golang.org: github.com/prometheus/client_golang/prometheus/promhttp/internal
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/promhttp/internal#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 9 days ago)
- Last Synced: 2026-05-17T08:09:11.230Z (1 day ago)
- Versions: 7
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 4.76%
- Average: 4.92%
- Dependent repos count: 5.08%
proxy.golang.org: github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil#section-documentation
- Licenses: Apache-2.0, BSD-3-Clause
- Latest release: v1.23.2 (published 12 days ago)
- Last Synced: 2026-05-17T08:11:43.135Z (1 day ago)
- Versions: 16
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 4.779%
- Average: 4.939%
- Dependent repos count: 5.1%
proxy.golang.org: github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header
Package header provides functions for parsing HTTP headers.
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header#section-documentation
- Licenses: Apache-2.0, BSD-3-Clause
- Latest release: v1.23.2 (published 12 days ago)
- Last Synced: 2026-05-17T08:11:08.302Z (1 day ago)
- Versions: 16
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 4.779%
- Average: 4.939%
- Dependent repos count: 5.1%
proxy.golang.org: github.com/prometheus/client_golang/prometheus/promauto
Package promauto provides alternative constructors for the fundamental Prometheus metric types and their …Vec and …Func variants. The difference to their counterparts in the prometheus package is that the promauto constructors register the Collectors with a registry before returning them. There are two sets of constructors. The constructors in the first set are top-level functions, while the constructors in the other set are methods of the Factory type. The top-level functions return Collectors registered with the global registry (prometheus.DefaultRegisterer), while the methods return Collectors registered with the registry the Factory was constructed with. All constructors panic if the registration fails. The following example is a complete program to create a histogram of normally distributed random numbers from the math/rand package: Prometheus's version of a minimal hello-world program: A Factory is created with the With(prometheus.Registerer) function, which enables two usage patterns. With(prometheus.Registerer) can be called once per line: Or it can be used to create a Factory once to be used multiple times: This appears very handy. So why are these constructors locked away in a separate package? The main problem is that registration may fail, e.g. if a metric inconsistent with or equal to the newly to be registered one is already registered. Therefore, the Register method in the prometheus.Registerer interface returns an error, and the same is the case for the top-level prometheus.Register function that registers with the global registry. The prometheus package also provides MustRegister versions for both. They panic if the registration fails, and they clearly call this out by using the Must… idiom. Panicking is problematic in this case because it doesn't just happen on input provided by the caller that is invalid on its own. Things are a bit more subtle here: Metric creation and registration tend to be spread widely over the codebase. It can easily happen that an incompatible metric is added to an unrelated part of the code, and suddenly code that used to work perfectly fine starts to panic (provided that the registration of the newly added metric happens before the registration of the previously existing metric). This may come as an even bigger surprise with the global registry, where simply importing another package can trigger a panic (if the newly imported package registers metrics in its init function). At least, in the prometheus package, creation of metrics and other collectors is separate from registration. You first create the metric, and then you decide explicitly if you want to register it with a local or the global registry, and if you want to handle the error or risk a panic. With the constructors in the promauto package, registration is automatic, and if it fails, it will always panic. Furthermore, the constructors will often be called in the var section of a file, which means that panicking will happen as a side effect of merely importing a package. A separate package allows conservative users to entirely ignore it. And whoever wants to use it will do so explicitly, with an opportunity to read this warning. Enjoy promauto responsibly!
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/promauto#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 12 days ago)
- Last Synced: 2026-05-17T08:12:07.764Z (1 day ago)
- Versions: 50
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 4.779%
- Average: 4.939%
- Dependent repos count: 5.1%
proxy.golang.org: github.com/Prometheus/client_Golang
- Homepage: https://github.com/Prometheus/client_Golang
- Documentation: https://pkg.go.dev/github.com/Prometheus/client_Golang#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 9 months ago)
- Last Synced: 2026-05-17T08:05:02.605Z (1 day ago)
- Versions: 52
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 4.78%
- Average: 4.941%
- Dependent repos count: 5.102%
proxy.golang.org: github.com/prometheus/client_golang/prometheus
Package prometheus is the core instrumentation package. It provides metrics primitives to instrument code for monitoring. It also offers a registry for metrics. Sub-packages allow to expose the registered metrics via HTTP (package promhttp) or push them to a Pushgateway (package push). There is also a sub-package promauto, which provides metrics constructors with automatic registration. All exported functions and methods are safe to be used concurrently unless specified otherwise. As a starting point, a very basic usage example: This is a complete program that exports two metrics, a Gauge and a Counter, the latter with a label attached to turn it into a (one-dimensional) vector. It register the metrics using a custom registry and exposes them via an HTTP server on the /metrics endpoint. The number of exported identifiers in this package might appear a bit overwhelming. However, in addition to the basic plumbing shown in the example above, you only need to understand the different metric types and their vector versions for basic usage. Furthermore, if you are not concerned with fine-grained control of when and how to register metrics with the registry, have a look at the promauto package, which will effectively allow you to ignore registration altogether in simple cases. Above, you have already touched the Counter and the Gauge. There are two more advanced metric types: the Summary and Histogram. A more thorough description of those four metric types can be found in the Prometheus docs: https://prometheus.io/docs/concepts/metric_types/ In addition to the fundamental metric types Gauge, Counter, Summary, and Histogram, a very important part of the Prometheus data model is the partitioning of samples along dimensions called labels, which results in metric vectors. The fundamental types are GaugeVec, CounterVec, SummaryVec, and HistogramVec. While only the fundamental metric types implement the Metric interface, both the metrics and their vector versions implement the Collector interface. A Collector manages the collection of a number of Metrics, but for convenience, a Metric can also “collect itself”. Note that Gauge, Counter, Summary, and Histogram are interfaces themselves while GaugeVec, CounterVec, SummaryVec, and HistogramVec are not. To create instances of Metrics and their vector versions, you need a suitable …Opts struct, i.e. GaugeOpts, CounterOpts, SummaryOpts, or HistogramOpts. While you could create your own implementations of Metric, most likely you will only ever implement the Collector interface on your own. At a first glance, a custom Collector seems handy to bundle Metrics for common registration (with the prime example of the different metric vectors above, which bundle all the metrics of the same name but with different labels). There is a more involved use case, too: If you already have metrics available, created outside of the Prometheus context, you don't need the interface of the various Metric types. You essentially want to mirror the existing numbers into Prometheus Metrics during collection. An own implementation of the Collector interface is perfect for that. You can create Metric instances “on the fly” using NewConstMetric, NewConstHistogram, and NewConstSummary (and their respective Must… versions). NewConstMetric is used for all metric types with just a float64 as their value: Counter, Gauge, and a special “type” called Untyped. Use the latter if you are not sure if the mirrored metric is a Counter or a Gauge. Creation of the Metric instance happens in the Collect method. The Describe method has to return separate Desc instances, representative of the “throw-away” metrics to be created later. NewDesc comes in handy to create those Desc instances. Alternatively, you could return no Desc at all, which will mark the Collector “unchecked”. No checks are performed at registration time, but metric consistency will still be ensured at scrape time, i.e. any inconsistencies will lead to scrape errors. Thus, with unchecked Collectors, the responsibility to not collect metrics that lead to inconsistencies in the total scrape result lies with the implementer of the Collector. While this is not a desirable state, it is sometimes necessary. The typical use case is a situation where the exact metrics to be returned by a Collector cannot be predicted at registration time, but the implementer has sufficient knowledge of the whole system to guarantee metric consistency. The Collector example illustrates the use case. You can also look at the source code of the processCollector (mirroring process metrics), the goCollector (mirroring Go metrics), or the expvarCollector (mirroring expvar metrics) as examples that are used in this package itself. If you just need to call a function to get a single float value to collect as a metric, GaugeFunc, CounterFunc, or UntypedFunc might be interesting shortcuts. While MustRegister is the by far most common way of registering a Collector, sometimes you might want to handle the errors the registration might cause. As suggested by the name, MustRegister panics if an error occurs. With the Register function, the error is returned and can be handled. An error is returned if the registered Collector is incompatible or inconsistent with already registered metrics. The registry aims for consistency of the collected metrics according to the Prometheus data model. Inconsistencies are ideally detected at registration time, not at collect time. The former will usually be detected at start-up time of a program, while the latter will only happen at scrape time, possibly not even on the first scrape if the inconsistency only becomes relevant later. That is the main reason why a Collector and a Metric have to describe themselves to the registry. So far, everything we did operated on the so-called default registry, as it can be found in the global DefaultRegisterer variable. With NewRegistry, you can create a custom registry, or you can even implement the Registerer or Gatherer interfaces yourself. The methods Register and Unregister work in the same way on a custom registry as the global functions Register and Unregister on the default registry. There are a number of uses for custom registries: You can use registries with special properties, see NewPedanticRegistry. You can avoid global state, as it is imposed by the DefaultRegisterer. You can use multiple registries at the same time to expose different metrics in different ways. You can use separate registries for testing purposes. Also note that the DefaultRegisterer comes registered with a Collector for Go runtime metrics (via NewGoCollector) and a Collector for process metrics (via NewProcessCollector). With a custom registry, you are in control and decide yourself about the Collectors to register. The Registry implements the Gatherer interface. The caller of the Gather method can then expose the gathered metrics in some way. Usually, the metrics are served via HTTP on the /metrics endpoint. That's happening in the example above. The tools to expose metrics via HTTP are in the promhttp sub-package. Function for pushing to the Pushgateway can be found in the push sub-package. Functions and examples to push metrics from a Gatherer to Graphite can be found in the graphite sub-package. More ways of exposing metrics can easily be added by following the approaches of the existing implementations.
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 1 day ago)
- Last Synced: 2026-05-17T08:11:40.704Z (1 day ago)
- Versions: 50
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.151%
- Average: 6.357%
- Dependent repos count: 6.563%
proxy.golang.org: github.com/prometheus/client_golang/prometheus/promhttp
Package promhttp provides tooling around HTTP servers and clients. First, the package allows the creation of http.Handler instances to expose Prometheus metrics via HTTP. promhttp.Handler acts on the prometheus.DefaultGatherer. With HandlerFor, you can create a handler for a custom registry or anything that implements the Gatherer interface. It also allows the creation of handlers that act differently on errors or allow to log errors. Second, the package provides tooling to instrument instances of http.Handler via middleware. Middleware wrappers follow the naming scheme InstrumentHandlerX, where X describes the intended use of the middleware. See each function's doc comment for specific details. Finally, the package allows for an http.RoundTripper to be instrumented via middleware. Middleware wrappers follow the naming scheme InstrumentRoundTripperX, where X describes the intended use of the middleware. See each function's doc comment for specific details.
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/promhttp#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 1 day ago)
- Last Synced: 2026-05-17T08:14:35.023Z (1 day ago)
- Versions: 50
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.151%
- Average: 6.357%
- Dependent repos count: 6.563%
proxy.golang.org: github.com/prometheus/client_golang/tutorials/whatsup
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/tutorials/whatsup#section-documentation
- Licenses: Apache-2.0
- Latest release: v0.0.0-20260512195842-e839fbaf72ad (published 6 days ago)
- Last Synced: 2026-05-17T08:13:01.891Z (1 day ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.226%
- Average: 6.435%
- Dependent repos count: 6.643%
proxy.golang.org: github.com/prometheus/client_golang/examples/middleware
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://pkg.go.dev/github.com/prometheus/client_golang/examples/middleware#section-documentation
- Licenses: Apache-2.0
- Latest release: v1.23.2 (published 1 day ago)
- Last Synced: 2026-05-17T08:09:04.010Z (1 day ago)
- Versions: 16
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 7.054%
- Average: 7.505%
- Dependent repos count: 7.956%
ubuntu-24.04: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Licenses:
- Latest release: 1.18.0-3 (published 3 months ago)
- Last Synced: 2026-03-06T10:24:33.154Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-10: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Documentation: https://packages.debian.org/buster/golang-github-prometheus-client-golang
- Licenses:
- Latest release: 0.9.0-1 (published 3 months ago)
- Last Synced: 2026-03-13T07:05:56.903Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.10: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Licenses:
- Latest release: 1.16.0-4 (published 3 months ago)
- Last Synced: 2026-03-10T05:03:27.596Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
guix: go-github-com-prometheus-client-golang
HTTP server and client tools for Prometheus
- Homepage: https://github.com/prometheus/client_golang
- Documentation: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/prometheus.scm#n322
- Licenses: asl2.0
- Latest release: 1.23.2 (published 3 months ago)
- Last Synced: 2026-04-27T16:44:48.782Z (21 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-24.10: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Licenses:
- Latest release: 1.19.1-2 (published 3 months ago)
- Last Synced: 2026-03-08T16:51:16.424Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-20.04: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Licenses:
- Latest release: 0.9.2-0ubuntu3 (published 3 months ago)
- Last Synced: 2026-03-08T02:59:43.750Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Documentation: https://packages.debian.org/bookworm/golang-github-prometheus-client-golang
- Licenses:
- Latest release: 1.14.0-3 (published 3 months ago)
- Last Synced: 2026-03-12T20:14:01.425Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Licenses:
- Latest release: 1.14.0-3 (published 3 months ago)
- Last Synced: 2026-03-11T07:13:00.886Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-22.04: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Licenses:
- Latest release: 1.11.0-3 (published 3 months ago)
- Last Synced: 2026-03-07T04:44:13.621Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Documentation: https://packages.debian.org/bullseye/golang-github-prometheus-client-golang
- Licenses:
- Latest release: 1.9.0-2 (published 3 months ago)
- Last Synced: 2026-03-13T11:32:20.119Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-13: golang-github-prometheus-client-golang
- Homepage: https://github.com/prometheus/client_golang.git
- Documentation: https://packages.debian.org/trixie/golang-github-prometheus-client-golang
- Licenses:
- Latest release: 1.21.1-1 (published 3 months ago)
- Last Synced: 2026-03-13T11:14:04.895Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%