Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(inputs.gnmi): Fix empty name for Sonic device #12258

Merged
merged 3 commits into from
Nov 21, 2022

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Nov 17, 2022

resolves #12257

When used with a Sonic switch (4.0.2), the GNMI plugin produces an empty measurement name and in turn bails-out with Could not serialize metric: invalid name on the output side. The root cause of this is that the mentioned device reports the origin of the data as part of the first element in the form openconfig-platform:components for the update. This leads to a lookup error in the internal aliases map as usually the path is considered to be absolute and not including the origin.

This PR first adds two test-cases reflecting the debug data gathered from the (non-working) Sonic device as well as a working Arista device. It then adds an error in case the name cannot be determined to better track-down the root cause of future error cases. The PR then checks for the unusual reporting behavior and, if applicable, correctly splits the first element into the origin and path element thus fixing the issue.

@telegraf-tiger telegraf-tiger bot added area/gnmi fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Nov 17, 2022
@srebhan srebhan marked this pull request as draft November 17, 2022 13:37
@srebhan srebhan marked this pull request as ready for review November 18, 2022 15:36
@srebhan srebhan changed the title fix(inputs.gnmi): Fix empty name fix(inputs.gnmi): Fix empty name for Sonic device Nov 18, 2022
@srebhan srebhan requested a review from powersj November 18, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gnmi fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could not serialize metric: invalid name from gnmi input plugin with Sonic switch
2 participants