Commit Graph

1667 Commits

Author SHA1 Message Date
beorn7 82cc0ac61c Add more precise Go version requirements.
Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-17 14:15:46 +02:00
Björn Rabenstein b2924667e3
Merge pull request #660 from prometheus/beorn7/nit
Simplify code
2019-10-16 13:25:32 +02:00
beorn7 679da921f7 Simplify code
`gofmt -s` taught me that this is possible.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-16 12:18:16 +02:00
Björn Rabenstein 39fc195974
Merge pull request #659 from prometheus/beorn7/nit
Use a cleaner initialization of `separatorByteSlice`
2019-10-15 20:02:18 +02:00
beorn7 19af62dcc8 Use a cleaner initialization of `separatorByteSlice`
The `const separatorByte` wasn't used anymore actually. In `vec.go`,
we were using `model.SeparatorByte`, which is better anyway. So remove
the unused constant and initialize `separatorByteSlice` with
`model.SeparatorByte`, too.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-15 19:52:31 +02:00
Björn Rabenstein 9a2ab94c6a
Merge pull request #658 from prometheus/beorn7/release
Cut v1.2.0
2019-10-15 18:20:41 +02:00
beorn7 3ee92dfa31 Cut v1.2.0
One might argue that supporting the newest Pushgateway is just an
enhancement or even a bugfix (and this should be v1.1.1, which would
be a really nice version number). I decided to go for a positive view
of things and call it a feature. If something else changes its
behavior, it's not really a bug from client_golang's point of view.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-15 13:46:37 +02:00
beorn7 b4686f3863 Update dependencies
Just to make sure we are up to date before releasing.
This only affects golang.org/x/sys.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-15 13:45:04 +02:00
beorn7 b8308329f0 Fix function names in API examples
The part after the underscore has to be lowercase. Otherwise, it is
seen as the name of a Go type, which doesn't exist, which will result
in the example not showing up in godoc.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-15 13:43:53 +02:00
Björn Rabenstein c13325c862
Merge pull request #655 from prometheus/beorn7/test
Unflake TestGoCollectorGoroutines
2019-10-15 13:19:50 +02:00
Björn Rabenstein 8b3e008442
Merge pull request #657 from prometheus/beorn7/registry
Make hash collisions in the registry much less likely
2019-10-15 11:43:02 +02:00
Björn Rabenstein e0e84de036
Merge pull request #654 from prometheus/beorn7/push
Minor improvements to the push code
2019-10-15 11:41:22 +02:00
beorn7 ee1078a03c Move registry hashing to xxhash
This is a much stronger hash function than fnv64a and comparably fast
(with super-fast assembly implementation for amd64).

Performance is not critical here anyway.

The old fnv64a is kept for vectors, where collision detection is in
place and the weakness of the hashing doesn't matter that much. I
implemented a vector version with xxhash and found that xxhash is
slower in all cases except very very high cardinality (where it is
only slightly faster). Also, ``xxhash.New`` comes with an allocation
of 80 bytes. Thus, to keep vectors alloc-free, we needed to add a
`sync.Pool`, which would have an additional performance overhead.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-14 21:18:38 +02:00
beorn7 c2e3855f3b Minimal “fix” for hash collisions
This makes the collisions a bit less likely by XOR'ing descIDs rather
than adding them up for the collectorID.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-14 20:14:43 +02:00
beorn7 bf9ff715fe Expose bug #633
Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-14 20:02:58 +02:00
beorn7 6fa429cf42 Unflake TestGoCollectorGoroutines
This is not a great solution, but it's also hard to test for this
moving target.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-14 19:44:28 +02:00
beorn7 bd362a9ced Use HTTP status code constants rather than numerical literals
Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-14 19:27:09 +02:00
beorn7 f24de70161 Update push test to use status code 200
Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-14 19:24:20 +02:00
Björn Rabenstein 3ddc3cfbe5
Merge pull request #652 from ahjdzx/fix_status_code
Fix check status code
2019-10-12 14:49:42 +02:00
Xin Zhang 7c6a9d7568 Fix check status code
Signed-off-by: Xin Zhang <ahjdzx1990@gmail.com>
2019-10-12 16:08:00 +08:00
Björn Rabenstein 9a37535b1b
Merge pull request #646 from prometheus/beorn7/modules
Update dependencies
2019-10-02 12:23:08 +02:00
Guangming Wang 49b3f23433 remove duplicated assignment in v1/api.go (#647)
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-10-02 00:47:28 +03:00
beorn7 eb4edc4474 Update dependencies
This should happen now and then anyway, but in this case, it should
also fix #642.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-09-27 21:09:48 +02:00
Björn Rabenstein 20428fa0bf
Merge pull request #639 from simonpasquier/bump-golang-1.13
Enable Go 1.13
2019-09-13 12:31:02 +02:00
Simon Pasquier 94166ecec9 Enable Go 1.13
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-09-13 12:13:46 +02:00
Björn Rabenstein 7cf0ee13b0
Merge pull request #638 from prometheus/makefile_common
Synchronize Makefile.common from prometheus/prometheus
2019-09-11 11:57:14 +02:00
prombot bc20938140 makefile: update Makefile.common with newer version
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2019-09-11 00:08:33 +00:00
Björn Rabenstein b4781a8cbd
Merge pull request #635 from prometheus/makefile_common
Synchronize Makefile.common from prometheus/prometheus
2019-08-30 13:28:58 +02:00
prombot 330bc3b046 makefile: update Makefile.common with newer version
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2019-08-30 00:08:28 +00:00
Björn Rabenstein 35ef65db67
Merge pull request #634 from prometheus/beorn7/promhttp
Add WriteHeader call to Flush
2019-08-20 10:35:54 +02:00
beorn7 ad58180fde Add WriteHeader call to Flush
Flush is another of the methods that will call WriteHeader if it
hasn't happened yet. Since we want to call observeWriteHeader (if
set), we need to do the WriteHeader call already here, similar to what
we have done in Write and ReadFrom.

