Skip to content

chore(go.d/ddsnmp): add index-based tags and cross-table index transformation support#20482

Merged
ilyam8 merged 5 commits intonetdata:masterfrom
ilyam8:go.d-ddsnmp-table-simple-index
Jun 15, 2025
Merged

chore(go.d/ddsnmp): add index-based tags and cross-table index transformation support#20482
ilyam8 merged 5 commits intonetdata:masterfrom
ilyam8:go.d-ddsnmp-table-simple-index

Conversation

@ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Jun 14, 2025

Summary
Test Plan
Additional Information
For users: How does this change affect me?

@github-actions github-actions bot added area/collectors Everything related to data collection collectors/go.d area/go labels Jun 14, 2025
@ilyam8 ilyam8 requested a review from Copilot June 14, 2025 20:26

This comment was marked as outdated.

@ilyam8 ilyam8 enabled auto-merge (squash) June 14, 2025 20:31
@ilyam8 ilyam8 changed the title chore(go.d/ddsnmp): support extracting table index components as tags chore(go.d/ddsnmp): add index-based tags and cross-table index transformation support Jun 15, 2025
@ilyam8 ilyam8 requested a review from Copilot June 15, 2025 07:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for index-based tags and cross‐table index transformation in the SNMP collector by refactoring the table walking and processing logic.

  • Removed the previous table-skipping logic for tags with index transformations.
  • Updated the processTableData function to apply index transformations and handle index‐based tags.
  • Added helper functions (getIndexPosition and applyIndexTransform) and refined SNMP walk processing.
Comments suppressed due to low confidence (2)

src/go/plugin/go.d/collector/snmp/ddsnmp/ddsnmpcollector/collect_table.go:266

  • [nitpick] Ensure that the 'ternary' function is defined or imported in the codebase, as Go does not provide a built-in ternary operator. Consider refactoring this into a clear if/else block if there is any ambiguity.
tagName := ternary(tagCfg.Tag != "", tagCfg.Tag, fmt.Sprintf("index%d", tagCfg.Index))

src/go/plugin/go.d/collector/snmp/ddsnmp/ddsnmpcollector/collect_table.go:470

  • The revised snmpWalk function no longer logs each non-data PDU as missing; instead, it marks the entire oid as missing when no valid PDUs are found. Please confirm that this logging change is intentional for diagnostic purposes.
if isPduWithData(pdu) {

@ilyam8 ilyam8 merged commit 055d6a3 into netdata:master Jun 15, 2025
105 of 106 checks passed
@ilyam8 ilyam8 deleted the go.d-ddsnmp-table-simple-index branch June 15, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/collectors Everything related to data collection area/go collectors/go.d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants