Commit Graph

163 Commits

Author SHA1 Message Date
Paweł Żak b2b58bab9e
chore: Fix linter findings for errorlint (part6) (#12733)
Co-authored-by: Pawel Zak <Pawel Zak>
2023-03-01 22:19:38 +01:00
Thomas Casteleyn 6a2f6f301f
chore: eliminate unnecessary use of quoted strings in printf (#12722) 2023-02-23 06:49:36 -07:00
Eng Zer Jun 4d0f05980e
test: Use `t.Setenv` to set env vars (#12621) 2023-02-10 11:46:14 +01:00
Pascal Zimmermann aa0b9d7dcf
fix: Rename the Prometheus Input Plugin Timeout variable (#12626) 2023-02-10 11:44:42 +01:00
Francois Steyn 7345b400ff
docs(inputs.prometheus): fix incorrect headers option (#12625) 2023-02-06 09:52:51 -07:00
Pascal Zimmermann dc9eb02301
fix(inputs.prometheus): Set the timeout for slow running API endpoints correctly (#12559) 2023-01-30 15:52:54 +01:00
Maxim Ivanov 51f23d244e
fix(inputs.prometheus): correctly track deleted pods (#12522) 2023-01-23 08:13:51 -07:00
Thomas Casteleyn 61523bd4b9
feat(tools/readme_linter): Check for global configuration section (#12426) 2023-01-12 16:55:21 +01:00
Maxim Ivanov 9d5c879cac
fix(inputs.prometheus): correctly default to 9102 port (#12282) 2022-11-28 08:19:44 -07:00
Maxim Ivanov 55c8cfafb0
fix(inputs.promethes): respect selectors when scraping pods (#12278) 2022-11-28 08:05:31 -07:00
Maxim Ivanov c3562ae8b2
feat(inputs.prometheus): Allow explicit scrape configuration without annotations (#11962) 2022-11-22 18:04:52 +01:00
Charly Nanfack d4eda21742
feat(inputs.prometheus): Add support for custom header (#12050) 2022-11-21 21:55:21 +01:00
Paweł Żak d3fabdd0a9
chore: wrap long lines in plugins/inputs/[l-s]* (#12217) 2022-11-10 11:55:58 -07:00
Joshua Powers 49ac03fa80
docs: add global configuration header (#12107) 2022-10-26 14:58:36 -05:00
erwiese 215e8e030a
feat(inputs.prometheus): use system wide proxy settings (#11729) 2022-09-13 10:48:13 -07:00
Sebastian Spaink d67f75e557
docs: Remove warning not to remove go:embed (#11797)
Co-authored-by: Joshua Powers <powersj@fastmail.com>
2022-09-13 12:47:58 -05:00
Joshua Powers 8c49ddccc3
chore: update to go1.19.1 (#11776) 2022-09-08 12:49:36 -06:00
yahaa 4f4d168e74
fix(inputs.prometheus): plugin run outside k8s cluster error (#11673) 2022-08-17 08:27:46 -06:00
Grace Wehner f4e76893d1
feat (inputs/prometheus): add setting to set custom namespace label name to avoid conflicts (#11538) 2022-08-05 08:27:20 -06:00
Sven Rebhan e2578462a5
fix(inputs): Linter issues (#11576) 2022-08-02 13:52:17 +02:00
reimda f7aab29381
chore: Fix readme linter errors for input plugins M-Z (#11274) 2022-06-08 15:22:56 -06:00
Sven Rebhan 91d50ee374
fix: Update sample.conf for prometheus (#11217) 2022-06-01 09:22:25 -06:00
Joshua Powers 2fc19fa308
chore: correctly spell embed (#11200) 2022-05-27 07:13:47 -06:00
reimda 34e5d821f7
docs: remove recommendation for prometheus metric_version=2 (#11158) 2022-05-26 10:07:44 -06:00
Sven Rebhan 56eb914998
chore: Embed sample configurations into README for inputs (#11136) 2022-05-24 08:49:47 -05:00
Joshua Powers 596b0e149b
fix: Remove any content type from prometheus accept header (#11082)
In #6745, the prometheus accept header was changed to accept any media
type. However, our prometheus plugin only accepts text. With the release
of newer versions of prometheus, the OpenMetrics type is now available
and could potentially be setup as the exclusive response type. As this
new content type is not supported, Telegraf should not accept it.

The original issue, #6523, was filed around getting a 406. The issue had
comments from the rabbit-mq maintainers who made changes to their code
to be less regid resolving the issue. The change to telegraf was made
afterwards anyway.

fixes: #10248
2022-05-24 15:11:17 +02:00
Sebastian Spaink 0f5dc9946c
chore(inputs_m-z): migrate sample configs into separate files (#11133) 2022-05-18 11:31:34 -05:00
Sebastian Spaink b355be5ccb
feat: migrate input plugins to new sample config format (M-Z) (#10926) 2022-04-11 16:32:25 -05:00
Shubham Kumar Singh Rajput 777f8bf715
fix(inputs.prometheus): moved from watcher to informer (#10932) 2022-04-08 08:09:02 -06:00
William Wilson 5992fc47ac
tests: remove redundant newlines that go 1.18 treats as errors (#10847) 2022-03-21 09:11:25 -07:00
Alec 2269ff1242
docs: address documentation gap when running telegraf in k8s (#10215) 2021-12-03 11:48:46 -06:00
Joshua Powers 121ae1faaa
fix: check error before defer in prometheus k8s (#10091) 2021-11-24 12:19:25 -07:00
Mya d4582dca70
chore: clean up all markdown lint error on input plugins n through r (#10168) 2021-11-24 11:50:01 -07:00
Paweł Żak b9e4978b17
fix: Linter fixes for plugins/inputs/p* (#10066) 2021-11-15 09:14:09 -06:00
Alexander Krantz 2e216825db
fix: decode Prometheus scrape path from Kuberentes labels (#9662) 2021-10-18 16:47:45 -05:00
Sebastian Spaink 432b30d2e9
fix(input/prometheus): move err check to correct place (#9920) 2021-10-13 14:43:05 -05:00
Yuji Kawamoto d2a25456d5
feat(prometheus): add ignore_timestamp option (#9740) 2021-10-05 15:11:46 -06:00
Eng Zer Jun 6a3b27126a
refactor: move from io/ioutil to io and os package (#9811) 2021-09-28 15:16:32 -06:00
Samantha Wang c4c3c8ade9
docs: update caddy server instructions (#9698) 2021-09-21 14:03:41 -05:00
Grace Wehner fe144e7c99
fix: issues with prometheus kubernetes pod discovery (#9605) 2021-08-17 15:54:55 -06:00
Martin Molnar 1a42c7d289
For Prometheus Input add ability to query Consul Service catalog (#5464) 2021-07-27 17:23:01 -04:00
Imran Ismail 8965291f29
Fix prometheus cadvisor authentication (#9497) 2021-07-20 17:08:29 -04:00
Russ Savage 467ab87912
chore: update prometheus input readme to match config options (#9270) 2021-05-25 15:11:14 -06:00
Russ Savage e8ae01921b
Set user agent when scraping prom metrics (#9271) 2021-05-20 08:36:36 -06:00
Helen Weller 66e12e062d
remove deprecation warning (#9125) 2021-04-13 16:13:06 -04:00
David Bennett 842a788022
Remove error return type from metric.New method (#9116)
* Remove error return type from metric.New method.

* Formatting changes for linter + gofmt

* Additional linter fixes.

* More linter fixes.

* Linter fix.

* address comments
2021-04-13 14:40:03 -04:00
Sven Rebhan 9853bf6c54
Get rid of deprecated internal.{Duration,Size,Number} (#8969) 2021-04-09 13:15:04 -04:00
Sven Rebhan 8e7da355b3
Linter fixes (unhandled errors) -- Part 1 (#8992) 2021-04-08 11:43:39 -05:00
Paweł Żak 099ccda3f9
Linter fixes - gosimple (#9046) 2021-03-25 13:57:01 -04:00
Sebastian Spaink 29ac77906d
Change duplicate kubernetes import and update protobuf to v1.5.1 (#9039)
* Change import and update protobuf

* fix check-deps

* go mod tidy

* keep imports consistent
2021-03-24 10:59:05 -05:00
Paweł Żak 5de640b855
Linter fixes - unconvert, revive:empty-lines, revive:var-naming, revive:unused-parameter (#9036)
Co-authored-by: Pawel Zak <Pawel Zak>
2021-03-24 11:27:46 -04:00
Paweł Żak 74a1acd814
Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984)
* Linter fixes - revive:unused-parameter and unparam

* Linter fixes - revive:unused-parameter and unparam

* Linter fixes - revive:unused-parameter and unparam

* "nolint"'s removed

* Fixes for "varcheck" and "unused" added.

* Fixes for "varcheck" and "unused" added.

* Fixes for "varcheck" and "unused" added.

* Fixes for "varcheck" and "unused" added.

* Fixes for "varcheck" and "unused" added.

* Fixes for "varcheck" and "unused" added.

* Fixes for "varcheck" and "unused" added.

Co-authored-by: Pawel Zak <Pawel Zak>
2021-03-22 12:21:36 -05:00
Sebastian Spaink 79f5803444
Migrate from github.com/ericchiang/k8s to github.com/kubernetes/client-go (#8937)
* new k8 client

* Make all tests pass

* Update licenses

* add timeout back

* Resolve merge conflicts

* Fix tests and linter

* Fix linter errors

* Linting issues

* Extra empty line

Co-authored-by: Bas <3441183+BattleBas@users.noreply.github.com>
2021-03-17 16:35:25 -05:00
Paweł Żak 38c61c07ef
Revive fixes - part 4: (#8981)
empty-lines

Co-authored-by: Pawel Zak <Pawel Zak>
2021-03-12 14:21:51 -06:00
Grace Wehner d7df2c546b
Prometheus [Input] plugin - Optimizing for bigger kubernetes clusters (500+ pods) when scraping thru 'monitor_kubernetes_pods' (#8762) 2021-03-08 11:00:56 -05:00
Paweł Żak ba66d4facb
Revive fixes - part 1 (#8797)
* Revive fixes regarding following set of rules:
[rule.blank-imports]
[rule.context-as-argument]
[rule.context-keys-type]
[rule.dot-imports]
[rule.error-return]
[rule.error-strings]
[rule.indent-error-flow]
[rule.errorf]
2021-02-08 11:18:40 -05:00
Helen Weller d41569caed
Integration test audit (#8725) 2021-01-26 11:06:12 -07:00
Aladex 4b7d11385c
Using mime-type in prometheus parser to handle protocol-buffer responses (#8545) 2021-01-07 11:21:09 -05:00
Dmitry Senin 0ccb134ae4
Add a parser plugin for prometheus (#7778) 2020-12-02 12:48:44 -07:00
Paweł Żak c8e69aca3c
Fixed almost all bugs found by LGTM analysis platform (#8240) 2020-10-08 11:20:35 -04:00
Russ Savage 75e701c288
fix(readmes): adding code block annotations (#7963) 2020-08-10 15:50:48 -04:00
Daniel Nelson c73ed8ca6c
Export internal/tls package for use in execd plugins (#7697) 2020-06-25 11:44:22 -07:00
Daniel Nelson 9fbf288518
Remove init checks for valid label and field selectors (#7198)
Importing k8s.io/klog starts a long running goroutine at init time.
2020-03-18 13:48:29 -07:00
mg03 dd1ace73b0
Add label and field selectors to prometheus input k8s discovery (#6969) 2020-03-02 18:51:31 -08:00
Anthony Arnaud 8c99dc7b5e
Use the same timestamp per call if no time is provided (#7063) 2020-02-25 12:19:28 -08:00
Daniel Nelson 0710cc7488
Parse NaN values from summary types in prometheus input (#6997) 2020-02-10 14:18:29 -08:00
Daniel Nelson add8332990
Accept any media type in the prometheus input (#6745) 2019-12-03 11:47:31 -08:00
Daniel Nelson 80c5edd48e
Add prometheus serializer and use it in prometheus output (#6703) 2019-11-26 15:46:31 -08:00
Vishwanath 12ecdaba5b Add prometheus metric_version = 2 and url tag configurable (#5767) 2019-11-20 20:53:57 -08:00
Greg 817c9a69a9 Document and add support to input plugins for logging alias (#6357) 2019-09-23 15:39:50 -07:00
Greg f7e85ebac2 Add basic auth to prometheus input plugin (#6062) 2019-07-02 11:14:48 -07:00
Benjamin Fuller b2baa2fdd5 Add optional namespace restriction to prometheus input plugin (#5697) 2019-04-10 14:52:46 -07:00
liispon 3b80d8a7fd Use github.com/ghodss/yaml to parse k8s config (#5643) 2019-04-02 11:04:37 -07:00
Greg b620a56d21 Collect from newly discovered/launched pods (#5293) 2019-01-16 15:49:24 -08:00
Greg d759b46345 Support passing bearer token directly in prometheus input (#5294) 2019-01-15 15:25:26 -08:00
Greg 891eff0930 Run stop logic only if required in prometheus input (#5144) 2018-12-14 14:34:05 -08:00
Greg 9c866553e8 Add scraping for Prometheus endpoint in Kubernetes (#4920) 2018-11-05 13:30:16 -08:00
Greg ddcbfe79bb Allow connecting to prometheus via unix socket (#4798) 2018-11-02 17:51:40 -07:00
Daniel Nelson de355b76d6
Simplify testing with TLS (#4095) 2018-05-04 16:33:23 -07:00
Daniel Nelson 1c0f63a90d
Add new line protocol parser and serializer, influxdb output (#3924) 2018-03-27 17:30:51 -07:00
Philipp Weber b7a68eef56 Remove userinfo from url tag in prometheus input (#3743) 2018-02-05 11:16:00 -08:00
Jeremy Doupe a6797a44d5 Add history and summary types to telegraf and prometheus plugins (#3337) 2017-10-24 16:28:52 -07:00
Daniel Nelson 6e5915c59f Fix prometheus passthrough for existing value types (#3351) 2017-10-18 14:51:08 -07:00
Christian Meilke 73df179bd6 Tag original URL for k8s services in prometheus input (#3257) 2017-09-22 17:26:19 -07:00
Daniel Nelson daee48c861
Update prometheus input documentation 2017-09-18 16:21:45 -07:00
Christian Meilke 292c5229bf Add support for k8s service DNS discovery to prometheus input (#3236) 2017-09-18 15:06:11 -07:00
Olivier Lambert a96f85c847 Add documentation for fetching metrics on Caddy HTTP and Prometheus (#2853) 2017-05-25 13:07:49 -07:00
Zack Zatkin-Gold dd537b3382 Fix telegraf example arguments (#2788)
Many of the examples provided within documentation are using a single
dash for the command line arguments, but the telegraf executable
explicitly has two dashes.

There are also some inconsistencies with the ordering of the command
line argument examples.  I've ordered them so that the examples will
show: config, config-directory, input-filter, test
2017-05-12 15:22:29 -07:00
Daniel Nelson b88eb0f59d
Fix prometheus input creation of transport on every gather 2017-05-09 16:21:49 -07:00
Patrick Hemmer 06baf7cf78 use AddError everywhere (#2372) 2017-04-24 11:13:26 -07:00
djjorjinho cc5b2f68b6 fix timestamp parsing on prometheus plugin (#2596) 2017-03-29 15:04:29 -07:00
Leandro Piccilli 5da40d56ad
Check if tag value is empty before allocation
closes #2390
closes #2404
2017-02-16 23:07:27 +00:00
Cameron Sparr e36c354ff5
internal.Duration build fixup 2016-12-17 13:10:33 +00:00
Pierre Tessier f09c08d1f3
Added response_timeout property
closes #2006
2016-12-17 13:06:04 +00:00
Cameron Sparr 9f6666beb3 unit test fixup 2016-12-01 19:17:44 +00:00
Cameron Sparr e5c7a71d8e Fix unit tests for new metric implementation 2016-12-01 18:17:02 +00:00
Cameron Sparr db7a4b24b6 Implement telegraf's own full metric type
main reasons behind this:
- make adding/removing tags cheap
- make adding/removing fields cheap
- make parsing cheaper
- make parse -> decorate -> write out bytes metric flow much faster

Refactor serializer to use byte buffer
2016-12-01 18:17:02 +00:00
Cameron Sparr e1c3800cd9 Prometheus parser fix, parse headers properly
closes #1458
2016-07-09 22:34:59 +02:00
Victor Garcia 50ea7f4a9d x509 certs authentication now supported for Prometheus input plugin (#1396) 2016-06-23 08:59:44 +01:00
Thibault Cohen b18134a4e3 Fix #1405 (#1406) 2016-06-23 08:59:14 +01:00