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): Allow to disable using first namespace as origin #16507

Merged
merged 3 commits into from
Feb 24, 2025

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Feb 11, 2025

Summary

Due to previous issues with devices reporting the origin of a response in the first element of the path, previous attempts (e.g. PR #14838) simply used the namespace of the first path element as origin if any. However, this will always override the origin even if it was specified correctly by the device. Furthermore, this approach will simply convert valid namespaces of elements to an origin which is wrong.

This PR introduces a new option called enforce_first_namespace_as_origin which by default keeps the current approach but allows to disable the behavior to not mangle the origin any longer.

Caution

Disabling enforce_first_namespace_as_origin will no longer be mangled the response path and therefore the path tag might change! This might cause existing queries to break and might increase the cardinality in your database!

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16476

@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 Feb 11, 2025
@srebhan srebhan self-assigned this Feb 11, 2025
@whizkidTRW
Copy link

I can confirm this fixed the issue. Thanks @srebhan!

etc % ~/dev/devops/telegraf/bin/telegraf-1.34.0/usr/bin/telegraf --config telegraf.conf --config-directory ./telegraf.d --test-wait 45
2025-02-11T17:06:22Z I! Loading config: telegraf.conf
2025-02-11T17:06:22Z I! Loading config: telegraf.d/ciena.conf
2025-02-11T17:06:22Z W! DeprecationWarning: Option "fieldpass" of plugin "inputs.gnmi" deprecated since version 1.29.0 and will be removed in 1.40.0: use 'fieldinclude' instead
2025-02-11T17:06:22Z I! Starting Telegraf 1.34.0-a62ffed9 brought to you by InfluxData the makers of InfluxDB
2025-02-11T17:06:22Z I! Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 5 secret-stores
2025-02-11T17:06:22Z I! Loaded inputs: gnmi
2025-02-11T17:06:22Z I! Loaded aggregators:
2025-02-11T17:06:22Z I! Loaded processors: converter rename strings
2025-02-11T17:06:22Z I! Loaded secretstores:
2025-02-11T17:06:22Z W! Outputs are not used in testing mode!
2025-02-11T17:06:22Z I! Tags enabled: host=XXX.XXX.XXX.XXX
> interface,agent_host=XXX.XXX.XXX.XXX,host=XXX.XXX.XXX.XXX,ifIndex=5 ifHCInOctets=0u,ifHCOutOctets=0u,ifInCrcErrors=0u,ifInDiscards=0u,ifInErrors=0u,ifOutErrors=0u 1739293587842000000
> interface,agent_host=XXX.XXX.XXX.XXX,host=XXX.XXX.XXX.XXX,ifIndex=6 ifHCInOctets=0u,ifHCOutOctets=0u,ifInCrcErrors=0u,ifInDiscards=0u,ifInErrors=0u,ifOutErrors=0u 1739293587842000000
> interface,agent_host=XXX.XXX.XXX.XXX,host=XXX.XXX.XXX.XXX,ifIndex=7 ifHCInOctets=0u,ifHCOutOctets=0u,ifInCrcErrors=0u,ifInDiscards=0u,ifInErrors=0u,ifOutErrors=0u 1739293587842000000
> interface,agent_host=XXX.XXX.XXX.XXX,host=XXX.XXX.XXX.XXX,ifIndex=8 ifHCInOctets=0u,ifHCOutOctets=0u,ifInCrcErrors=0u,ifInDiscards=0u,ifInErrors=0u,ifOutErrors=0u 1739293587843000000
> interface,agent_host=XXX.XXX.XXX.XXX,host=XXX.XXX.XXX.XXX,ifIndex=9 ifHCInOctets=0u,ifHCOutOctets=0u,ifInCrcErrors=0u,ifInDiscards=0u,ifInErrors=0u,ifOutErrors=0u 1739293587843000000
> interface,agent_host=XXX.XXX.XXX.XXX,host=XXX.XXX.XXX.XXX,ifIndex=10 ifHCInOctets=0u,ifHCOutOctets=0u,ifInCrcErrors=0u,ifInDiscards=0u,ifInErrors=0u,ifOutErrors=0u 1739293587843000000

. . . output trimmed for clarity . . .

> interface,agent_host=XXX.XXX.XXX.XXX,host=XXX.XXX.XXX.XXX,ifIndex=34 ifHCInOctets=381756983492179u,ifHCOutOctets=5107627111593420u,ifInCrcErrors=0u,ifInDiscards=6189278u,ifInErrors=0u,ifOutErrors=0u 1739293617854000000
> interface,agent_host=XXX.XXX.XXX.XXX,host=XXX.XXX.XXX.XXX,ifIndex=35 ifHCInOctets=0u,ifHCOutOctets=0u,ifInCrcErrors=0u,ifInDiscards=0u,ifInErrors=0u,ifOutErrors=0u 1739293617854000000
> interface,agent_host=XXX.XXX.XXX.XXX,host=XXX.XXX.XXX.XXX,ifIndex=36 ifHCInOctets=9938576476700818u,ifHCOutOctets=1608677608870946u,ifInCrcErrors=3453010u,ifInDiscards=4980248u,ifInErrors=3453011u,ifOutErrors=0u 1739293617854000000

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Feb 12, 2025
@srebhan srebhan assigned DStrand1 and unassigned srebhan Feb 12, 2025
@telegraf-tiger
Copy link
Contributor

@DStrand1 DStrand1 merged commit 0dcdbe4 into influxdata:master Feb 24, 2025
25 of 27 checks passed
@github-actions github-actions bot added this to the v1.33.3 milestone Feb 24, 2025
srebhan added a commit that referenced this pull request Feb 25, 2025
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 ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gNMI - TLS handshake failure on Ciena devices
3 participants