Skip to content

Lightweight modules parses hosts twice #19849

Closed
@sayden

Description

The Lightweight modules executes the WithHostParser twice. This is currently creating a bug when using a custom host parser like the DSN parsers that you can use in MySQL.

How to reproduce

Exiting: 1 error: host parser failed on light metricset factory for 'mysql/performance': error parsing mysql host: default addr for network 'root:/' unknown

What is happening is that it gets the config data from mysql.yml creates the uri and parses it. Then it mutates incoming config with the output of the parser. Finally, the parser is executed again with the mutated data and it fails.

Failling block is probably this one https://github.com/elastic/beats/blob/master/metricbeat/mb/lightmetricset.go#L86

It seems that the solution would be to avoid the second execution of the host parser.

Related issues

#16205

Metadata

Assignees

No one assigned

    Labels

    Team:Services(Deprecated) Label for the former Integrations-Services teambuglibbeat

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions