Repository Analysis

influxdata/telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.

1.5 Likely human-written View on GitHub
1.5
Adjusted Score
1.5
Raw Score
100%
Time Factor
2026-05-29
Last Push
17,588
Stars
Go
Language
687,477
Lines of Code
3321
Files
817
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 36MEDIUM 24LOW 757

Pattern Findings

817 matches across 10 categories. Click a row to expand file-level details.

Over-Commented Block750 hits · 748 pts
SeverityFileLineSnippet
LOWsecretstore.go21// ResolveFunc is a function to resolve the secret.
LOWprocessor.go21 // can choose to save it in the plugin, or use the one received from Add().
LOW.golangci.yml61 # `$all` - matches all go files
LOW.golangci.yml421 # https://staticcheck.dev/docs/checks/#QF1001
LOW.golangci.yml481 #
LOW.golangci.yml561 # Section configuration to compare against.
LOW.golangci.yml601 # The formats used to render issues.
LOW.golangci.yml621 sort-order:
LOWserializer.go1package telegraf
LOWplugin.go21
LOWplugin.go41// persist an internal state across Telegraf runs.
LOWmetric.go61 // Type returns a general type for the entire metric that describes how you
LOWparser.go1package telegraf
LOWcmd/telegraf/printer.go21 sectionDefaults = []string{"global_tags", "agent", "secretstores", "outputs", "processors", "aggregators", "inputs"}
LOWcmd/telegraf/printer.go41# Environment variables can be used anywhere in this config file, simply surround
LOWconfig/config.go181}
LOWconfig/config.go201 // Precision will NOT be used for service inputs. It is up to each individual
LOWconfig/config.go221 // number of telegraf instances.
LOWconfig/config.go281 // If uncommented and not empty, this file will be used to save the state of
LOWconfig/secret.go61 Buffer() (SecretBuffer, error)
LOWconfig/testdata/envvar_comments.toml1# Telegraf Configuration
LOWconfig/testdata/single_plugin_env_vars.toml1# Telegraf Configuration
LOWconfig/testdata/telegraf-agent.toml1# Telegraf configuration
LOWconfig/testdata/telegraf-agent.toml81 totalcpu = true
LOWconfig/testdata/telegraf-agent.toml141 # no configuration
LOWconfig/testdata/telegraf-agent.toml161
LOWconfig/testdata/telegraf-agent.toml181 master_collections = ["resources","master","system","slaves","frameworks","messages","evqueue","registrar"]
LOWconfig/testdata/telegraf-agent.toml201 servers = ["localhost"]
LOWconfig/testdata/telegraf-agent.toml221 count = 1 # required
LOWconfig/testdata/telegraf-agent.toml241 # with the same name as the user. This dbname is just for instantiating a
LOWconfig/testdata/telegraf-agent.toml261# Read metrics from one or many RabbitMQ servers via the management API
LOWconfig/testdata/telegraf-agent.toml281
LOW…ugins/parsers/openmetrics/openmetrics_data_model.pb.go361 //
LOW…ins/parsers/openmetrics/testcases/valid_info/input.txt1# HELP cadvisor_version A metric with a constant '1' value labeled by kernel version, OS version, docker version, cadvis
LOW…ugins/parsers/openmetrics/testcases/multiple/input.txt21# HELP process_cpu_seconds Total user and system CPU time spent in seconds.
LOW…ns/parsers/openmetrics/testcases/valid_gauge/input.txt1# HELP go_memstats_gc_cpu_fraction The fraction of this program's available CPU time used by the GC since the program st
LOW…/parsers/openmetrics/testcases/valid_unknown/input.txt1# HELP redis_connected_clients Redis connected clients
LOW…/parsers/openmetrics/testcases/valid_counter/input.txt1# TYPE get_token_fail_count counter
LOWplugins/parsers/influx/README.md21 ## and more memory efficient.
LOWplugins/parsers/xpath/README.md101XPath expressions.
LOWplugins/parsers/xpath/README.md121 # xpath_protobuf_import_paths = ["."]
LOWplugins/parsers/xpath/README.md141 ## Multiple parsing sections are allowed
LOWplugins/parsers/xpath/README.md161
LOWplugins/parsers/xpath/README.md221 ## Name of the protocol-buffer message type to use in a fully qualified form.
LOWplugins/parsers/xpath/README.md241 ## Optional: XPath-query to select a subset of nodes from the XML document.
LOWplugins/parsers/xpath/README.md261 # field_name = "name()"
LOWplugins/parsers/grok/README.md81
LOWplugins/parsers/grok/README.md101 ## Other common built-in patterns are:
LOWplugins/parsers/json/README.md41
LOWplugins/parsers/json/README.md61 ## json_time_format = "unix"
LOWplugins/parsers/avro/README.md41 ## Avro data format settings
LOWplugins/parsers/avro/README.md61 # "name":"Value",
LOWplugins/parsers/avro/README.md81 ## from this field. If not set, determine measurement name
LOWplugins/parsers/avro/README.md101 ## to one of 'unix', 'unix_ms', 'unix_us', or 'unix_ns'. It will
LOWplugins/parsers/csv/README.md21 ## If `csv_column_names` is specified, the column names in header will be overridden.
LOWplugins/parsers/csv/README.md41 ## If set, the parser would use the provided separators in the csv_metadata_separators to look for metadata.
LOWplugins/parsers/csv/README.md61 ## By default, the parser assumes a comma (",")
LOWplugins/parsers/csv/README.md101 ## Indicates values to skip, such as an empty string value "".
LOWplugins/parsers/binary/README.md21 ## Specify the endianness of the data.
LOWplugins/parsers/binary/README.md41 ## name -- Name of the element (e.g. field or tag). Can be omitted
690 more matches not shown…
Cross-File Repetition32 hits · 160 pts
SeverityFileLineSnippet
HIGHconfig/secret_test.go0server=sqltelegraf\\sql2022;app name=telegraf;log=1;
HIGHconfig/secret_test.go0server=sqltelegraf\\sql2022;app name=telegraf;log=1;
HIGHconfig/secret_test.go0server=sqltelegraf\\sql2022;app name=telegraf;log=1;
HIGHconfig/secret_test.go0server=sqltelegraf\\sql2022;app name=telegraf;log=1;
HIGHconfig/testdata/envvar_comments.toml0# drop fields if they contain a string. # # example input: # measurement,host=hostname a=1,b="somestring" 15972554100000
HIGHconfig/testdata/envvar_comments.toml0# drop fields if they contain a string. # # example input: # measurement,host=hostname a=1,b="somestring" 15972554100000
HIGHconfig/testdata/envvar_comments_expected.toml0# drop fields if they contain a string. # # example input: # measurement,host=hostname a=1,b="somestring" 15972554100000
HIGHconfig/testdata/envvar_comments_expected.toml0# drop fields if they contain a string. # # example input: # measurement,host=hostname a=1,b="somestring" 15972554100000
HIGHplugins/outputs/postgresql/README.md0alter table {{ .table }} add column if not exists {{ .columns|join ", add column if not exists " }}
HIGHplugins/outputs/postgresql/README.md0alter table {{ .table }} add column if not exists {{ .columns|join ", add column if not exists " }}
HIGHplugins/outputs/postgresql/README.md0alter table {{ .table }} add column if not exists {{ .columns|join ", add column if not exists " }}
HIGHplugins/outputs/postgresql/README.md0alter table {{ .table }} add column if not exists {{ .columns|join ", add column if not exists " }}
HIGHplugins/outputs/postgresql/README.md0select create_hypertable({{ .table|quoteliteral }}, 'time', chunk_time_interval => interval '7d')
HIGHplugins/outputs/postgresql/README.md0select create_hypertable({{ .table|quoteliteral }}, 'time', chunk_time_interval => interval '7d')
HIGHplugins/outputs/postgresql/README.md0select create_hypertable({{ .table|quoteliteral }}, 'time', chunk_time_interval => interval '7d')
HIGHplugins/outputs/postgresql/README.md0alter table {{ .table }} set (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')
HIGHplugins/outputs/postgresql/README.md0alter table {{ .table }} set (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')
HIGHplugins/outputs/postgresql/README.md0alter table {{ .table }} set (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')
HIGHplugins/outputs/postgresql/README.md0alter table {{ .table }} set (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')
HIGHplugins/outputs/postgresql/sqltemplate/template.go0alter table {{ .table }} set (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')
HIGHplugins/outputs/postgresql/sqltemplate/template.go0alter table {{ .table }} set (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')
HIGHplugins/outputs/postgresql/sqltemplate/template.go0alter table {{ .table }} set (timescaledb.compress, timescaledb.compress_segmentby = 'tag_id')
HIGHplugins/outputs/postgresql/README.md0alter table {{.table}} add column if not exists {{.columns|join ", add column if not exists "}}
HIGHplugins/outputs/postgresql/sqltemplate/template.go0alter table {{.table}} add column if not exists {{.columns|join ", add column if not exists "}}
HIGHplugins/outputs/postgresql/sqltemplate/template.go0alter table {{.table}} add column if not exists {{.columns|join ", add column if not exists "}}
HIGHplugins/outputs/postgresql/README.md0create view {{ .table.withschema "public" }} as select time, {{ (.tagtable.columns.tags.concat .allcolumns.fields).ident
HIGHplugins/outputs/postgresql/README.md0create view {{ .table.withschema "public" }} as select time, {{ (.tagtable.columns.tags.concat .allcolumns.fields).ident
HIGHplugins/outputs/postgresql/sqltemplate/template.go0create view {{ .table.withschema "public" }} as select time, {{ (.tagtable.columns.tags.concat .allcolumns.fields).ident
HIGHplugins/outputs/postgresql/sqltemplate/template.go0create view {{ .table.withschema "public" }} as select time, {{ (.tagtable.columns.tags.concat .allcolumns.fields).ident
HIGHplugins/outputs/postgresql/sqltemplate/template.go0select create_hypertable({{ .table|quoteliteral }}, 'time', chunk_time_interval => interval '1d')
HIGHplugins/outputs/postgresql/sqltemplate/template.go0select create_hypertable({{ .table|quoteliteral }}, 'time', chunk_time_interval => interval '1d')
HIGHplugins/outputs/postgresql/sqltemplate/template.go0select create_hypertable({{ .table|quoteliteral }}, 'time', chunk_time_interval => interval '1d')
Decorative Section Separators21 hits · 92 pts
SeverityFileLineSnippet
MEDIUMagent/agent.go40// ┌───────┐
MEDIUMagent/agent.go42// └───────┘ │
MEDIUMagent/agent.go43// ┌───────┐ │ ______
MEDIUMagent/agent.go45// └───────┘ │
MEDIUMagent/agent.go46// ┌───────┐ │
MEDIUMagent/agent.go48// └───────┘
MEDIUMagent/agent.go54// ______ ┌───────────┐ ______
MEDIUMagent/agent.go56// └───────────┘
MEDIUMagent/agent.go68// ┌────────────┐
MEDIUMagent/agent.go70// │ └────────────┘ │
MEDIUMagent/agent.go71// ______ │ ┌────────────┐ │ ______
MEDIUMagent/agent.go73// │ └────────────┘ │
MEDIUMagent/agent.go74// │ ┌────────────┐ │
MEDIUMagent/agent.go76// │ └────────────┘
MEDIUMagent/agent.go78// └────────────────────────▶ ()_____)
MEDIUMagent/agent.go90// ┌────────┐
MEDIUMagent/agent.go92// │ └────────┘
MEDIUMagent/agent.go93// ______ ┌─────┐ │ ┌────────┐
MEDIUMagent/agent.go95// └─────┘ │ └────────┘
MEDIUMagent/agent.go96// │ ┌────────┐
MEDIUMagent/agent.go98// └────────┘
Synthetic Comment Markers3 hits · 22 pts
SeverityFileLineSnippet
HIGHplugins/inputs/procstat/procstat_test.go181 // Add the tags as requested by the user
HIGHplugins/inputs/procstat/process.go207 // Add the tags as requested by the user
HIGHplugins/inputs/filecount/filecount_test.go215 // create our desired "filesystem" object, complete with an internal map allowing our funcs to return meta data as requ
Slop Phrases2 hits · 5 pts
SeverityFileLineSnippet
MEDIUMconfig/testdata/telegraf-agent.toml120 # Or you can also use local socket(not work yet)
MEDIUMplugins/inputs/statsd/statsd.go1010 s.Log.Warn("Maximum TCP Connections reached, you may want to adjust max_tcp_connections")
Fake / Example Data5 hits · 5 pts
SeverityFileLineSnippet
LOWplugins/outputs/opentsdb/opentsdb_test.go196 testutil.TestMetric("Lorem Ipsum", "justametric.string"),
LOW…ins/inputs/influxdb_listener/influxdb_listener_test.go173 TokenUsername: "John Doe",
LOW…ins/inputs/influxdb_listener/influxdb_listener_test.go204 TokenUsername: "John Doe",
LOW…ins/inputs/influxdb_listener/influxdb_listener_test.go235 TokenUsername: "John Doe",
LOWplugins/inputs/consul/consul_test.go17 Notes: "lorem ipsum",
Magic Placeholder Names1 hit · 5 pts
SeverityFileLineSnippet
HIGH…ns/inputs/webhooks/filestack/testdata/dialog_open.json15 "apikey": "YOUR_API_KEY",
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMplugins/parsers/csv/parser_test.go1642 // Stress test with more goroutines and iterations to ensure robust thread safety
Verbosity Indicators1 hit · 2 pts
SeverityFileLineSnippet
LOWconfig/config.go529 // At this point we need to check if the files under /etc/telegraf are
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippet
LOWscripts/check-plugin-changes.sh9# Check if we're in a pull request