Skip to content

improve(go.d/snmp profiles): simplify _generic-if.yaml and add interface type tags#20505

Merged
ilyam8 merged 2 commits intonetdata:masterfrom
ilyam8:imp-snmp-prof-gen-if
Jun 17, 2025
Merged

improve(go.d/snmp profiles): simplify _generic-if.yaml and add interface type tags#20505
ilyam8 merged 2 commits intonetdata:masterfrom
ilyam8:imp-snmp-prof-gen-if

Conversation

@ilyam8
Copy link
Copy Markdown
Member

@ilyam8 ilyam8 commented Jun 17, 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 17, 2025
@ilyam8 ilyam8 marked this pull request as ready for review June 17, 2025 12:49
@ilyam8 ilyam8 requested a review from Copilot June 17, 2025 12:49

This comment was marked as outdated.

@ilyam8 ilyam8 changed the title improve(snmp): simplify _generic-if.yaml and add interface type tags improve(go.d/snmp profiles): simplify _generic-if.yaml and add interface type tags Jun 17, 2025
Ancairon
Ancairon previously approved these changes Jun 17, 2025
@ilyam8 ilyam8 force-pushed the imp-snmp-prof-gen-if branch 2 times, most recently from 9fcdc68 to f1e119d Compare June 17, 2025 13:14
@ilyam8 ilyam8 force-pushed the imp-snmp-prof-gen-if branch from f1e119d to ddf0083 Compare June 17, 2025 13:42
@ilyam8 ilyam8 requested a review from Copilot June 17, 2025 13:52
Copy link
Copy Markdown
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 streamlines the SNMP interface profiles by removing explicit metric types and tag blocks in the YAML, adds a new mapping_ref mechanism to tag interface types, and implements runtime enrichment using a shared ifType mapping.

  • Infer metric types and tags directly in _generic-if.yaml instead of repeating blocks
  • Introduce a global sharedMappings.ifType map and enrichProfiles to apply mapping_ref
  • Extend MetricTagConfig to support mapping_ref in the Go data model

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/go/plugin/go.d/config/go.d/snmp.profiles/default/_generic-if.yaml Removed explicit metric_type and metric_tags, added mapping_ref for interface type
src/go/plugin/go.d/collector/snmp/ddsnmp/shared.go Added sharedMappings.ifType map with SNMP interface type codes
src/go/plugin/go.d/collector/snmp/ddsnmp/profile.go Integrated enrichProfiles to populate tag mappings based on mapping_ref
src/go/plugin/go.d/collector/snmp/ddsnmp/ddprofiledefinition/metrics.go Added MappingRef field to MetricTagConfig
Comments suppressed due to low confidence (2)

src/go/plugin/go.d/collector/snmp/ddsnmp/profile.go:263

  • The new enrichProfiles function and its integration in FindProfiles lack unit tests. Please add tests to verify that mapping_ref tags are populated correctly and that profiles without mapping_ref remain unchanged.
func enrichProfiles(profiles []*Profile) {

src/go/plugin/go.d/collector/snmp/ddsnmp/ddprofiledefinition/metrics.go:117

  • The new MappingRef field extends the public API and should be documented in the project's SNMP profile schema docs or examples. Please update relevant documentation to explain how to use mapping_ref.
	MappingRef string          `yaml:"mapping_ref,omitempty" json:"mapping_ref,omitempty"`

@ilyam8 ilyam8 merged commit bc26fbd into netdata:master Jun 17, 2025
104 of 105 checks passed
@ilyam8 ilyam8 deleted the imp-snmp-prof-gen-if branch June 17, 2025 14:13
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