* client: Add Option to provide limit query param for APIs that support it
Signed-off-by: Ivan Ryabov <abbyssoul@gmail.com>
* Renamed formatOptions -> addOptionalURLParams and comment as per review feedback
Signed-off-by: Ivan Ryabov <abbyssoul@gmail.com>
---------
Signed-off-by: Ivan Ryabov <abbyssoul@gmail.com>
The `github.com/matttproud/golang_protobuf_extensions` dependency was
removed in favor of upstream protobuf functions.
Signed-off-by: SuperQ <superq@gmail.com>
* feat: Support zstd encoding
This allows endpoints to respond with zstd compressed metric data, if
the requester supports it.
I have imported a content-encoding parser from
https://github.com/golang/gddo which is an archived repository to
support different content-encoding headers.
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* Update prometheus/promhttp/http.go
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* Update prometheus/promhttp/http.go
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* Update prometheus/promhttp/http.go
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* Integrate review comments
* String typed enum
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* Test with gzip compression
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* Update prometheus/promhttp/http.go
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* Reorder error handling
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* Apply suggestions from code review
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
* Include review suggestions
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
---------
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
chore: Automatically add labels to PRs, based on description
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>
---------
Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>
Signed-off-by: Sachin Sahu <sachinksahu.431@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@users.noreply.github.com>
Co-authored-by: Kemal Akkoyun <kakkoyun@users.noreply.github.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
* testutil compareMetricFamilies: make less error-prone
The functions `GatherAndCompare`, `ScrapeAndCompare` and others that use
`compareMetricFamilies` under the hood can return no error if
`metricNames` includes none of the names found in the scraped/gathered
results. To avoid false Positves (an error being the negative case), we
can return an error if there is is at least one name in `metricNames`
that is not in the filtered results.
Fixes: https://github.com/prometheus/client_golang/issues/1351
Signed-off-by: leonnicolas <leonloechner@gmx.de>
* Add missing metricNames to error
In to see which metric names are missing, we can add them to the error
message.
Signed-off-by: leonnicolas <leonloechner@gmx.de>
* Apply suggestions from code review
- remove if nil check
- use two nested loops instead of map
- use new function `hasMetricByName` for readability
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: leonnicolas <60091705+leonnicolas@users.noreply.github.com>
* prometheus/testutil/testutil_test.go: compare complete error
Before we would only compare the error prefix in `TestScrapeAndCompare`.
Signed-off-by: leonnicolas <leonloechner@gmx.de>
---------
Signed-off-by: leonnicolas <leonloechner@gmx.de>
Signed-off-by: leonnicolas <60091705+leonnicolas@users.noreply.github.com>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
CollectAndFormat is a helper function that returns the formatted metrics
to the caller, allowing them to use it how they want. This is different
to CollectAndCompare where the comparison is done strictly on behalf of
the caller. Often it is more convenient to perform a simple substring
match on the formatted metric.
Signed-off-by: Jack Cassidy <j.cassidy45@gmail.com>