Skip to content

ifName plugin parallel lookups fails #9983

@Hipska

Description

@Hipska

It seems like the processors.ifname setting max_parallel_lookups isn't working as expected. When I added more devices, the plugin started failing to get the ifname for some of them.

Relevant telegraf.conf:

Used default processors.ifname config (max_parallel_lookups = 100)

System info:

Telegraf 1.20.2 (git: HEAD f721f53)

Steps to reproduce:

  1. add lot of metrics from different agents

Expected behavior:

ifname processor to perfectly be able to do lookups in parallel.

Actual behavior:

Randomly getting these kind of errors:

D! [processors.ifname] Error adding tag interface number 126 isn't in the table of interface names

Additional info:

Although there seem to be signals in place to only do one lookup per agent, the lookup function itself does not seem to be thread-safe implemented:

func (d *IfName) getMapRemoteNoMock(agent string) (nameMap, error) {
gs := d.gsBase
err := gs.SetAgent(agent)
if err != nil {
return nil, fmt.Errorf("parsing agent tag: %w", err)
}
err = gs.Connect()
if err != nil {
return nil, fmt.Errorf("connecting when fetching interface names: %w", err)
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions