Commit Graph

196 Commits

Author SHA1 Message Date
Sebastian Spaink e1cc22deca
chore: Cleanup printer.go (#12164) 2022-11-03 13:11:25 -05:00
Paweł Żak 9d9eb403a6
chore: Review of //nolint comments (#12088) 2022-10-26 12:06:08 +02:00
Paweł Żak 5878278fca
chore: resolve linter issues for unhandled-error (#11969) 2022-10-12 14:23:53 -06:00
Paweł Żak 9ff5cda6e8
chore: Resolve linter issues for plugins/common package (#11964)
Co-authored-by: Pawel Zak <Pawel Zak>
2022-10-11 11:31:44 -05:00
Sebastian Spaink af53478e4f
fix(cli): Support old style of filtering sample configs (#11896) 2022-10-03 08:22:47 -06:00
Sebastian Spaink 4913392b85
chore: Remove deprecated build tags (#11867) 2022-09-22 13:25:31 -05:00
Joshua Powers 8c49ddccc3
chore: update to go1.19.1 (#11776) 2022-09-08 12:49:36 -06:00
Sebastian Spaink 7bc383c6ac
chore: Rename Telegraf receiver argument from a to t (#11742) 2022-08-29 16:54:44 -05:00
Sebastian Spaink a57434eb4e
feat: Migrate to urfave/cli (#11700) 2022-08-24 21:46:58 -05:00
Sven Rebhan f1ce84f02d
feat: tool to build custom Telegraf builds (#11524) 2022-08-19 13:38:03 -06:00
Povilas Versockas 447e8a385e
fix: refactor telegraf version (#11656) 2022-08-17 13:08:31 -06:00
reimda bd516ae587
chore: move printing of sample config file out of config.go (#11409) 2022-06-29 11:59:58 -06:00
Sebastian Spaink 412be64088
feat: Make the command "config" a subcommand (#11282)
* feat: make the command "config" a subcommand

* fix: backwards compatible
support telegraf *filters* config
2022-06-15 21:28:18 +02:00
Thomas Casteleyn da31a19d5b
fix(cmd): Also allow 0 outputs when using test-wait parameter (#11013) 2022-04-21 15:00:03 -06:00
Sebastian Spaink 1f7cd1d4a4
docs: improve documentation around contribution (#10825) 2022-03-28 09:47:02 -06:00
R290 48682ff5f9
feat: Add autorestart and restartdelay flags to Windows service (#10559) 2022-02-03 09:23:52 -07:00
Sebastian Spaink 8fefb21975
fix: move "Starting Telegraf" log (#10528) 2022-01-31 13:30:52 -07:00
Sebastian Spaink deda716a15
feat: add FileVersion and icon to Win exe (#10487) 2022-01-26 14:08:22 -07:00
Sven Rebhan 193dc450c3
feat: Parser plugin restructuring (#8791) 2022-01-12 15:54:42 -07:00
Josef Johansson 876d19081e
feat: add systemd notify support (#10340) 2022-01-05 08:21:14 -07:00
Sven Rebhan 70c06aca16
fix: warning output when running with --test (#10329) 2021-12-22 07:05:05 -07:00
Sven Rebhan 526dcb4bc8
fix: Print loaded plugins and deprecations for once and test (#10205) 2021-12-07 15:56:18 -07:00
JC b954e565cc
fix: windows service - graceful shutdown of telegraf (#9616) 2021-12-02 15:32:19 -07:00
reimda df6bf48f8d
feat: Implement deprecation infrastructure (#10200) 2021-12-01 12:38:43 -07:00
Thomas Casteleyn aaaaabd0fd
docs: Add symlink to command documentation (#9926) 2021-10-15 13:05:37 -06:00
Sebastian Spaink 3a7d9b6d98
fix: support 1.17 & 1.16.7 Go versions (#9642) 2021-08-23 15:37:44 -05:00
Sebastian Spaink 2a72295734
Detect changes to config and reload telegraf (copy of pr #8529) (#9485) 2021-07-15 11:11:58 -05:00
Gareth Dunstone 3a1a44d67e
Feature: merge multiple "--config" and "--config-directory" flags (#9007) 2021-05-18 16:20:13 -05:00
David Bennett 1a86fd1a2d
Config Option to Enable Logging with Local Time (#9123)
* Configurable local time logging

* make timezone configurable

* Address linter feedback.

* update with example
2021-04-16 14:39:19 -04:00
Sven Rebhan 9853bf6c54
Get rid of deprecated internal.{Duration,Size,Number} (#8969) 2021-04-09 13:15:04 -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
Steven Soroka 4dcc3c0ad7
exec plugins should not truncate messages in debug mode (#8333) 2021-03-18 17:21:30 -04:00
David Bennett 1bf5a19582
Add Event Log support for Windows (#8616)
* Add event log support for windows when not running as a windows service.

* Add error message for initializing event logger.

* Add build windows flag.

* Only register event logger when running telegraf under windows.

* Update logger/event_logger.go

Co-authored-by: Steven Soroka <ssoroka@influxdata.com>

* Remove unnecessary 'fmt' import

* Remove unnecessary 'fmt' import

* Remove unnecessary error check

* use constants for eid levels.

Co-authored-by: Steven Soroka <ssoroka@influxdata.com>
2021-01-19 11:03:19 -05:00
Daniel Nelson 4e93b87085
Add support for once mode; run processors and aggregators during test (#7474) 2020-06-01 15:26:20 -07:00
Alex Heylin 134c84f45d
Fix typo in Windows service description (#7486)
Co-authored-by: Alex Heylin <alexh@gmal.co.uk>
2020-05-11 12:20:02 -04:00
Steven Soroka cc927357a4
shim improvements for docs, clean quit, and slow readers (#7452) 2020-05-05 10:14:57 -04:00
Steven Soroka b73a232a6a
Support Go execd plugins with shim (#7283) 2020-05-04 14:09:10 -04:00
Steven Soroka 819481b195
add support for SIGUSR1 to trigger flush (#7366) 2020-04-20 13:49:10 -04:00
maurorappa 2beb79969a Sort alphabetically the output of the plugin listing commands (#6810) 2019-12-17 12:44:17 -08:00
Daniel Nelson 776e92ffab
Require goplugin build flag to enable go plugin support (#6393) 2019-09-20 16:50:19 -07:00
Vlasta Hajek 7ec54d4be9 Improve startup error reporting when ran as Windows service (#4291) 2019-08-28 14:34:44 -07:00
Mattias Jiderhamn 08b903a646 Use environment variables to locate Program Files on Windows (#6317) 2019-08-27 13:47:01 -07:00
Daniel Nelson 3f63c14179
Setup default logging before logging. 2019-07-29 21:47:49 -07:00
Preston Carpenter 5c7c9e40ee Load external go plugins (#6024) 2019-07-29 21:34:03 -07:00
Daniel Nelson de096428be
Run ServiceInputs during test mode; add --test-wait option (#5911) 2019-06-14 12:06:25 -07:00
Daniel Nelson 3d7a71889d
Ignore context canceled error when reloading/stopping agent 2019-05-31 16:50:44 -07:00
javicrespo bcf7516a23 Add in process log rotation (#5778) 2019-05-03 10:25:28 -07:00
Daniel Nelson 7978ebef40
Add --service-display-name option for use with Windows service (#5770) 2019-04-30 18:34:19 -07:00
Greg 6436005553 Add cli support for outputting sections of the config (#5585) 2019-04-25 20:34:40 -07:00
Daniel Nelson c57ba6110d
Exit after running --test without requiring --console (#5631) 2019-03-26 18:17:27 -07:00
Daniel Nelson 140387d2c3
Log warning when wireless plugin is used on unsupported platform (#4986) 2018-11-15 15:45:56 -08:00
Greg 91ecec71ea Only print final collection when runing --test (#4991) 2018-11-15 15:44:36 -08:00
Daniel Nelson 6e5c2f8bb6
Remove outputs blocking inputs when output is slow (#4938) 2018-11-05 13:34:28 -08:00
Trevor Pounds ee056278f5 Enable gofmt code simplification (#4887) 2018-10-19 13:32:54 -07:00
Kevin Conaway 7bb219222a Add internal function for telegraf version (#4828) 2018-10-09 13:45:07 -07:00
Lee Jaeyong 6b7d64f1d6 Add ability to define a custom service name when installing as a Windows service (#4753) 2018-09-27 18:41:24 -07:00
Greg 4ef058c120 Document all supported cli arguments (#4655) 2018-09-10 11:53:04 -07:00
Daniel Nelson 31e1c04ed0
Set version to unknown if not set (#4521) 2018-08-12 16:52:35 -07:00
Daniel Nelson 40fac0a9b4
Treat sigterm as a clean shutdown signal (#4277) 2018-06-12 16:44:04 -07:00
Daniel Nelson b1d77ade55
Update master version to 1.8 2018-06-05 11:46:55 -07:00
Piotr Popieluch e0071f365a Print the enabled aggregator and processor plugins on startup (#4212) 2018-05-31 11:56:49 -07:00
Daniel Nelson 7c0754ebe5
Move usage string to internal to fix `go run` 2018-05-04 14:16:21 -07:00
Daniel Nelson 3f4e1af222
Add --console and --service to usage message in Windows (#3993) 2018-04-11 16:44:55 -07:00
Daniel Nelson a9afd2f030
Add config-directory documentation for Windows service 2018-04-04 16:30:22 -07:00
Daniel Nelson 413cf6dd23
Set next version to 1.7 on master 2018-04-02 14:44:09 -07:00
Logan d831dbc51d Allow running as console application on Windows (#2754) 2018-01-25 15:04:09 -08:00
Daniel Nelson bdda6ceb70
Update next version number for dev builds 2017-12-01 11:52:46 -08:00
Daniel Nelson 9b0af4478b
Remove incorrect comment about linker options 2017-11-01 18:17:51 -07:00
Daniel Nelson c010fb1c3c
Fix build versioning; add dev.docker file 2017-09-22 17:35:58 -07:00
Daniel Nelson 3006ccbf2f
Update master for 1.5 development 2017-08-16 16:54:15 -07:00
Daniel Nelson 54be037911
Use double hyphen in cli examples 2017-08-11 16:26:54 -07:00
Daniel Nelson d8f7b76253
Prevent startup if intervals are 0 2017-07-17 11:58:47 -07:00
Daniel Nelson d40e441240 Use git sha1 as version if not tagged (#2969) 2017-06-27 13:24:06 -07:00
ingosus dff216c44d Feature #1820: add testing without outputs (#2446) 2017-04-13 12:59:28 -07:00
Dmitry Ulyanov c980c92cd5 Added pprof tool (#2512) 2017-03-29 18:28:43 -07:00
Nick Irvine dfb4038654 Remove pidfile if pidfile was created (#2358)
Also, ensure pidfile perms are 644
2017-02-03 10:02:19 +00:00
Cameron Sparr dfba3ff37a
fix telegraf swallowing panics in --test mode
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes #2341
2017-02-02 12:14:35 +00:00
Pierre Fersing 32e06a489d Keep -config-directory when running as Windows service (#2330)
* Keep -config-directory when running as Windows service

* Update changelog
2017-02-01 14:12:35 +00:00
Cameron Sparr 61269c3500 Update config generation docs
closes #1925
2016-10-25 14:46:50 +01:00
Cameron Sparr b00ad65b08 Log config file parsing errors properly
closes #1344
2016-10-12 16:50:22 +01:00
Cameron Sparr acfdd15aa9 Processor & Aggregator configuration doccing 2016-10-12 14:50:19 +01:00
Cameron Sparr 78f544c0aa Support --aggregator-filter & --processor-filter 2016-10-12 14:50:19 +01:00
Cameron Sparr 2175a72fcc Rebase fixup 2016-10-12 14:50:19 +01:00
Cameron Sparr 64a71263a1 Support Processor & Aggregator Plugins
closes #1726
2016-10-12 14:50:19 +01:00
Cameron Sparr c7834209d2 Major Logging Overhaul
in this commit:

- centralize logging output handler.
- set global Info/Debug/Error log levels based on config file or flags.
- remove per-plugin debug arg handling.
- add a I!, D!, or E! to every log message.
- add configuration option to specify where to send logs.

closes #1786
2016-10-03 17:13:03 +01:00
Peter Murray e477620dc5 Making '-service' flags work from a non-interactive session, i.e. Ansible, related to #1760 2016-09-28 16:09:43 +01:00
Cameron Sparr bc22309459 Add commit & branch to Makefile 2016-09-13 09:31:30 +01:00
Gunnar b6f81b538a Add commit to Telegraf version string (#1756) 2016-09-13 08:41:02 +01:00
Cameron Sparr 8e22526756 Adding c:\program files\telegraf\telegraf.conf
this will now be the default config file location on windows, basically
it is the windows equivalent of /etc/telegraf/telegraf.conf

also updating the changelog

closes #1543
2016-08-08 23:17:27 +01:00
Dennis Bellinger 7b6713b094 Telegraf support for built-in windows service.
Updated windows dependencies

Updated the windows dependencies so that the versions matched the
dependencies for Mac OS and Linux. Additionally added some that were
complained about being missing at compile time.

Incorporated kardianos/service for management

Incorporated the library github.com/kardianos/service to manage the
service on the various platforms (including Windows). This required an
alternate main function.

The original main function was renamed to reloadLoop (as that is what
the main loop in it does) (it also got a couple of parameters). The
service management library calls it as the main body of the program.

Merged service.go into telegraf.go

Due to compilation issues on Windows, moved the code from service.go
into telegraf.go and removed service.go entirely.

Updated dependencies and fixed Windows service

Updated the dependencies so that it builds properly on Windows,
additionally, fixed the registered command for starting it as
a service (needed to add the config file option). This currently
standardizes it as a C:\telegraf\telegraf.conf on Windows.

Added dependency for github.com/kardianos/service

Removed the common dependencies from _windows file

Removed all the common dependencies from the Godeps_windows file and
modified Makefile to load Godeps and then Godeps_windows when building
for Windows. This should reduce problems caused by the Godeps_windows
file being forgotten when updating dependencies.

Updated CHANGELOG.md with changes

Ran `go fmt ./...` to format code

Removed service library on all but Windows

The service library [kardianos/service](github.com/kardianos/service)
has been disabled on all platforms but windows, as there is already
existing infrastructure for other platforms.

Removed the dependency line for itself

It appears that gdm accidentally added the project itself to the
dependency list. This caused the dependency restoration to select an
earlier version of the project during build.

This only affected windows.
This only affected builds after 020b2c70

Updated documentation for Windows Service

Removed the documentation about using NSSM and added documentation on
installing telegraf directly as a Windows Service.

Added license info for kardianos/service

Added the license information for github.com/kardianos/service which is
licensed under the ZLib license, although that name is never mentioned
the license text matches word for word.

Changed the Windows Config file default location

Updated the default location of the configuration file on Windows from
C:\telegraf\telegraf.conf to C:\Program Files\Telegraf\telegraf.conf.
With this change includes updating the directions, including directing
that the executable be put into that same directory. Additionally, as
noted in the instructions, the location of the config file for the
service may be changed by specifying the location with the `-config`
flag at install time.

Fixed bug - Wrong data type: svcConfig

svcConfig service.Config => svcConfig *service.Config
(It needed to be a pointer)
2016-08-08 23:10:39 +01:00
Cameron Sparr 2d86dfba8b Removing deprecated flags
they are:
  -configdirectory
  -outputfilter
  -filter
2016-08-03 13:08:06 +01:00
Cameron Sparr 775daba8f5 Change Version->version for consistency w/ influxdb 2016-05-10 14:18:55 -07:00
Cameron Sparr cbe32c7482 Support default config paths
precedence will be:

 1. --config command-line option
 2. $TELEGRAF_CONFIG_PATH
 3. $HOME/.telegraf/telegraf.conf
 4. /etc/telegraf/telegraf.conf
2016-04-28 17:48:24 -06:00
HUANG Wei 63410491b7 Fix typo, should be input instead of output. 2016-03-18 10:06:44 +08:00
Cameron Sparr 822706367b provide args for telegraf for consistency with influxd:
- telegraf version
- telegraf config

closes #857
2016-03-16 14:22:01 -06:00
Cameron Sparr 7e312797ec Grammar corrections and consistency for output-list, input-list
closes #788
2016-03-07 11:42:01 +01:00
张光权 fe44fa648a Fix the incorrect indent of input-list help message 2016-03-07 11:33:03 +01:00
张光权 3249030257 add flags '-input-list' and '-output-list' for telegraf command 2016-03-07 11:33:03 +01:00
张光权 8f98c20c51 Add flags -usage-list to print all plugins inputs for telegraf 2016-03-07 11:33:03 +01:00
Cameron Sparr e619493ece Implementing generic parser plugins and documentation
This constitutes a large change in how we will parse different data
formats going forward (for the plugins that support it)

This is working off @henrypfhu's changes.
2016-02-08 21:08:44 -07:00