This commit also adds comments explaining the above to not tempt
developers to remove the WriteHeader call.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-08-19 18:19:23 +02:00
Björn Rabenstein 4efc3ccc7a
Merge pull request #632 from painhardcore/master
Fix typo in documentation.
2019-08-13 13:46:04 +02:00
Andrey Yurchenkov b0bcec8f2e
Fix typo in documentation
Signed-off-by: Andrey Yurchenkov <painhardcore@gmail.com>
2019-08-13 13:43:39 +03:00
Björn Rabenstein b7953aabc6
Merge pull request #631 from prometheus/beorn7/doc
Update beorn's e-mail and add GH handles
2019-08-12 23:58:09 +02:00
beorn7 d0ebb8fd05 Update beorn's e-mail and add GH handles
Signed-off-by: beorn7 <beorn@grafana.com>
2019-08-12 17:46:22 +02:00
Björn Rabenstein 801fabc446
Merge pull request #630 from csmarchbanks/api-examples
Provide godoc examples for using the api
2019-08-09 23:23:17 +02:00
Chris Marchbanks 48fdc3021b
Provide godoc examples for using the api
Closes #194

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
2019-08-07 20:53:38 -06:00
Björn Rabenstein 170205fb58
Merge pull request #629 from prometheus/beorn7/release
Cut 1.1.0
2019-08-01 15:37:03 +02:00
beorn7 8b8fbc929b Cut 1.1.0
Signed-off-by: beorn7 <beorn@grafana.com>
2019-08-01 14:23:24 +02:00
beorn7 2bb70fc592 Update Go modules
Signed-off-by: beorn7 <beorn@grafana.com>
2019-08-01 14:17:16 +02:00
Björn Rabenstein c0dfcd145f
Merge pull request #628 from tariq1890/docker
add minor Dockerfile improvements
2019-07-31 18:24:48 +02:00
Tariq Ibrahim 8977247c4e
add minor Dockerfile improvements
Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
2019-07-31 09:13:29 -07:00
Björn Rabenstein 8bb84c10f1
Merge pull request #627 from prometheus/beorn7/modules
Update .gitignore
2019-07-30 23:26:25 +02:00
beorn7 5d286d7120 Update .gitignore
Inspired by
https://github.com/prometheus/common/pull/202

Signed-off-by: beorn7 <beorn@grafana.com>
2019-07-30 23:07:13 +02:00
Björn Rabenstein bb9b00a86e
Merge pull request #624 from prometheus/beorn/push
Support new base64 encoding for pushing to the Pushgateway
2019-07-22 21:57:04 +02:00
beorn7 4b95c4ab42 Support new base64 encoding for pushing to the Pushgateway
This should only be released after PGW 0.9 is released.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-07-22 20:31:37 +02:00
Björn Rabenstein c0d684b8af
Merge pull request #623 from prometheus/makefile_common
Synchronize Makefile.common from prometheus/prometheus
2019-07-22 15:54:13 +02:00
beorn7 5322984bff Merge branch 'beorn7/ci' into makefile_common 2019-07-22 15:47:39 +02:00
beorn7 6bcb2c8adf Make lint only run on 1.11 and higher
Signed-off-by: beorn7 <beorn@grafana.com>
2019-07-22 15:45:59 +02:00
prombot 5b37794e6b makefile: update Makefile.common with newer version
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2019-07-20 00:01:36 +00:00