Commit Graph

8 Commits

Author SHA1 Message Date
Oleksandr Redko bbab8fe770
Fix typos in comments, tests, and errors (#1346)
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2023-09-21 12:31:08 +01:00
Soroosh Azary Marhabi 2cfd1eb960
Enable same linters as the Prometheus repo itself (#1056)
* Add gofumpt to github workflow & fix all files for it

Signed-off-by: sazary <soroosh@azary.ir>

* Add goimports to golangci & fix it's issues

Signed-off-by: sazary <soroosh@azary.ir>

* Add revive to golangci & fix it's issues

Signed-off-by: sazary <soroosh@azary.ir>

* Add errcheck & misspell to golangci and fix their issues

Signed-off-by: sazary <soroosh@azary.ir>

* Add govet & gosimple to golangci and fix their issues

Signed-off-by: sazary <soroosh@azary.ir>

* Enable all default linters of golangci

Signed-off-by: sazary <soroosh@azary.ir>
2022-06-17 09:04:06 +02:00
Joseph Woodward 48a686a603
Update query API to support timeouts (#1014)
* Add timeout parameter for queries

Signed-off-by: Joseph Woodward <joseph.woodward@xeuse.com>

* Update api/prometheus/v1/api.go

Co-authored-by: Kemal Akkoyun <kakkoyun@users.noreply.github.com>
Signed-off-by: Joseph Woodward <joseph.woodward@xeuse.com>

* Update api/prometheus/v1/api.go

Co-authored-by: Kemal Akkoyun <kakkoyun@users.noreply.github.com>
Signed-off-by: Joseph Woodward <joseph.woodward@xeuse.com>

* Pass timeout as stringified time.Duration instead of millisecond value

Signed-off-by: Joseph Woodward <joseph.woodward@xeuse.com>

* Update QueryRange API to support timeouts

Signed-off-by: Joseph Woodward <joseph.woodward@xeuse.com>

* Add timeout to test request params

Signed-off-by: Joseph Woodward <joseph.woodward@xeuse.com>

Co-authored-by: Kemal Akkoyun <kakkoyun@users.noreply.github.com>
2022-04-21 07:23:16 +02:00
beorn7 a60c63e313 Update dependencies
Signed-off-by: beorn7 <beorn@grafana.com>
2021-03-11 20:22:47 +01:00
Bartlomiej Plotka 39b478e90c
Added example api code showing how to add auth tokens and user agents to prom client. (#817)
* Added example api code showing how to add auth tokens and user agents to prom client.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Ran go mod tidy.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-11-20 19:58:16 +00:00
Beni Cherniavsky-Paskin 38c67520a3 api client examples: avoid shadowing package with variable
Signed-off-by: Beni Cherniavsky-Paskin <cben@redhat.com>
2019-12-09 14:55:16 +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
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