Commit Graph

31 Commits

Author SHA1 Message Date
Arianna Vespri ff60566f1b
Refactor default runtime metrics tests for Go collector so that default runtime metric set autogenerates (#1631)
* Enable autogeneration for default runtime metrics list in collectors tests according to Go version

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Adapt withDefaultRuntimeMetrics function to work regardless of the Go version

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Autogenerate go collector test for go1.23

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Modify gen_go_collector_set.go to please linter and regenerate files

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Simplify gen_go_collector_set.go logic by modifying func computeMetricsList

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Slight simplification of withDefaultRuntimeMetrics func

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Refactor withDefaultRuntimeMetrics with generated default runtime metrics subsets

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

---------

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>
2024-09-23 14:55:38 +01:00
SuperQ c85ae6b1fe
Update supported Go versions
Now that 1.23 is out, update the supported version matrix to Go 1.21
through 1.23. This allows us to start using `log/slog`.
* Update generated tests.

Signed-off-by: SuperQ <superq@gmail.com>
2024-08-31 22:47:31 +02:00
bwplotka f2dd7b35fd Use pedantic registry in other places too, to double check.
Signed-off-by: bwplotka <bwplotka@gmail.com>
2024-08-20 11:44:35 +01:00
Bartlomiej Plotka 062300ede9
Remove go_memstat_lookups_total; added runtime/metrics calculation to memstat metric's help. (#1577)
* Removeed go_memstat_lookups_total which was always set to 0; added runtime/metrics info to memstat metric helps.

I know we ideally should not remove any metric from default list, but
this one is always zero, so let's save everyone's money.

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

* Update prometheus/go_collector.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

---------

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
2024-08-14 12:11:51 +00:00
Arianna Vespri 3ad272204b
Add default Go runtime metrics for /gc/gogc:percent, /gc/gomemlimit:bytes, /sched/gomaxprocs:threads (#1559)
* Add go_gomaxprocs, go_gogc_percent and go_gomemlimit to the default Go runtime metrics

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Move newly added metrics out of base metrics and into goCollector

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Rethink struct for newly added metrics, adapt and add tests

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Simplify new metrics reading

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Correct loop, add debugging lines

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Make goRuntimeEnvVarsMetrics function Go version dependent

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Fix go mod

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Remove debuggin line

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Move default runtime metrics into the runtime metrics flow, change tests accordingly

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Go version expected default runtime metrics map for tests

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* 1.21 update.

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

* Addressed comments on Arianna's PR.

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

* Use default GoCollector func in test

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

---------

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Co-authored-by: bwplotka <bwplotka@gmail.com>
2024-08-09 20:27:25 +01:00
Bartlomiej Plotka 0ce6d719bc
go collector: add default metrics acceptance tests; adding more context to HELP (#1568)
* go collector: add default metrics acceptance tests; adding more context to HELP

The context and details for help were possible thanks to @vesari research, thanks for that!

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

* Update prometheus/go_collector.go

Co-authored-by: Arianna Vespri <36129782+vesari@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

---------

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: Arianna Vespri <36129782+vesari@users.noreply.github.com>
2024-08-01 09:24:31 +01:00
Ben Kochie fec6b222d9
Update Go tests (#1562)
Add new metric that appeared in 1.22.5 and 1.21.12.
* Improve test output with `cmp.Diff`.

Signed-off-by: SuperQ <superq@gmail.com>
2024-07-15 19:28:14 +02:00
Arthur Silva Sens 0f500036fc
gocollector: Add regex option to allow collection of debug runtime metrics
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
2024-04-08 11:42:03 -03:00
Arthur Silva Sens ec6ba13cc3
chore: Refactor how base metrics are added to Sched metrics
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
2024-03-30 17:17:09 -03:00
Sachin Sahu 50ab457fb7
Auto-update Go Collector Metrics for new Go versions (#1476)
* Autogenerate go_collector_<version>_test.go files

Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>

* Add latest Go version

Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>

* nit: Script to check new Go version

Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>

* Rename file, fix linting issue

Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>

---------

Signed-off-by: Sachin Sahu <75629410+SachinSahu431@users.noreply.github.com>
2024-03-26 12:42:34 +00:00
Max Riveiro c906a5e91a Add support for Go 1.22
Signed-off-by: Max Riveiro <kavu13@gmail.com>
2024-02-15 20:47:39 +03:00
Arthur Silva Sens 38631c665b
chore: Move VersionCollector to collectors directory (#1427)
* collectors/version: Move to collectors directory and remove unrelated code.

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>

* examples: Add Version Collector example

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>

---------

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
2024-01-15 10:07:52 +01:00
Oleksandr Redko 1bae6c1e63
Deprecated comment should begin with "Deprecated:" (#1347)
See https://go.dev/blog/godoc

Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2023-09-21 12:31:45 +01:00
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
Oleksandr Redko 74cc26257c
Add go_godebug_non_default_behavior_tlsmaxrsasize_events_total (#1348)
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2023-09-21 10:46:14 +01:00
Kemal Akkoyun 06d4592b1c
Add Go 1.21 support (#1325)
* Add Go 1.21 support

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Update README.md

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

---------

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2023-08-11 12:27:52 +02:00
Max Coplan c36c6abb8d
[collectors]: fix typo in test assertion (#1153)
Signed-off-by: Max 👨🏽‍💻 Coplan Max.Coplan@walmart.com

Signed-off-by: Max 👨🏽‍💻 Coplan Max.Coplan@walmart.com
Co-authored-by: Max 👨🏽‍💻 Coplan <Max.Coplan@walmart.com>
2023-04-17 21:35:49 +01:00
Bartlomiej Plotka 232b949d1f
Added support for go 1.20. (#1234)
Signed-off-by: bwplotka <bwplotka@gmail.com>
2023-03-21 13:46:37 +00:00
copy rogers b785d0c828
Fix go_collector_latest_test Fail on go1.19 (#1136)
Signed-off-by: rogerogers <rogers@rogerogers.com>

Signed-off-by: rogerogers <rogers@rogerogers.com>
2022-11-07 20:17:41 +01:00
Bartlomiej Plotka 5b7e8b2e67
collectors.GoCollector: Added rule support for granular metric configuration. (#1102)
* goCollector: Added rule support for granular metric configuration.

Fixes: https://github.com/prometheus/client_golang/issues/1089

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

* Added compatibility mode with old options. (#1107)

* Added compatibility mode with old options.

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

* Copyright header.

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

* Remove bucket option for now. (#1108)

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

* collectors/GoCollector: Add tests and examples (#1109)

* Add tests and examples

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Add docs for the presets

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

Co-authored-by: Kemal Akkoyun <kakkoyun@users.noreply.github.com>
2022-08-05 19:37:46 +02: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
Kemal Akkoyun 35c82f2c7e
Remove -Inf buckets from go collector histograms (#1049)
* Remove -Inf buckets from go collector histograms

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Update prometheus/collectors/go_collector_latest_test.go

Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Simplify

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
2022-05-13 10:04:45 +02:00
Kemal Akkoyun f25114699a
prometheus: Fix convention violating names for generated collector metrics (#1048)
* Fix convention violating names for generated collector metrics

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Add new Go collector example

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2022-05-09 10:33:45 +02:00
Bartlomiej Plotka 11ee9add27
gocollector: Reverted client_golang v1.12 addition of runtime/metrics metrics by default. (#1033)
Fixes https://github.com/prometheus/client_golang/issues/967

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2022-04-13 20:43:29 +02:00
Manuel Rüger 46d3dd4e6c
Bump minimum required Go version to 1.16 (#1032)
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-04-13 16:21:42 +01:00
Bartlomiej Plotka 24172847e3
gocollector: Added options to Go Collector for changing the (#1031)
* Renamed files.

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

* gocollector: Added options to Go Collector for diffetent collections.

Fixes https://github.com/prometheus/client_golang/issues/983

Also:

* fixed TestMemStatsEquivalence, it was noop before (:
* Removed gc_cpu_fraction metric completely, since it's not working completely for Go1.17+

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2022-04-13 09:55:22 +01:00
Mitsuo Heijo 8dfa334295
Remove workaround for pre go1.15 (#1010)
Signed-off-by: Mitsuo Heijo <mitsuo.heijo@gmail.com>
2022-03-27 19:11:56 +01:00
Manuel Rüger 8535b62021 Add new go:build lines for go 1.17
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2021-12-17 23:38:35 +01:00
beorn7 81a9556c8b Make dbStatsCollector more DRY
Signed-off-by: beorn7 <beorn@grafana.com>
2021-05-20 22:31:53 +02:00
Mitsuo Heijo a66da1df4a
Add collector for database/sql#DBStats (#866)
* Add collector for database/sql#DBStats

Signed-off-by: Mitsuo Heijo <mitsuo.heijo@gmail.com>
2021-05-20 22:22:17 +02:00
Mitsuo Heijo e07445a773
Add new collectors package
Signed-off-by: Mitsuo Heijo <mitsuo.heijo@gmail.com>
2021-05-08 10:43:31 +09:00