Prometheus instrumentation library for Go applications

Overview

Prometheus Go client library

Build Status Go Report Card go-doc

This is the Go client library for Prometheus. It has two separate parts, one for instrumenting application code, and one for creating clients that talk to the Prometheus HTTP API.

This library requires Go1.9 or later. The minimum required patch releases for older Go versions are Go1.9.7 and Go1.10.3.

Important note about releases and stability

This repository generally follows Semantic Versioning. However, the API client in 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.

Features that require breaking changes in the stable parts of the repository are being batched up and tracked in the v2 milestone. The v2 development happens in a separate branch for the time being. v2 releases off that branch will happen once sufficient stability is reached. In view of the widespread use of this repository, v1 and v2 will coexist for a while to enable a convenient transition.

Instrumenting applications

code-coverage go-doc

The prometheus directory contains the instrumentation library. See the guide on the Prometheus website to learn more about instrumenting applications.

The examples directory contains simple examples of instrumented code.

Client for the Prometheus HTTP API

code-coverage go-doc

The api/prometheus directory contains the client for the Prometheus HTTP API. It allows you to write Go applications that query time series data from a Prometheus server. It is still in alpha stage.

Where is model, extraction, and text?

The model packages has been moved to prometheus/common/model.

The extraction and text packages are now contained in prometheus/common/expfmt.

Contributing and community

See the contributing guidelines and the Community section of the homepage.

Comments
  • Add timer helper function

    Add timer helper function

    @beorn7 we didn't discuss this at all so I'm not sure if I tested how you would like or even implemented the timer correctly, I just went off the API you described in #231

    opened by stuartnelson3 34
  • v1.12.0 exposes some high cardinality metrics

    v1.12.0 exposes some high cardinality metrics

    It seems that v1.12.0 includes some extra high cardinality metrics, most likely autogenerated by Go itself thanks to #955.

    Here's a full diff of metrics between 1.11 and 1.12 - https://gist.github.com/prymitive/3d16b79a8187448bf6e0d61db7336ca0

    Having so many extra metrics exposed by default might cause problems for people with lots of Go services.

    opened by prymitive 30
  • go1.11rc1 modules

    go1.11rc1 modules

    Looks like the v1 directory name is messing with go module's semantic import versioning.

    Note: I'm working outside of the GOPATH

    main.go

    package main
    
    import (
    	_ "github.com/prometheus/client_golang/api/prometheus/v1"
    )
    
    func main() {}
    

    commands

    go get golang.org/x/build/version/go1.10rc1
    go1.10rc1 download
    go1.11rc1 mod init prom_thing
    go1.11rc1 build
    

    output

    go: finding github.com/prometheus/client_golang/api/prometheus latest
    go: finding github.com/prometheus/client_golang/api latest
    build prom_thing: cannot find module for path github.com/prometheus/client_golang/api/prometheus/v1
    
    opened by icholy 29
  • Alert Manager API

    Alert Manager API

    This is a reboot of the 9 month old #263 PR. It builds on that work by adding the /status endpoint and reorganises the code so that it is a little DRYer and the package name matches the import path.

    Feedback welcome.

    opened by au-phiware 29
  • Feature Request: Permit histogram's Observe() method to take an observation count

    Feature Request: Permit histogram's Observe() method to take an observation count

    We had a case where we in theory update a histogram at some frequency. In actuality, we only update it when things are happening, and when nothing is happening, we just count the amount of time that has passed and then update it with that many ~zeros~ [edit: observations] when the next thing happens.

    Right now adding a value to a historgram N times takes N calls of Observe(). It would be very nice if we could pass N as a parameter instead, and if I follow the code, it could be done in constant time.

    opened by lavalamp 28
  • Create a public registry interface and separate out HTTP exposition

    Create a public registry interface and separate out HTTP exposition

    @grobie who might be most keen on this. @juliusv whom I gave a short preview in person. But then probably everybody else is interested, @fabxc , @brian-brazil , …

    General context and approch

    This is the first part of the long awaited wider refurbishment of client_golang/prometheus/.... After a lot of struggling, I decided to not go for one breaking big-bang, but cut things into smaller steps after all, mostly to keep the changes manageable and easy to review. I'm aiming for having the invasive breaking changes concentrated in as few steps as possible (ideally one). Some steps will not be breaking at all, but typically there will be breaking changes that only affect quite special cases so that 95+% of users will not be affected. This first step is an example for that, see details below.

    What's happening in this commit?

    This step is about finally creating an exported registry interface. This could not be done by simply export the existing internal implementation because the interface would be way too fat. This commit introduces a qutie lean Registry interface (compared to the previous interval implementation). The functions that act on the default registry are retained (with very few exceptions) so that most use cases won't see a change. However, several of those are deprecated now to clean up the namespace in the future.

    The default registry is kept in the public variable DefaultRegistry. This follows the example of the http package in the standard library (cf. http.DefaultServeMux, http.DefaultClient) with the same implications. (This pattern is somewhat disputed within the Go community but I chose to go with the devil you know instead of creating something more complex or even disallowing any changes to the default registry. The current approach gives everybody the freedom to not touch DefaultRegistry or to do everything with a custom registry to play save.)

    Another important part in making the registry lean is the extraction of the HTTP exposition, which also allows for customization of the HTTP exposition. Note that the separation of metric collection and exposition has the side effect that managing the MetricFamily and Metric protobuf objects in a free-list or pool isn't really feasible anymore. By now (with better GC in more recent Go versions), the returns were anyway dimisishing. To be effective at all, scrapes had to happen more often than GC cycles, and even then most elements of the protobufs (everything excetp the MetricFamily and Metric structs themselves) would still cause allocation churn. In a future breaking change, the signature of the Write method in the Metric interface will be adjusted accordingly. In this commit, avoiding breakage is more important.

    The following issues are fixed by this commit (some solved "on the fly" now that I was touching the code anyway and it would have been stupid to port the bugs): #46 #100 #170 #205

    Documentation including examples have been amended as required.

    What future changes does this commit enable?

    The following items are not yet implemented, but this commit opens the possibility of implementing these independently.

    • The separation of the HTTP exposition allows the implementation of other exposition methods based on the Registry interface, as known from other Prometheus client libraries, e.g. sending the metrics to Graphite. Cf. #197
    • The public Registry interface allows the implementation of convenience tools for testing metrics collection. Those tools can inspect the collected MetricFamily protobufs and compare them to expectation. Also, tests can use their own testing instance of a registry. Cf. #58

    Notable non-goals of this commit

    Non-goals that will be tackled later

    The following two issues are quite closely connected to the changes in this commit but the line has been drawn deliberately to address them in later steps of the refurbishment:

    • InstrumentHandler has many known problems. The plan is to create a saner way to conveniently intrument HTTP handlers and remove the old InstrumentHandler altogether. To keep breakage low for now, even the default handler to expose metrics is still using the old InstrumentHandler. This leads to weird naming inconsistencies but I have deemed it better to not break the world right now but do it in the change that provides better ways of instrumenting HTTP handlers. Cf. #200
    • There is work underway to make the whole handling of metric descriptors (Desc) more intuitive and transparent for the user (including an ability for less strict checking, cf. #47). That's quite invasive from the perspective of the internal code, namely the registry. I deliberately kept those changes out of this commit.
    • While this commit adds new external dependency, the effort to vendor anything within the library that is not visible in any exported types will have to be done later.

    Non-goals that might be tackled later

    There is a strong and understandable urge to divide the prometheus package into a number of sub-packages (like registry, collectors, http, metrics, …). However, to not run into a multitude of circular import chains, this would need to break every single existing usage of the library. (As just one example, if the ubiquitious prometheus.MustRegister (with more than 2,000 uses on GitHub alone) is kept in the prometheus package, but the other registry concerns go into a new registry package, then the prometheus package would import the registry package (to call the actual register method), while at the same time the registry package needs to import the prometheus package to access Collector, Metric, Desc and more. If we moved MustRegister into the registry package, thousands of code lines would have to be fixed (which would be easy if the world was a mono repo, but it is not). If we moved everything else the proposed registry package needs into packages of their own, we would break thousands of other code lines.)

    The main problem is really the top-level functions like MustRegister, Handler, …, which effectively pull everything into one package. Those functions are however very convenient for the easy and very frequent use-cases.

    This problem has to be revisited later.

    For now, I'm trying to keep the amount of exported names in the package as low as possible (e.g. I unexported expvarCollector in this commit because the NewExpvarCollector constructor is enough to export, and it is now consistent with other collectors, like the goCollector).

    Non-goals that won't be tackled anytime soon

    Something that I have played with a lot is "streaming collection", i.e. allow an implementation of the Registry interface that collects metrics incrementally and serves them while doing so. As it has turned out, this has many many issues and makes the Registry interface very clunky. Eventually, I made the call that it is unlikely we will really implement streaming collection; and making the interface more clunky for something that might not even happen is really a big no-no. Note that the Registry interface only creates the in-memory representation of the metric family protobufs in one go. The serializaton onto the wire can still be handled in a streaming fashion (which hasn't been done so far, without causing any trouble, but might be done in the future without breaking any interfaces).

    What are the breaking changes?

    • Signatures of functions pushing to Pushgateway have changed to allow arbitrary grouping (which was planned for a long time anyway, and now that I had to work on the Push code anyway for the registry refurbishment, I finally did it, cf. #100). With the gained insight that pushing to the default registry is almost never the right thing, and now that we are breaking the Push call anyway, all the Push functions were moved to their own package, which cleans up the namespace and is more idiomatic (pushing Collectors is now literally done by push.Collectors(...)).
    • The registry is doing more consistency checks by default now. Past creators of inconsistent metrics could have masked the problem by not setting EnableCollectChecks. Those inconsistencies will now be detected. (But note that a "best effort" metrics collection is now possible with HandlerOpts.ErrorHandling = ContinueOnError.)
    • EnableCollectChecks is gone. The registry is now performing some of those checks anyway (see previous item), and a registry with all of those checks can now be created with NewPedanticRegistry (only used for testing).
    • PanicOnCollectError is gone. This behavior can now be configured when creating a custom HTTP handler.

    This change is Reviewable

    opened by beorn7 27
  • api: reorganize API package and add label values endpoint implementation

    api: reorganize API package and add label values endpoint implementation

    This adds a client side implementation for fetching label values from prometheus api.

    Would love to get some review on this as this is my first contribution here. Some design questions i may have oversimplified:

    1. return a more descriptive value instead of []string? Maybe model.LabelValues?
    2. create a separated interface for metadata api(following the separation on the docs)?

    Related to #290.

    opened by andrestc 26
  • API client doesn't support POST method for Query/QueryRange

    API client doesn't support POST method for Query/QueryRange

    POST support was added to query/query_range API endpoints in prometheus with https://github.com/prometheus/prometheus/pull/3322. This client currently only sends GET requests, which means that it isn't won't work for large query string values. As the API stands today:

    Query(ctx context.Context, query string, ts time.Time) (model.Value, error)
    QueryRange(ctx context.Context, query string, r Range) (model.Value, error)
    

    There isn't really a place to put it, so I see a couple options:

    1. add a NewPOSTAPI method to return an httpAPI instance with a flag to use POST for both query and query_range (this would be done by setting an option in the httpAPI struct-- to be added).
    2. add QueryPost and QueryRangePost to the API interface
    3. add METHOD argument to Query and QueryRange

    I'm not sure what the compatibility guarantees are on this client interface, so I'm not sure how we want to proceed. I'm leaning towards 1 or 2 (probably in that order)

    cc @juliusv

    enhancement help wanted low hanging fruit 
    opened by jacksontj 25
  • new handler instrumentation

    new handler instrumentation

    The main premise is to provide some middleware that a user can compose as s/he wishes, instead of the "all or nothing" approach of the current InstrumentHandler() approach.

    Things to note:

    • This pr makes use of the Observer interface, and additionally adds an ObserverVec interface.
    • The ObserverVec interface was discussed with @beorn7 and necessitated a breaking change to SummaryVec and HistogramVec by changing the return types of their methods for interacting with labels. @beorn7 scanned code usage for this library and saw that while it is a breaking change, in practice he didn't find anyone using methods other than Observe() on the return type, which will not break based on this change. @beorn7 can you confirm this?
    • The tests fail because we are compiling against go-1.6 and go-1.7, while the code requires go-1.8 because of its use of http.Pusher.
    • Additional work needs to be done to check that this works with http/2.
    • The middleware does not register the collectors passed to them. This allows the user to a custom registery, as opposed to the default registry. This is decision is up for discussion.
    • If a user doesn't write an http status in their wrapped handler, our middleware will report the default value (0). If no status is written, go doesn't add a status until all handlers have been executed: https://golang.org/src/net/http/server.go#L1830
    opened by stuartnelson3 25
  • Consider using https://github.com/NYTimes/gziphandler for compression

    Consider using https://github.com/NYTimes/gziphandler for compression

    I have use client_golang to implement a subservice like pushgateway. Every 30s scrape 500k - 700k line metrics from one subservice. And it seems gzip cause very high cpu usage. image

    With this large data, gzip didn't make the request much more quick

    curl -w %{time_connect}:%{time_starttransfer}:%{time_total} -I -H 'Accept-Encoding: gzip' http://k4637v:6060/metrics HTTP/1.1 200 OK Content-Encoding: gzip Content-Length: 4935721 Content-Type: text/plain; version=0.0.4 Date: Wed, 17 Jan 2018 14:25:26 GMT

    0.002:8.412:8.413

    curl -w %{time_connect}:%{time_starttransfer}:%{time_total} -I http://k4637v:6060/metrics HTTP/1.1 200 OK Content-Length: 70412653 Content-Type: text/plain; version=0.0.4 Date: Wed, 17 Jan 2018 14:25:52 GMT

    0.002:10.068:10.068

    enhancement help wanted 
    opened by tinytub 22
  • Add storage.Warnings to client

    Add storage.Warnings to client

    closes https://github.com/prometheus/client_golang/issues/560

    This adds storage.Warnings to the error return of Query and QueryRange. Unfortunately the client.Do() method interface makes this a bit difficult to implement.

    So either we go down this path (where the specific error is a known type people should check for) or we need to change the Do() methods' interface to return a separate "warning" error.

    opened by jacksontj 21
  • multiple goroutines panic

    multiple goroutines panic

    import (
    proclientApi "github.com/prometheus/client_golang/api"
    )
    
    var ProClientMap = make(map[string]proclientApi.Client, 0)
    
    func PromQueryRange(){
        ProClient := proclientV1.NewAPI(ProClientMap[dataSource])
        value, _, err := ProClient.QueryRange(ctx, sql, r)
        if err != nil {
             logger.Errorf("[proQuery]error,[%v]", err)
             return PromMonitorData, err
        }
    }
    

    when concurrent PromQueryRange,ProClient.QueryRange panic,why?

    [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 638 [sleep]:] [2022-11-21 02:02:51 time.Sleep(0x3b9aca00)] [2022-11-21 02:02:51 /usr/local/go/src/runtime/time.go:194 +0x12e] [2022-11-21 02:02:51 github.com/valyala/fasthttp.(*TCPDialer).tcpAddrsClean(0x1493740)] [2022-11-21 02:02:51 /build/vendor/github.com/valyala/fasthttp/tcpdialer.go:372 +0x33] [2022-11-21 02:02:51 created by github.com/valyala/fasthttp.(*TCPDialer).dial.func1] [2022-11-21 02:02:51 /build/vendor/github.com/valyala/fasthttp/tcpdialer.go:282 +0xaa] [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 1187 [IO wait, 2 minutes]:] [2022-11-21 02:02:51 internal/poll.runtime_pollWait(0x7efc942d7e88, 0x72)] [2022-11-21 02:02:51 /usr/local/go/src/runtime/netpoll.go:302 +0x89] [2022-11-21 02:02:51 internal/poll.(*pollDesc).wait(0xc001611a80?, 0xc000b95000?, 0x0)] [2022-11-21 02:02:51 /usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32] [2022-11-21 02:02:51 internal/poll.(*pollDesc).waitRead(...)] [2022-11-21 02:02:51 /usr/local/go/src/internal/poll/fd_poll_runtime.go:88] [2022-11-21 02:02:51 internal/poll.(*FD).Read(0xc001611a80, {0xc000b95000, 0x1000, 0x1000})] [2022-11-21 02:02:51 /usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a] [2022-11-21 02:02:51 net.(*netFD).Read(0xc001611a80, {0xc000b95000?, 0x405ea9?, 0x4?})] [2022-11-21 02:02:51 /usr/local/go/src/net/fd_posix.go:55 +0x29] [2022-11-21 02:02:51 net.(*conn).Read(0xc000222ae0, {0xc000b95000?, 0xc0003d16b0?, 0x1?})] [2022-11-21 02:02:51 /usr/local/go/src/net/net.go:183 +0x45] [2022-11-21 02:02:51 net/http.(*persistConn).Read(0xc00164ac60, {0xc000b95000?, 0xc0012d4540?, 0xc000a5fd30?})] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1929 +0x4e] [2022-11-21 02:02:51 bufio.(*Reader).fill(0xc0004c8ae0)] [2022-11-21 02:02:51 /usr/local/go/src/bufio/bufio.go:106 +0x103] [2022-11-21 02:02:51 bufio.(*Reader).Peek(0xc0004c8ae0, 0x1)] [2022-11-21 02:02:51 /usr/local/go/src/bufio/bufio.go:144 +0x5d] [2022-11-21 02:02:51 net/http.(*persistConn).readLoop(0xc00164ac60)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:2093 +0x1ac] [2022-11-21 02:02:51 created by net/http.(*Transport).dialConn] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1750 +0x173e] [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 3169 [select]:] [2022-11-21 02:02:51 net/http.(*persistConn).writeLoop(0xc0017eed80)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:2392 +0xf5] [2022-11-21 02:02:51 created by net/http.(*Transport).dialConn] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1751 +0x1791] [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 683 [IO wait, 4 minutes]:] [2022-11-21 02:02:51 internal/poll.runtime_pollWait(0x7efc942d7ca8, 0x72)] [2022-11-21 02:02:51 /usr/local/go/src/runtime/netpoll.go:302 +0x89] [2022-11-21 02:02:51 internal/poll.(*pollDesc).wait(0xc000601d80?, 0xc000a30000?, 0x0)] [2022-11-21 02:02:51 /usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32] [2022-11-21 02:02:51 internal/poll.(*pollDesc).waitRead(...)] [2022-11-21 02:02:51 /usr/local/go/src/internal/poll/fd_poll_runtime.go:88] [2022-11-21 02:02:51 internal/poll.(*FD).Read(0xc000601d80, {0xc000a30000, 0x1000, 0x1000})] [2022-11-21 02:02:51 /usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a] [2022-11-21 02:02:51 net.(*netFD).Read(0xc000601d80, {0xc000a30000?, 0x405ea9?, 0x4?})] [2022-11-21 02:02:51 /usr/local/go/src/net/fd_posix.go:55 +0x29] [2022-11-21 02:02:51 net.(*conn).Read(0xc0003d0640, {0xc000a30000?, 0x0?, 0x0?})] [2022-11-21 02:02:51 /usr/local/go/src/net/net.go:183 +0x45] [2022-11-21 02:02:51 net/http.(*persistConn).Read(0xc001185b00, {0xc000a30000?, 0xc0005c7620?, 0xc000a5cd30?})] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1929 +0x4e] [2022-11-21 02:02:51 bufio.(*Reader).fill(0xc000cd6f00)] [2022-11-21 02:02:51 /usr/local/go/src/bufio/bufio.go:106 +0x103] [2022-11-21 02:02:51 bufio.(*Reader).Peek(0xc000cd6f00, 0x1)] [2022-11-21 02:02:51 /usr/local/go/src/bufio/bufio.go:144 +0x5d] [2022-11-21 02:02:51 net/http.(*persistConn).readLoop(0xc001185b00)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:2093 +0x1ac] [2022-11-21 02:02:51 created by net/http.(*Transport).dialConn] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1750 +0x173e] [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 738 [IO wait, 2 minutes]:] [2022-11-21 02:02:51 internal/poll.runtime_pollWait(0x7efc942d7d98, 0x72)] [2022-11-21 02:02:51 /usr/local/go/src/runtime/netpoll.go:302 +0x89] [2022-11-21 02:02:51 internal/poll.(*pollDesc).wait(0xc000410880?, 0xc000e42000?, 0x0)] [2022-11-21 02:02:51 /usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32] [2022-11-21 02:02:51 internal/poll.(*pollDesc).waitRead(...)] [2022-11-21 02:02:51 /usr/local/go/src/internal/poll/fd_poll_runtime.go:88] [2022-11-21 02:02:51 internal/poll.(*FD).Read(0xc000410880, {0xc000e42000, 0x1000, 0x1000})] [2022-11-21 02:02:51 /usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a] [2022-11-21 02:02:51 net.(*netFD).Read(0xc000410880, {0xc000e42000?, 0x405ea9?, 0x4?})] [2022-11-21 02:02:51 /usr/local/go/src/net/fd_posix.go:55 +0x29] [2022-11-21 02:02:51 net.(*conn).Read(0xc000306888, {0xc000e42000?, 0x0?, 0x0?})] [2022-11-21 02:02:51 /usr/local/go/src/net/net.go:183 +0x45] [2022-11-21 02:02:51 net/http.(*persistConn).Read(0xc000d14c60, {0xc000e42000?, 0xc000043b60?, 0xc000a59d30?})] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1929 +0x4e] [2022-11-21 02:02:51 bufio.(*Reader).fill(0xc000cd7a40)] [2022-11-21 02:02:51 /usr/local/go/src/bufio/bufio.go:106 +0x103] [2022-11-21 02:02:51 bufio.(*Reader).Peek(0xc000cd7a40, 0x1)] [2022-11-21 02:02:51 /usr/local/go/src/bufio/bufio.go:144 +0x5d] [2022-11-21 02:02:51 net/http.(*persistConn).readLoop(0xc000d14c60)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:2093 +0x1ac] [2022-11-21 02:02:51 created by net/http.(*Transport).dialConn] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1750 +0x173e] [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 739 [select, 2 minutes]:] [2022-11-21 02:02:51 net/http.(*persistConn).writeLoop(0xc000d14c60)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:2392 +0xf5] [2022-11-21 02:02:51 created by net/http.(*Transport).dialConn] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1751 +0x1791] [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 5497 [select]:] [2022-11-21 02:02:51 net/http.(*persistConn).writeLoop(0xc001253c20)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:2392 +0xf5] [2022-11-21 02:02:51 created by net/http.(*Transport).dialConn] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1751 +0x1791] [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 6315 [select]:] [2022-11-21 02:02:51 github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1()] [2022-11-21 02:02:51 /build/vendor/github.com/go-sql-driver/mysql/connection.go:614 +0xaa] [2022-11-21 02:02:51 created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher] [2022-11-21 02:02:51 /build/vendor/github.com/go-sql-driver/mysql/connection.go:611 +0xfe] [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 1188 [select, 4 minutes]:] [2022-11-21 02:02:51 net/http.(*persistConn).writeLoop(0xc00164ac60)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:2392 +0xf5] [2022-11-21 02:02:51 created by net/http.(*Transport).dialConn] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:1751 +0x1791] [2022-11-21 02:02:51] [2022-11-21 02:02:51 goroutine 6370 [select]:] [2022-11-21 02:02:51 net/http.(*persistConn).roundTrip(0xc000bbf0e0, 0xc000d27240)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:2620 +0x974] [2022-11-21 02:02:51 net/http.(*Transport).roundTrip(0x1495240, 0xc000dc9200)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/transport.go:594 +0x7c9] [2022-11-21 02:02:51 net/http.(*Transport).RoundTrip(0x40d325?, 0xeeb400?)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/roundtrip.go:17 +0x19] [2022-11-21 02:02:51 net/http.send(0xc000dc9200, {0xeeb400, 0x1495240}, {0xd71040?, 0x7efc9477df01?, 0x0?})] [2022-11-21 02:02:51 /usr/local/go/src/net/http/client.go:252 +0x5d8] [2022-11-21 02:02:51 net/http.(*Client).send(0xc0000444c8, 0xc000dc9200, {0x7efc9477dfff?, 0x7efc945f0c00?, 0x0?})] [2022-11-21 02:02:51 /usr/local/go/src/net/http/client.go:176 +0x9b] [2022-11-21 02:02:51 net/http.(*Client).do(0xc0000444c8, 0xc000dc9200)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/client.go:725 +0x8f5] [2022-11-21 02:02:51 net/http.(*Client).Do(...)] [2022-11-21 02:02:51 /usr/local/go/src/net/http/client.go:593] [2022-11-21 02:02:51 github.com/prometheus/client_golang/api.(*httpClient).Do(0xc0000444c0, {0xef08d0, 0xc00003a068}, 0xc000dc9100)] [2022-11-21 02:02:51 /build/vendor/github.com/prometheus/client_golang/api/client.go:100 +0x285] [2022-11-21 02:02:51 github.com/prometheus/client_golang/api/prometheus/v1.(*apiClientImpl).Do(0xd1d0c0?, {0xef08d0?, 0xc00003a068?}, 0xc?)] [2022-11-21 02:02:51 /build/vendor/github.com/prometheus/client_golang/api/prometheus/v1/api.go:1088 +0x43] [2022-11-21 02:02:51 github.com/prometheus/client_golang/api/prometheus/v1.(*apiClientImpl).DoGetFallback(0xd2b1c0?, {0xef08d0, 0xc00003a068}, 0xc00103a630, 0xc0003a019b?)] [2022-11-21 02:02:51 /build/vendor/github.com/prometheus/client_golang/api/prometheus/v1/api.go:1142 +0x1d4] [2022-11-21 02:02:51 github.com/prometheus/client_golang/api/prometheus/v1.(*httpAPI).QueryRange(0xc000c49b78, {0xef08d0, 0xc00003a068}, {0xc00076b880, 0x66}, {{0x0, 0xedb0cd297, 0x14ab420}, {0x0, 0xedb0cd34b, ...}, ...})] [2022-11-21 02:02:51 /build/vendor/github.com/prometheus/client_golang/api/prometheus/v1/api.go:848 +0x3e2] [2022-11-21 02:02:51 ***/pkg/util/prometheus.PromQueryRange({0xc00076b880, 0x66}, {0xc001237dfe?, 0xa?}, {0xc001237e30, 0xc})]

    opened by huyujie 0
  • Groups and labels do not allow keys with the same name

    Groups and labels do not allow keys with the same name

    Currently, group and labels cannot have the same name. If any key is displayed, an error message is displayed. label:xxx already contains grouping label xxx

    The implementation here is very inflexible, for example I want to dynamically group by some label

    There is no such judgment on the prometheus-python client; I recommend using the value of group if it exists

    opened by lusson-luo 0
  • go get -v github.com/prometheus/client_golang/prometheus does not

    go get -v github.com/prometheus/client_golang/prometheus does not

    go version: 1.19.2

    i receive the following error message on command: go env -w GO111MODULE=off; go get -v github.com/prometheus/client_golang/prometheus

    #15 28.71 ../github.com/prometheus/common/expfmt/decode.go:89:38: cannot use v (variable of type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.ReadDelimited:
    #15 28.71 	*io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
    #15 28.71 ../github.com/prometheus/common/expfmt/encode.go:120:40: cannot use v (variable of type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.WriteDelimited:
    #15 28.71 	*io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
    

    here the full jenkins job output:

    #15 3.226 + go env -w GO111MODULE=off
    #15 3.229 + go get -v github.com/prometheus/client_golang/prometheus
    #15 3.232 github.com/prometheus/client_golang (download)
    #15 4.839 github.com/beorn7/perks (download)
    #15 5.520 github.com/cespare/xxhash (download)
    #15 6.170 github.com/golang/protobuf (download)
    #15 8.937 get "google.golang.org/protobuf/encoding/prototext": found meta tag vcs.metaImport{Prefix:"google.golang.org/protobuf", VCS:"git", RepoRoot:"https://go.googlesource.com/protobuf"} at //google.golang.org/protobuf/encoding/prototext?go-get=1
    #15 8.937 get "google.golang.org/protobuf/encoding/prototext": verifying non-authoritative meta tag
    #15 9.080 google.golang.org/protobuf (download)
    #15 10.87 get "google.golang.org/protobuf/encoding/protowire": found meta tag vcs.metaImport{Prefix:"google.golang.org/protobuf", VCS:"git", RepoRoot:"https://go.googlesource.com/protobuf"} at //google.golang.org/protobuf/encoding/protowire?go-get=1
    #15 10.87 get "google.golang.org/protobuf/encoding/protowire": verifying non-authoritative meta tag
    #15 11.00 get "google.golang.org/protobuf/reflect/protoreflect": found meta tag vcs.metaImport{Prefix:"google.golang.org/protobuf", VCS:"git", RepoRoot:"https://go.googlesource.com/protobuf"} at //google.golang.org/protobuf/reflect/protoreflect?go-get=1
    #15 11.00 get "google.golang.org/protobuf/reflect/protoreflect": verifying non-authoritative meta tag
    #15 11.14 get "google.golang.org/protobuf/proto": found meta tag vcs.metaImport{Prefix:"google.golang.org/protobuf", VCS:"git", RepoRoot:"https://go.googlesource.com/protobuf"} at //google.golang.org/protobuf/proto?go-get=1
    #15 11.14 get "google.golang.org/protobuf/proto": verifying non-authoritative meta tag
    #15 11.28 get "google.golang.org/protobuf/reflect/protoregistry": found meta tag vcs.metaImport{Prefix:"google.golang.org/protobuf", VCS:"git", RepoRoot:"https://go.googlesource.com/protobuf"} at //google.golang.org/protobuf/reflect/protoregistry?go-get=1
    #15 11.28 get "google.golang.org/protobuf/reflect/protoregistry": verifying non-authoritative meta tag
    #15 11.41 get "google.golang.org/protobuf/runtime/protoiface": found meta tag vcs.metaImport{Prefix:"google.golang.org/protobuf", VCS:"git", RepoRoot:"https://go.googlesource.com/protobuf"} at //google.golang.org/protobuf/runtime/protoiface?go-get=1
    #15 11.41 get "google.golang.org/protobuf/runtime/protoiface": verifying non-authoritative meta tag
    #15 11.55 get "google.golang.org/protobuf/reflect/protodesc": found meta tag vcs.metaImport{Prefix:"google.golang.org/protobuf", VCS:"git", RepoRoot:"https://go.googlesource.com/protobuf"} at //google.golang.org/protobuf/reflect/protodesc?go-get=1
    #15 11.55 get "google.golang.org/protobuf/reflect/protodesc": verifying non-authoritative meta tag
    #15 11.68 get "google.golang.org/protobuf/runtime/protoimpl": found meta tag vcs.metaImport{Prefix:"google.golang.org/protobuf", VCS:"git", RepoRoot:"https://go.googlesource.com/protobuf"} at //google.golang.org/protobuf/runtime/protoimpl?go-get=1
    #15 11.68 get "google.golang.org/protobuf/runtime/protoimpl": verifying non-authoritative meta tag
    #15 11.69 github.com/prometheus/client_model (download)
    #15 12.44 get "google.golang.org/protobuf/types/known/timestamppb": found meta tag vcs.metaImport{Prefix:"google.golang.org/protobuf", VCS:"git", RepoRoot:"https://go.googlesource.com/protobuf"} at //google.golang.org/protobuf/types/known/timestamppb?go-get=1
    #15 12.44 get "google.golang.org/protobuf/types/known/timestamppb": verifying non-authoritative meta tag
    #15 12.45 github.com/prometheus/common (download)
    #15 13.63 github.com/matttproud/golang_protobuf_extensions (download)
    #15 14.27 github.com/prometheus/procfs (download)
    #15 15.65 get "golang.org/x/sys/unix": found meta tag vcs.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/unix?go-get=1
    #15 15.65 get "golang.org/x/sys/unix": verifying non-authoritative meta tag
    #15 15.79 golang.org/x/sys (download)
    #15 18.46 google.golang.org/protobuf/internal/set
    #15 18.46 google.golang.org/protobuf/internal/flags
    #15 18.48 github.com/beorn7/perks/quantile
    #15 18.48 google.golang.org/protobuf/internal/pragma
    #15 18.48 github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
    #15 18.48 github.com/cespare/xxhash
    #15 18.48 crypto/sha1
    #15 18.56 google.golang.org/protobuf/internal/detrand
    #15 18.56 github.com/prometheus/procfs/internal/util
    #15 18.56 google.golang.org/protobuf/internal/version
    #15 18.57 github.com/prometheus/procfs/internal/fs
    #15 18.57 github.com/prometheus/common/model
    #15 18.66 golang.org/x/sys/unix
    #15 18.66 net
    #15 18.76 google.golang.org/protobuf/internal/errors
    #15 18.87 google.golang.org/protobuf/encoding/protowire
    #15 19.06 google.golang.org/protobuf/reflect/protoreflect
    #15 19.58 google.golang.org/protobuf/internal/descopts
    #15 19.58 google.golang.org/protobuf/internal/encoding/messageset
    #15 19.58 google.golang.org/protobuf/internal/descfmt
    #15 19.58 google.golang.org/protobuf/runtime/protoiface
    #15 19.58 google.golang.org/protobuf/internal/strs
    #15 19.58 google.golang.org/protobuf/internal/order
    #15 19.58 google.golang.org/protobuf/internal/genid
    #15 19.77 google.golang.org/protobuf/reflect/protoregistry
    #15 19.86 google.golang.org/protobuf/internal/encoding/text
    #15 20.57 google.golang.org/protobuf/proto
    #15 20.77 google.golang.org/protobuf/internal/encoding/defval
    #15 21.38 google.golang.org/protobuf/encoding/prototext
    #15 21.38 google.golang.org/protobuf/internal/filedesc
    #15 21.38 github.com/matttproud/golang_protobuf_extensions/pbutil
    #15 21.78 vendor/golang.org/x/net/http/httpproxy
    #15 21.78 net/textproto
    #15 21.78 crypto/x509
    #15 21.86 github.com/prometheus/procfs
    #15 22.36 vendor/golang.org/x/net/http/httpguts
    #15 22.36 mime/multipart
    #15 22.67 google.golang.org/protobuf/internal/encoding/tag
    #15 22.86 google.golang.org/protobuf/internal/impl
    #15 23.57 crypto/tls
    #15 25.78 net/http/httptrace
    #15 25.81 net/http
    #15 25.92 google.golang.org/protobuf/internal/filetype
    #15 26.06 google.golang.org/protobuf/runtime/protoimpl
    #15 26.10 google.golang.org/protobuf/types/known/timestamppb
    #15 26.10 google.golang.org/protobuf/types/descriptorpb
    #15 26.18 github.com/golang/protobuf/ptypes/timestamp
    #15 26.50 google.golang.org/protobuf/reflect/protodesc
    #15 26.88 github.com/golang/protobuf/proto
    #15 27.67 github.com/prometheus/client_model/go
    #15 28.07 github.com/prometheus/client_golang/prometheus/internal
    #15 28.68 expvar
    #15 28.68 github.com/prometheus/common/expfmt
    #15 28.71 # github.com/prometheus/common/expfmt
    #15 28.71 ../github.com/prometheus/common/expfmt/decode.go:89:38: cannot use v (variable of type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.ReadDelimited:
    #15 28.71 	*io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
    #15 28.71 ../github.com/prometheus/common/expfmt/encode.go:120:40: cannot use v (variable of type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.WriteDelimited:
    #15 28.71 	*io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
    

    i have tried it also as recommended from go but this also not work:

    #15 2.146 + go env -w GO111MODULE=on
    #15 2.149 + go install github.com/prometheus/client_golang/[email protected]
    #15 2.226 go: downloading github.com/prometheus/client_golang v1.13.0
    #15 2.275 go: github.com/prometheus/client_golang/[email protected] (in github.com/prometheus/[email protected]):
    #15 2.275 	The go.mod file for the module providing named packages contains one or
    #15 2.275 	more exclude directives. It must not contain directives that would cause
    #15 2.275 	it to be interpreted differently than if it were the main module.
    

    and just in case you came again with this solution: https://github.com/prometheus/client_golang/issues/1154

    this doesn`t help:

    [email protected]:/go/src/camunda-engine-prometheus-exporter# GO111MODULE=off go get -v github.com/prometheus/client_golang
    github.com/prometheus/client_golang (download)
    package github.com/prometheus/client_golang: no Go files in /go/src/github.com/prometheus/client_golang
    
    opened by reimgun 1
  • TestSparseHistogram integer divide by zero on ppc64le

    TestSparseHistogram integer divide by zero on ppc64le

    Whilst updating the golang-github-prometheus-client-golang package in Debian, autopkgtest revealed that the TestSparseHistogram test panics with an integer divide by zero on ppc64el (ppc64le as GOARCH).

    === RUN   TestSparseHistogram
    === RUN   TestSparseHistogram/no_sparse_buckets
    === RUN   TestSparseHistogram/factor_1.1_results_in_schema_3
    === RUN   TestSparseHistogram/factor_1.2_results_in_schema_2
    === RUN   TestSparseHistogram/factor_4_results_in_schema_-1
    --- FAIL: TestSparseHistogram (0.00s)
        --- PASS: TestSparseHistogram/no_sparse_buckets (0.00s)
        --- PASS: TestSparseHistogram/factor_1.1_results_in_schema_3 (0.00s)
        --- PASS: TestSparseHistogram/factor_1.2_results_in_schema_2 (0.00s)
        --- FAIL: TestSparseHistogram/factor_4_results_in_schema_-1 (0.00s)
    panic: runtime error: integer divide by zero [recovered]
    	panic: runtime error: integer divide by zero
    
    goroutine 3103 [running]:
    testing.tRunner.func1.2({0x434f00, 0x8244b0})
    	/usr/lib/go-1.19/src/testing/testing.go:1396 +0x1fc
    testing.tRunner.func1()
    	/usr/lib/go-1.19/src/testing/testing.go:1399 +0x364
    panic({0x434f00, 0x8244b0})
    	/usr/lib/go-1.19/src/runtime/panic.go:884 +0x240
    github.com/prometheus/client_golang/prometheus.(*histogramCounts).observe(0xc0001b4750, 0xc000061d18?, 0xb0710?, 0x0?)
    	/tmp/autopkgtest-lxc.4sj9alys/downtmp/autopkgtest_tmp/_build/src/github.com/prometheus/client_golang/prometheus/histogram.go:636 +0x324
    github.com/prometheus/client_golang/prometheus.(*histogram).observe(0xc0003d8000, 0x3fe0000000000000, 0x10?)
    	/tmp/autopkgtest-lxc.4sj9alys/downtmp/autopkgtest_tmp/_build/src/github.com/prometheus/client_golang/prometheus/histogram.go:807 +0xa4
    github.com/prometheus/client_golang/prometheus.(*histogram).Observe(0xc0003d8000, 0xc95125dbd?)
    	/tmp/autopkgtest-lxc.4sj9alys/downtmp/autopkgtest_tmp/_build/src/github.com/prometheus/client_golang/prometheus/histogram.go:707 +0x5c
    github.com/prometheus/client_golang/prometheus.TestSparseHistogram.func1(0xc0003ae820)
    	/tmp/autopkgtest-lxc.4sj9alys/downtmp/autopkgtest_tmp/_build/src/github.com/prometheus/client_golang/prometheus/histogram_test.go:675 +0x35c
    testing.tRunner(0xc0003ae820, 0xc0003aa470)
    	/usr/lib/go-1.19/src/testing/testing.go:1446 +0x11c
    created by testing.(*T).Run
    	/usr/lib/go-1.19/src/testing/testing.go:1493 +0x36c
    FAIL	github.com/prometheus/client_golang/prometheus	24.050s
    

    All other tested platforms (amd64, arm64, arm, i386, s390x) pass the test.

    Since this may in fact be a Go compiler bug, I will disable that test on ppc64le, but thought it would be prudent to at least raise the issue here, in case there is an easy fix.

    cc: @beorn7

    opened by dswarbrick 9
  • Regression on InstrumentRoundTripperCounter between 1.12.1 & 1.13.0 ?

    Regression on InstrumentRoundTripperCounter between 1.12.1 & 1.13.0 ?

    Hello,

    To begin with, thanks for this package. I use it in various project and it's been of great use.

    I think I noticed a regression between prometheus/[email protected] and prometheus/[email protected]: InstrumentRoundTripperCounter doesn't seem to count anymore.

    Here is a gist of a test which works fine with 1.12.1 and fails in 1.13.0

    In a word, this test creates an HTTP client and then instruments it with github.com/prometheus/client_golang/prometheus/promhttp.InstrumentRoundTripperCounter. It then runs 15 HTTP queries.

    In 1.12.1, the metric counting outgoing requests correctly has a value of 15, whereas with 1.13.0 its value is 0.

    Here are some details on my go version:

    go version go1.19.2 linux/amd64
    

    And some steps how to reproduce:

    1. Create a folder and copy files from Demo gist
    2. Browse to folder and run tests
    3. See the tests fails
    4. Edit go.mod and replace require github.com/prometheus/client_golang v1.13.0 by require github.com/prometheus/client_golang v1.12.1
    5. Run go mod tidy
    6. Run test again and see them succeed

    Output for tests with version 1.13.0:

    $ go test .
    --- FAIL: TestClient_ForRecipient (0.06s)
        regression_test.go:115: my_service_http_outgoing_client_timeout - A constant gauge of HTTP request timeout in milliseconds for the wrapped client.
        regression_test.go:115: my_service_http_outgoing_requests_total - A counter for outgoing requests from the wrapped client.
        regression_test.go:151: code 404
        regression_test.go:151: method get
        regression_test.go:151: url 127.0.0.1/a
        regression_test.go:176: code 404
        regression_test.go:176: method get
        regression_test.go:176: url 127.0.0.1/a
        regression_test.go:181: Metric my_service_http_outgoing_requests_total url:127.0.0.1/a value is 0.000000 . Expecting 15.000000
        regression_test.go:205: url 127.0.0.1/a
    FAIL
    FAIL    github.com/Stoakes/go-pkg/http-client   0.063s
    FAIL
    

    Output with version 1.12.1

    ok      github.com/Stoakes/go-pkg/http-client   0.061s
    
    opened by Stoakes 0
Releases(v1.14.0)
  • v1.14.0(Nov 8, 2022)

    It might look like a small release, but it's quite opposite 😱 There were many non user facing changes and fixes and enormous work from engineers from Grafana to add native histograms in 💪🏾 Enjoy! 😍

    What's Changed

    • [FEATURE] Add Support for Native Histograms. #1150
    • [CHANGE] Extend prometheus.Registry to implement prometheus.Collector interface. #1103

    New Contributors

    • @hairyhenderson made their first contribution in https://github.com/prometheus/client_golang/pull/1118
    • @rfratto made their first contribution in https://github.com/prometheus/client_golang/pull/1103
    • @donotnoot made their first contribution in https://github.com/prometheus/client_golang/pull/1125
    • @rogerogers made their first contribution in https://github.com/prometheus/client_golang/pull/1130
    • @balintzs made their first contribution in https://github.com/prometheus/client_golang/pull/1148
    • @fstab made their first contribution in https://github.com/prometheus/client_golang/pull/1146
    • @jessicalins made their first contribution in https://github.com/prometheus/client_golang/pull/1152

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.13.1...v1.14.0

    Source code(tar.gz)
    Source code(zip)
  • v1.13.1(Nov 2, 2022)

    • [BUGFIX] Fix race condition with Exemplar in Counter. #1146
    • [BUGFIX] Fix CumulativeCount value of +Inf bucket created from exemplar. #1148
    • [BUGFIX] Fix double-counting bug in promhttp.InstrumentRoundTripperCounter. #1118

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.13.0...v1.13.1

    Source code(tar.gz)
    Source code(zip)
  • v1.13.0(Aug 6, 2022)

    • [CHANGE] Minimum required Go version is now 1.17 (we also test client_golang against the new 1.19 version).
    • [ENHANCEMENT] Added prometheus.TransactionalGatherer interface for promhttp.Handler use which allows using low allocation update techniques for custom collectors. #989
    • [ENHANCEMENT] Added exemplar support to prometheus.NewConstHistogram. See ExampleNewConstHistogram_WithExemplar example on how to use it. #986
    • [ENHANCEMENT] prometheus/push.Pusher now has context-aware methods that pass context to HTTP requests. #1028
    • [ENHANCEMENT] prometheus/push.Pusher has now Error method that retrieve last error. #1075
    • [ENHANCEMENT] testutil.GatherAndCompare provides now readable diff on failed comparisons. #998
    • [ENHANCEMENT] Query API now supports timeouts. #1014
    • [ENHANCEMENT] New MetricVec method DeletePartialMatch(labels Labels) for deleting all metrics that match provided labels. #1013
    • [ENHANCEMENT] api.Config now accepts passing custom *http.Client. #1025
    • [BUGFIX] Raise exemplar labels limit from 64 to 128 bytes as specified in OpenMetrics spec. #1091
    • [BUGFIX] Allow adding exemplar to +Inf bucket to const histograms. #1094
    • [ENHANCEMENT] Most promhttp.Instrument* middlewares now support adding exemplars to metrics. This allows hooking those to your tracing middleware that retrieves trace ID and puts it in exemplar if present. #1055
    • [ENHANCEMENT] Added testutil.ScrapeAndCompare method. #1043
    • [BUGFIX] Fixed GopherJS build support. #897
    • [ENHANCEMENT] :warning: Added way to specify what runtime/metrics collectors.NewGoCollector should use. See ExampleGoCollector_WithAdvancedGoMetrics. #1102

    New Contributors ❤️

    • @alissa-tung made their first contribution in https://github.com/prometheus/client_golang/pull/1000
    • @wperron made their first contribution in https://github.com/prometheus/client_golang/pull/986
    • @zhijian-pro made their first contribution in https://github.com/prometheus/client_golang/pull/1005
    • @dohnto made their first contribution in https://github.com/prometheus/client_golang/pull/1021
    • @tatsuhiro-t made their first contribution in https://github.com/prometheus/client_golang/pull/1028
    • @sourikghosh made their first contribution in https://github.com/prometheus/client_golang/pull/998
    • @josephwoodward made their first contribution in https://github.com/prometheus/client_golang/pull/1014
    • @stone-z made their first contribution in https://github.com/prometheus/client_golang/pull/1013
    • @yolossn made their first contribution in https://github.com/prometheus/client_golang/pull/1025
    • @xrstf made their first contribution in https://github.com/prometheus/client_golang/pull/1039
    • @dependabot made their first contribution in https://github.com/prometheus/client_golang/pull/1051
    • @sazary made their first contribution in https://github.com/prometheus/client_golang/pull/1056
    • @oiooj made their first contribution in https://github.com/prometheus/client_golang/pull/1075
    • @fredr made their first contribution in https://github.com/prometheus/client_golang/pull/1095
    • @inosato made their first contribution in https://github.com/prometheus/client_golang/pull/1096
    • @arun-shopify made their first contribution in https://github.com/prometheus/client_golang/pull/1094
    • @paralin made their first contribution in https://github.com/prometheus/client_golang/pull/897
    Commits
    • go.mod: Set minimal support version of go to 1.15 by @mrueg in https://github.com/prometheus/client_golang/pull/980
    • Enable CodeQL Analysis by @kakkoyun in https://github.com/prometheus/client_golang/pull/982
    • Added Transactional Gatherer allowed cached solutions by @bwplotka in https://github.com/prometheus/client_golang/pull/989
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/992
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/1003
    • Fix deprecated NewBuildInfoCollector API by @alissa-tung in https://github.com/prometheus/client_golang/pull/1000
    • Add exemplar support for const histogram by @wperron in https://github.com/prometheus/client_golang/pull/986
    • Fixed lint warning. by @bwplotka in https://github.com/prometheus/client_golang/pull/1007
    • .circleci: Add config to test against go1.18 by @kakkoyun in https://github.com/prometheus/client_golang/pull/1006
    • When prefix is empty, no more dots should be written by @zhijian-pro in https://github.com/prometheus/client_golang/pull/1005
    • Add statebot config by @kakkoyun in https://github.com/prometheus/client_golang/pull/1001
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/1009
    • Remove workaround for pre go1.15 by @johejo in https://github.com/prometheus/client_golang/pull/1010
    • go.mod: Update dependencies by @mrueg in https://github.com/prometheus/client_golang/pull/1018
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/1019
    • Refactor apiClientImpl.DoGetFallback by @dohnto in https://github.com/prometheus/client_golang/pull/1021
    • Added info about our slack channel. by @bwplotka in https://github.com/prometheus/client_golang/pull/1029
    • push: Add PushContext and AddContext to Pusher by @tatsuhiro-t in https://github.com/prometheus/client_golang/pull/1028
    • Make Query requests idempotent by @dohnto in https://github.com/prometheus/client_golang/pull/1022
    • Bump minimum required Go version to 1.16 by @mrueg in https://github.com/prometheus/client_golang/pull/10327
    • Update query API to support timeouts by @josephwoodward in https://github.com/prometheus/client_golang/pull/1014
    • Implement deletion based on partially matching labels by @stone-z in https://github.com/prometheus/client_golang/pull/1013
    • Document WithTimeout option for Query/QueryRange by @josephwoodward in https://github.com/prometheus/client_golang/pull/1037
    • client: Allow configuration of http client by @yolossn in https://github.com/prometheus/client_golang/pull/1025
    • update branch names in a few links by @xrstf in https://github.com/prometheus/client_golang/pull/1039
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/1045
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/1046
    • prometheus: Fix convention violating names for generated collector metrics by @kakkoyun in https://github.com/prometheus/client_golang/pull/1048
    • Remove -Inf buckets from go collector histograms by @kakkoyun in https://github.com/prometheus/client_golang/pull/1049
    • Enable dependabot by @SuperQ in https://github.com/prometheus/client_golang/pull/1050
    • Bump github.com/prometheus/common from 0.33.0 to 0.34.0 by @dependabot in https://github.com/prometheus/client_golang/pull/1051
    • Cut v1.12.2 by @kakkoyun in https://github.com/prometheus/client_golang/pull/1052
    • Update readme after v0.12.2 by @kakkoyun in https://github.com/prometheus/client_golang/pull/1053
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/1061
    • Update minimum supported Go version (1.17) by @SuperQ in https://github.com/prometheus/client_golang/pull/1062
    • Add GitHub settings by @SuperQ in https://github.com/prometheus/client_golang/pull/1063
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/1064
    • Enable same linters as the Prometheus repo itself by @sazary in https://github.com/prometheus/client_golang/pull/1056
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/1068
    • Add Error API for pusher by @oiooj in https://github.com/prometheus/client_golang/pull/1075
    • Bump github.com/prometheus/common from 0.34.0 to 0.35.0 by @dependabot in https://github.com/prometheus/client_golang/pull/1076
    • Merge release-1.12 branch back into main by @beorn7 in https://github.com/prometheus/client_golang/pull/1079
    • Fix version number in VERSION by @beorn7 in https://github.com/prometheus/client_golang/pull/1080
    • Merging release branch back to main again by @beorn7 in https://github.com/prometheus/client_golang/pull/1081
    • Raise exemplar labels limit from 64 to 128 by @bboreham in https://github.com/prometheus/client_golang/pull/1091
    • Update documentation for exemplar label limit by @fredr in https://github.com/prometheus/client_golang/pull/1095
    • Bump github.com/prometheus/common from 0.35.0 to 0.37.0 by @dependabot in https://github.com/prometheus/client_golang/pull/1098
    • Bump google.golang.org/protobuf from 1.28.0 to 1.28.1 by @dependabot in https://github.com/prometheus/client_golang/pull/1099
    • Remove ioutil by @inosato in https://github.com/prometheus/client_golang/pull/1096
    • Bump github.com/prometheus/procfs from 0.7.3 to 0.8.0 by @dependabot in https://github.com/prometheus/client_golang/pull/1097
    • explicitly add +inf bucket in withExemplarsMetric by @arun-shopify in https://github.com/prometheus/client_golang/pull/1094
    • Ensure tests verify request params by @josephwoodward in https://github.com/prometheus/client_golang/pull/1047
    • Fixed support for unordered input of exemplars. by @bwplotka in https://github.com/prometheus/client_golang/pull/1100
    • Added exemplar support to http middleware. by @bwplotka in https://github.com/prometheus/client_golang/pull/1055
    • fix assorted oddities found by golangci-lint by @xrstf in https://github.com/prometheus/client_golang/pull/1040
    • Generate new Go runtime metrics for go 1.19 by @kakkoyun in https://github.com/prometheus/client_golang/pull/1105
    • testutil: Add ScrapeAndCompare by @sazary in https://github.com/prometheus/client_golang/pull/1043
    • Fix build against GopherJS by @paralin in https://github.com/prometheus/client_golang/pull/897
    • collectors.GoCollector: Added rule support for granular metric configuration. by @bwplotka in https://github.com/prometheus/client_golang/pull/1102
    • Cut 1.13.0 by @bwplotka in https://github.com/prometheus/client_golang/pull/1110
    Source code(tar.gz)
    Source code(zip)
  • v1.12.2(May 13, 2022)

    • [CHANGE] Added collectors.WithGoCollections that allows to choose what collection of Go runtime metrics user wants: Equivalent of MemStats structure configured using GoRuntimeMemStatsCollection, new based on dedicated runtime/metrics metrics represented by GoRuntimeMetricsCollection option, or both by specifying GoRuntimeMemStatsCollection | GoRuntimeMetricsCollection flag.
    • [CHANGE] :warning: Change in collectors.NewGoCollector metrics: Reverting addition of new ~80 runtime metrics by default. You can enable this back with GoRuntimeMetricsCollection option or GoRuntimeMemStatsCollection | GoRuntimeMetricsCollection for smooth transition.
    • [BUGFIX] Fixed the bug that causes generated histogram metric names to end with _total. ⚠️ This changes 3 metric names in the new Go collector that was reverted from default in this release.
      • go_gc_heap_allocs_by_size_bytes_total -> go_gc_heap_allocs_by_size_bytes,
      • go_gc_heap_frees_by_size_bytes_total -> go_gc_heap_allocs_by_size_bytes
      • go_gc_pauses_seconds_total -> go_gc_pauses_seconds.
    • [CHANGE] Removed -Inf buckets from new Go Collector histograms.

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.12.1...v1.12.2

    Source code(tar.gz)
    Source code(zip)
  • v1.11.1(Feb 15, 2022)

    • [SECURITY FIX] promhttp: Check validity of method and code label values https://github.com/prometheus/client_golang/pull/987 (Addressed CVE-2022-21698)

    What's Changed

    • promhttp: Check validity of method and code label values by @bwplotka and @kakkoyun in https://github.com/prometheus/client_golang/pull/987

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.11.0...v1.11.1

    Source code(tar.gz)
    Source code(zip)
  • v1.12.1(Jan 29, 2022)

    • [BUGFIX] Make the Go 1.17 collector concurrency-safe #969
      • Use simpler locking in the Go 1.17 collector #975
    • [BUGFIX] Reduce granularity of histogram buckets for Go 1.17 collector #974
    • [ENHANCEMENT] API client: make HTTP reads more efficient #976

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.12.0...v1.12.1

    Source code(tar.gz)
    Source code(zip)
  • v1.12.0(Jan 19, 2022)

    • [CHANGE] example/random: Move flags and metrics into main() #935
    • [FEATURE] API client: Support wal replay status api #944
    • [FEATURE] Use the runtime/metrics package for the Go collector for 1.17+ #955
    • [ENHANCEMENT] API client: Update /api/v1/status/tsdb to include headStats #925
    • [SECURITY FIX] promhttp: Check validity of method and code label values #962 (Addressed CVE-2022-21698)

    What's Changed

    • Address minor issues on the changelog by @kakkoyun in https://github.com/prometheus/client_golang/pull/879
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/888
    • Update status badgets by @SuperQ in https://github.com/prometheus/client_golang/pull/885
    • Updating dependency versions + cleanup by @sivabalan in https://github.com/prometheus/client_golang/pull/881
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/892
    • add ExponentialBucketsRange function by @sbunce in https://github.com/prometheus/client_golang/pull/899
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/909
    • Update cespare/xxhash dependency by @dtrudg in https://github.com/prometheus/client_golang/pull/913
    • example/random: Move flags and metrics into main() by @beorn7 in https://github.com/prometheus/client_golang/pull/935
    • Fix typo by @gozeloglu in https://github.com/prometheus/client_golang/pull/939
    • Add support for go 1.17 by @mrueg in https://github.com/prometheus/client_golang/pull/950
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/928
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/952
    • API: support wal replay status api by @yeya24 in https://github.com/prometheus/client_golang/pull/944
    • Update /api/v1/status/tsdb to include headStats by @prymitive in https://github.com/prometheus/client_golang/pull/925
    • Use the runtime/metrics package for the Go collector for 1.17+ by @mknyszek in https://github.com/prometheus/client_golang/pull/955
    • promhttp: Check validity of method and code label values by @kakkoyun in https://github.com/prometheus/client_golang/pull/962
    • go.*: Update dependencies by @kakkoyun in https://github.com/prometheus/client_golang/pull/965

    New Contributors

    • @sivabalan made their first contribution in https://github.com/prometheus/client_golang/pull/881
    • @sbunce made their first contribution in https://github.com/prometheus/client_golang/pull/899
    • @dtrudg made their first contribution in https://github.com/prometheus/client_golang/pull/913
    • @gozeloglu made their first contribution in https://github.com/prometheus/client_golang/pull/939
    • @mrueg made their first contribution in https://github.com/prometheus/client_golang/pull/950
    • @prymitive made their first contribution in https://github.com/prometheus/client_golang/pull/925
    • @mknyszek made their first contribution in https://github.com/prometheus/client_golang/pull/955

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.11.0...v1.12.0

    Source code(tar.gz)
    Source code(zip)
  • v1.11.0(Jun 7, 2021)

    • [CHANGE] Add new collectors package. #862
    • [CHANGE] prometheus.NewExpvarCollector is deprecated, use collectors.NewExpvarCollector instead. #862
    • [CHANGE] prometheus.NewGoCollector is deprecated, use collectors.NewGoCollector instead. #862
    • [CHANGE] prometheus.NewBuildInfoCollector is deprecated, use collectors.NewBuildInfoCollector instead. #862
    • [FEATURE] Add new collector for database/sql#DBStats. #866
    • [FEATURE] API client: Add exemplars API support. #861
    • [ENHANCEMENT] API client: Add newer fields to Rules API. #855
    • [ENHANCEMENT] API client: Add missing fields to Targets API. #856

    What's Changed

    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/846
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/849
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/853
    • Add newer fields to Rules API by @gouthamve in https://github.com/prometheus/client_golang/pull/855
    • Add missing fields to targets API by @yeya24 in https://github.com/prometheus/client_golang/pull/856
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/857
    • Add exemplars API support by @yeya24 in https://github.com/prometheus/client_golang/pull/861
    • Improve description of MaxAge in summary docs by @Dean-Coakley in https://github.com/prometheus/client_golang/pull/864
    • Add new collectors package by @johejo in https://github.com/prometheus/client_golang/pull/862
    • Add collector for database/sql#DBStats by @johejo in https://github.com/prometheus/client_golang/pull/866
    • Make dbStatsCollector more DRY by @beorn7 in https://github.com/prometheus/client_golang/pull/867
    • Change maintainers from @beorn7 to @bwplotka/@kakkoyun by @beorn7 in https://github.com/prometheus/client_golang/pull/873
    • Document implications of negative observations by @beorn7 in https://github.com/prometheus/client_golang/pull/871
    • Update Go modules by @SuperQ in https://github.com/prometheus/client_golang/pull/875

    New Contributors

    • @gouthamve made their first contribution in https://github.com/prometheus/client_golang/pull/855

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.10.0...v1.11.0

    Source code(tar.gz)
    Source code(zip)
  • v1.10.0(Mar 18, 2021)

    • [CHANGE] Minimum required Go version is now 1.13.
    • [CHANGE] API client: Add matchers to LabelNames and LabesValues. #828
    • [FEATURE] API client: Add buildinfo call. #841
    • [BUGFIX] Fix build on riscv64. #833

    What's Changed

    • Add SECURITY.md by @roidelapluie in https://github.com/prometheus/client_golang/pull/831
    • Bump prometheus/procfs to 0.3.0 to fix building on riscv64 by @zhsj in https://github.com/prometheus/client_golang/pull/833
    • Fix typo in comments in https://github.com/prometheus/client_golang/pull/835
    • Support matchers in labels API by @yeya24 in https://github.com/prometheus/client_golang/pull/828
    • Add buildinfo method by @ntk148v in https://github.com/prometheus/client_golang/pull/841
    • Update dependencies by @beorn7 in https://github.com/prometheus/client_golang/pull/843
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/844
    • Cut v1.10.0 by @beorn7 in https://github.com/prometheus/client_golang/pull/845

    New Contributors

    • @zhsj made their first contribution in https://github.com/prometheus/client_golang/pull/833
    • @ntk148v made their first contribution in https://github.com/prometheus/client_golang/pull/841

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.9.0...v1.10.0

    Source code(tar.gz)
    Source code(zip)
  • v1.9.0(Dec 17, 2020)

    • [FEATURE] NewPidFileFn helper to create process collectors for processes whose PID is read from a file. #804
    • [BUGFIX] promhttp: Prevent endless loop in InstrumentHandler... middlewares with invalid metric or label names. #823

    What's Changed

    • add the NewPidFileFn to helper by @sbookworm in https://github.com/prometheus/client_golang/pull/804
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/809
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/811
    • Added example api code showing how to add auth tokens and user agents to prom client. by @bwplotka in https://github.com/prometheus/client_golang/pull/817
    • Correct spelling: possibilites -> possibilities by @jubalh in https://github.com/prometheus/client_golang/pull/819
    • Be more explicit about the multi-line properties of MultiError by @beorn7 in https://github.com/prometheus/client_golang/pull/821
    • promhttp: Correctly detect invalid metric and label names by @beorn7 in https://github.com/prometheus/client_golang/pull/823
    •  Cut release 1.9.0 by @beorn7 in https://github.com/prometheus/client_golang/pull/826

    New Contributors

    • @sbookworm made their first contribution in https://github.com/prometheus/client_golang/pull/804
    • @jubalh made their first contribution in https://github.com/prometheus/client_golang/pull/819

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.8.0...v1.9.0

    Source code(tar.gz)
    Source code(zip)
  • v1.8.0(Oct 15, 2020)

    • [CHANGE] API client: Use time.Time rather than string for timestamps in RuntimeinfoResult. #777
    • [FEATURE] Export MetricVec to facilitate implementation of vectors of custom Metric types. #803
    • [FEATURE API client: Support /status/tsdb endpoint. #773
    • [ENHANCEMENT] API client: Enable GET fallback on status code 501. #802
    • [ENHANCEMENT] Remove Metric references after reslicing to free up more memory. #784

    What's Changed

    • Add support for tsdb endpoint by @HimaVarsha94 in https://github.com/prometheus/client_golang/pull/773
    • Use time.Time for timestamps in Runtimeinfo by @mxey in https://github.com/prometheus/client_golang/pull/777
    • fix tests warning about string(int) type conversions by @johejo in https://github.com/prometheus/client_golang/pull/779
    • Update collector comment about GC stop-the-world by @roidelapluie in https://github.com/prometheus/client_golang/pull/783
    • Remove reference to Metric after reslicing by @hummerd in https://github.com/prometheus/client_golang/pull/784
    • Support go 1.15 by @roidelapluie in https://github.com/prometheus/client_golang/pull/792
    • Replace with the standard library constant. by @johncming in https://github.com/prometheus/client_golang/pull/793
    • Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/797
    • Remove spurious commas from links to the docs site by @beorn7 in https://github.com/prometheus/client_golang/pull/800
    • API client: Enable fallback on status code 501, too by @beorn7 in https://github.com/prometheus/client_golang/pull/802
    • Export MetricVec (again) by @beorn7 in https://github.com/prometheus/client_golang/pull/803
    • Cut v1.8.0 by @beorn7 in https://github.com/prometheus/client_golang/pull/806

    New Contributors

    • @HimaVarsha94 made their first contribution in https://github.com/prometheus/client_golang/pull/773
    • @mxey made their first contribution in https://github.com/prometheus/client_golang/pull/777
    • @hummerd made their first contribution in https://github.com/prometheus/client_golang/pull/784
    • @johncming made their first contribution in https://github.com/prometheus/client_golang/pull/793

    Full Changelog: https://github.com/prometheus/client_golang/compare/v1.7.1...v1.8.0

    Source code(tar.gz)
    Source code(zip)
  • v1.7.1(Jun 23, 2020)

  • v1.7.0(Jun 17, 2020)

    • [CHANGE] API client: Add start/end parameters to LabelNames and LabelValues. #767
    • [FEATURE] testutil: Add GatherAndCount and enable filtering in CollectAndCount #753
    • [FEATURE] API client: Add support for status and runtimeinfo endpoints. #755
    • [ENHANCEMENT] Wrapping nil with a WrapRegistererWith... function creates a no-op Registerer. #764
    • [ENHANCEMENT] promlint: Allow Kelvin as a base unit for cases like color temperature. #761
    • [BUGFIX] push: Properly handle empty job and label values. #752
    Source code(tar.gz)
    Source code(zip)
  • v1.6.0(Apr 28, 2020)

    • [FEATURE] testutil: Add lint checks for metrics, including a sub-package promlint to expose the linter engine for external usage. #739 #743
    • [ENHANCEMENT] API client: Improve error messages. #731
    • [BUGFIX] process collector: Fix process_resident_memory_bytes on 32bit MS Windows. #734
    Source code(tar.gz)
    Source code(zip)
  • v1.5.1(Mar 14, 2020)

  • v1.5.0(Mar 3, 2020)

    • [FEATURE] promauto: Add a factory to allow automatic registration with a local registry. #713
    • [FEATURE] promauto: Add NewUntypedFunc. #713
    • [FEATURE] API client: Support new metadata endpoint. #718
    Source code(tar.gz)
    Source code(zip)
  • v1.4.1(Feb 7, 2020)

  • v1.4.0(Jan 27, 2020)

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Dec 20, 2019)

  • v1.2.1(Oct 17, 2019)

  • v1.2.0(Oct 15, 2019)

    • [FEATURE] Support pushing to Pushgateway v0.10+. #652
    • [ENHANCEMENT] Improve hashing to make a spurious AlreadyRegisteredError less likely to occur. #657
    • [ENHANCEMENT] API client: Add godoc examples. #630
    • [BUGFIX] promhttp: Correctly call WriteHeader in HTTP middleware. #634
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Aug 1, 2019)

    • [CHANGE] API client: Format time as UTC rather than RFC3339Nano. #617
    • [CHANGE] API client: Add warnings to LabelValues and LabelNames calls. #609
    • [FEATURE] Push: Support base64 encoding in grouping key. #624
    • [FEATURE] Push: Add Delete method to Pusher. #613
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jun 15, 2019)

    This release removes all previously deprecated features, resulting in the breaking changes listed below. As this is v1.0.0, semantic versioning applies from now on, with the exception of the API client and parts marked explicitly as experimental.

    • [CHANGE] Remove objectives from the default Summary. (Objectives have to be set explicitly in the SummaryOpts.) #600
    • [CHANGE] Remove all HTTP related feature in the prometheus package. (Use the promhttp package instead.) #600
    • [CHANGE] Remove push.FromGatherer, push.AddFromGatherer, push.Collectors. (Use push.New instead.) #600
    • [CHANGE] API client: Pass warnings through on non-error responses. #599
    • [CHANGE] API client: Add warnings to Series call. #603
    • [FEATURE] Make process collector work on Microsoft Windows. EXPERIMENTAL #596
    • [FEATURE] API client: Add /labels call. #604
    • [BUGFIX] Make AlreadyRegisteredError usable for wrapped registries. #607
    Source code(tar.gz)
    Source code(zip)
  • v0.9.4(Jun 7, 2019)

    • [CHANGE] API client: Switch to alert values as strings. #585
    • [FEATURE] Add a collector for Go module build information. #595
    • [FEATURE] promhttp: Add an counter for internal errors during HTTP exposition. #594
    • [FEATURE] API client: Support target metadata API. #590
    • [FEATURE] API client: Support storage warnings. #562
    • [ENHANCEMENT] API client: Improve performance handling JSON. #570
    • [BUGFIX] Reduce test flakiness. #573
    Source code(tar.gz)
    Source code(zip)
  • v0.9.3(May 16, 2019)

    • [CHANGE] Required Go version is now 1.9+. #561
    • [FEATURE] API client: Add POST with get fallback for Query/QueryRange. #557
    • [FEATURE] API client: Add alerts endpoint. #552
    • [FEATURE] API client: Add rules endpoint. #508
    • [FEATURE] push: Add option to pick metrics format. #540
    • [ENHANCEMENT] Limit time the Go collector may take to collect memstats, returning results from the previous collection in case of a timeout. #568
    • [ENHANCEMENT] Pusher now requires only a thin interface instead of a full http.Client, facilitating mocking and custom HTTP client implementation. #559
    • [ENHANCEMENT] Memory usage improvement for histograms and summaries without objectives. #536
    • [ENHANCEMENT] Summaries without objectives are now lock-free. #521
    • [BUGFIX] promhttp: InstrumentRoundTripperTrace now takes into account a pre-set context. #582
    • [BUGFIX] TestCounterAddLarge now works on all platforms. #567
    • [BUGFIX] Fix promhttp examples. #535 #544
    • [BUGFIX] API client: Wait for done before writing to shared response body. #532
    • [BUGFIX] API client: Deal with discovered labels properly. #529
    Source code(tar.gz)
    Source code(zip)
  • v0.9.2(Dec 7, 2018)

    • [FEATURE] Support for Go modules. #501
    • [FEATURE] Timer.ObserveDuration returns observed duration. #509
    • [ENHANCEMENT] Improved doc comments and error messages. #504
    • [BUGFIX] Fix race condition during metrics gathering. #512
    • [BUGFIX] Fix testutil metric comparison for Histograms and empty labels. #494 #498
    Source code(tar.gz)
    Source code(zip)
  • v0.9.1(Nov 3, 2018)

    • [FEATURE] Add WriteToTextfile function to facilitate the creation of *.prom files for the textfile collector of the node exporter. #489
    • [ENHANCEMENT] More descriptive error messages for inconsistent label cardinality. #487
    • [ENHANCEMENT] Exposition: Use a GZIP encoder pool to avoid allocations in high-frequency scrape scenarios. #366
    • [ENHANCEMENT] Exposition: Streaming serving of metrics data while encoding. #482
    • [ENHANCEMENT] API client: Add a way to return the body of a 5xx response. #479
    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Oct 15, 2018)

    • [CHANGE] Go1.6 is no longer supported.
    • [CHANGE] More refinements of the Registry consistency checks: Duplicated labels are now detected, but inconsistent label dimensions are now allowed. Collisions with the “magic” metric and label names in Summaries and Histograms are detected now. #108 #417 #471
    • [CHANGE] Changed ProcessCollector constructor. #219
    • [CHANGE] Changed Go counter go_memstats_heap_released_bytes_total to gauge go_memstats_heap_released_bytes. #229
    • [CHANGE] Unexported LabelPairSorter. #453
    • [CHANGE] Removed the Untyped metric from direct instrumentation. #340
    • [CHANGE] Unexported MetricVec. #319
    • [CHANGE] Removed deprecated Set method from Counter #247
    • [CHANGE] Removed deprecated RegisterOrGet and MustRegisterOrGet. #247
    • [CHANGE] API client: Introduced versioned packages.
    • [FEATURE] A Registerer can be wrapped with prefixes and labels. #357
    • [FEATURE] “Describe by collect” helper function. #239
    • [FEATURE] Added package testutil. #58
    • [FEATURE] Timestamp can be explicitly set for const metrics. #187
    • [FEATURE] “Unchecked” collectors are possible now without cheating. #47
    • [FEATURE] Pushing to the Pushgateway reworked in package push to support many new features. (The old functions are still usable but deprecated.) #372 #341
    • [FEATURE] Configurable connection limit for scrapes. #179
    • [FEATURE] New HTTP middlewares to instrument http.Handler and http.RoundTripper. The old middlewares and the pre-instrumented /metrics handler are (strongly) deprecated. #316 #57 #101 #224
    • [FEATURE] “Currying” for metric vectors. #320
    • [FEATURE] A Summary can be created without quantiles. #118
    • [FEATURE] Added a Timer helper type. #231
    • [FEATURE] Added a Graphite bridge. #197
    • [FEATURE] Help strings are now optional. #460
    • [FEATURE] Added process_virtual_memory_max_bytes metric. #438 #440
    • [FEATURE] Added go_gc_cpu_fraction and go_threads metrics. #281 #277
    • [FEATURE] Added promauto package with auto-registering metrics. #385 #393
    • [FEATURE] Add SetToCurrentTime method to Gauge. #259
    • [FEATURE] API client: Add AlertManager, Status, and Target methods. #402
    • [FEATURE] API client: Add admin methods. #398
    • [FEATURE] API client: Support series API. #361
    • [FEATURE] API client: Support querying label values.
    • [ENHANCEMENT] Smarter creation of goroutines during scraping. Solves memory usage spikes in certain situations. #369
    • [ENHANCEMENT] Counters are now faster if dealing with integers only. #367
    • [ENHANCEMENT] Improved label validation. #274 #335
    • [BUGFIX] Creating a const metric with an invalid Desc returns an error. #460
    • [BUGFIX] Histogram observations don't race any longer with exposition. #275
    • [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 responses. #476 #414
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Aug 17, 2016)

    • [CHANGE] Registry is doing more consistency checks. This might break existing setups that used to export inconsistent metrics.
    • [CHANGE] Pushing to Pushgateway moved to package push and changed to allow arbitrary grouping.
    • [CHANGE] Removed SelfCollector.
    • [CHANGE] Removed PanicOnCollectError and EnableCollectChecks methods.
    • [CHANGE] Moved packages to the prometheus/common repo: text, model, extraction.
    • [CHANGE] Deprecated a number of functions.
    • [FEATURE] Allow custom registries. Added Registerer and Gatherer interfaces.
    • [FEATURE] Separated HTTP exposition, allowing custom HTTP handlers (package promhttp) and enabling the creation of other exposition mechanisms.
    • [FEATURE] MustRegister is variadic now, allowing registration of many collectors in one call.
    • [FEATURE] Added HTTP API v1 package.
    • [ENHANCEMENT] Numerous documentation improvements.
    • [ENHANCEMENT] Improved metric sorting.
    • [ENHANCEMENT] Inlined fnv64a hashing for improved performance.
    • [ENHANCEMENT] Several test improvements.
    • [BUGFIX] Handle collisions in MetricVec.
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Jul 27, 2015)

    • [CHANGE] Rename ExporterLabelPrefix to ExportedLabelPrefix.
    • [BUGFIX] Closed gaps in metric consistency check.
    • [BUGFIX] Validate LabelName/LabelSet on JSON unmarshaling.
    • [ENHANCEMENT] Document the possibility to create "empty" metrics in a metric vector.
    • [ENHANCEMENT] Fix and clarify various doc comments and the README.md.
    • [ENHANCEMENT] - (Kind of) solve "The Proxy Problem" of http.InstrumentHandler.
    • [ENHANCEMENT] Change responseWriterDelegator.written to int64.
    Source code(tar.gz)
    Source code(zip)
Owner
Prometheus
Prometheus
atomic measures + Prometheus exposition library

About Atomic measures with Prometheus exposition for the Go programming language. This is free and unencumbered software released into the public doma

Pascal S. de Kloe 24 Sep 27, 2022
An easy to use, extensible health check library for Go applications.

Try browsing the code on Sourcegraph! Go Health Check An easy to use, extensible health check library for Go applications. Table of Contents Example M

Claudemiro 438 Nov 24, 2022
A simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.

Cron.go This is a simple library to handle scheduled tasks. Tasks can be run in a minimum delay of once a second--for which Cron isn't actually design

Robert K 215 Nov 19, 2022
A tool to run queries in defined frequency and expose the count as prometheus metrics.

A tool to run queries in defined frequency and expose the count as prometheus metrics. Supports MongoDB and SQL

S Santhosh Nagaraj 19 Jul 1, 2022
Prometheus support for go-metrics

go-metrics-prometheus This is a reporter for the go-metrics library which will post the metrics to the prometheus client registry . It just updates th

Csergő Bálint 76 Nov 13, 2022
an unofficial prometheus exporter for the Hochwassernachrichtendienst Bayern.

Hochwassernachrichtendienst Exporter an unofficial prometheus exporter for the Hochwassernachrichtendienst Bayern. Usage Usage of ./hochwassernachrich

Maximilian Güntner 4 Nov 2, 2022
rsync wrapper (or output parser) that pushes metrics to prometheus

rsync-prom An rsync wrapper (or output parser) that pushes metrics to prometheus. This allows you to then build dashboards and alerting for your rsync

Michael Stapelberg 34 Nov 25, 2022
Prometheus exporter for Hue Sensors

Prometheus exporter for Hue Sensors This program allows you to gather generic metrics on all your Philips Hue sensors with Prometheus. Installation In

Reinier Schoof 1 Nov 17, 2021
In one particular project, i had to import some key/value data to Prometheus. So i have decided to create my custom-built Node Exporter in Golang.

In one particular project, i had to import some key/value data to Prometheus. So i have decided to create my custom-built Node Exporter in Golang.

Hamid Hosseinzadeh 1 May 19, 2022
Prometheus statistics exporter for Open vSwitch

Prometheus statistics exporter for Open vSwitch Open vSwitch is popular virutal switch that enables high performance software defined networking. Sinc

Ivan 0 Feb 18, 2022
An easy way to add useful startup banners into your Go applications

Try browsing the code on Sourcegraph! Banner Add beautiful banners into your Go applications Table of Contents Motivation Usage API Command line flags

Claudemiro 409 Oct 20, 2022
A simple wrapper to daemonize Go applications.

daemonigo A simple library to daemonize Go programming language applications. Installing $ go get github.com/tyranron/daemonigo After this command da

Kai Ren 38 Jul 15, 2022
Enable your Golang applications to self update with S3

s3update Enable your Golang applications to self update with S3. Requires Go 1.8+ This package enables our internal tools to be updated when new commi

Heetch 103 Jul 20, 2022
A BPMN engine, meant to be embedded in Go applications with minim hurdles, and a pleasant developer experience using it.

A BPMN engine, meant to be embedded in Go applications with minim hurdles, and a pleasant developer experience using it. This approach can increase transparency for non-developers.

Martin W. Kirst 79 Nov 13, 2022
A simple package to daemonize Go applications.

A simple package to daemonize Go applications.

Henrique Dias 0 Nov 13, 2021
Chaosblade executor for chaos experiments on Java applications

Chaosblade-exec-jvm: Chaosblade executor for chaos experiments on Java applications Introduction The project is a chaosblade executor based on jvm-san

null 346 Nov 20, 2022
Library to work with MimeHeaders and another mime types. Library support wildcards and parameters.

Mime header Motivation This library created to help people to parse media type data, like headers, and store and match it. The main features of the li

Anton Ohorodnyk 25 Nov 9, 2022
Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)

eaopt is an evolutionary optimization library Table of Contents Changelog Example Background Features Usage General advice Genetic algorithms Overview

Max Halford 820 Nov 21, 2022
cross-platform, normalized battery information library

battery Cross-platform, normalized battery information library. Gives access to a system independent, typed battery state, capacity, charge and voltag

null 212 Nov 23, 2022