Skip to content

Commit ba8cfce

Browse files
authored
[receiver/snmp] Add column and scalar OID metrics to resources that have scalar OID attributes (#25174)
**Description:** <Describe what has changed.> - Added a new scalar_oid field to ResourceAttribtueConfigs to allow Scalar OIDs to be used as resource attributes (on Column OID metrics) - Added support for (Scalar OID only) resource attributes on Scalar OID metrics as well. **Link to tracking Issue:** #23373 **Testing:** - Valid and invalid configs using a scalar_oid resource attribute on both scalar and column oid metrics - Adding indexed metrics to resources with scalar_oid resource attributes - Adding scalar metrics to resources with scalar_oid resource attributes **Documentation:** <Describe the documentation added.> - Description of new scalar_oid field in ResourceAttributeConfig and comments on new functions - Description of new ResourceAttributes field on Scalar OID metrics
1 parent 69c74fb commit ba8cfce

19 files changed

+1859
-142
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: snmpreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Support scalar OID resource attributes
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [23373]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: Add column and scalar OID metrics to resources that have scalar OID attributes
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

receiver/snmpreceiver/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ Resource attribute configurations are used to define what resource attributes wi
8181

8282
| Field Name | Description | Value |
8383
| -- | -- | -- |
84-
| `oid` | Required if no `indexed_value_prefix`. This is the column OID in a SNMP table which will use the returned indexed SNMP data to create resource attribute values for unique resources. Metric configurations will reference these resource attribute configurations in order to assign metrics data to resources | string |
85-
| `indexed_value_prefix` | Required if no `oid`. This is a string prefix which will be added to the indices of returned metric indexed SNMP data to create resource attribute values for unique resources. Metric configurations will reference these resource attribute configurations in order to assign metrics data to resources | string |
84+
| `oid` | Required if no `scalar_oid` or `indexed_value_prefix`. This is the column OID in a SNMP table which will use the returned indexed SNMP data to create resource attribute values for unique resources. Metric configurations will reference these resource attribute configurations in order to assign metrics data to resources | string |
85+
| `scalar_oid` | Required if no `oid` or `indexed_value_prefix`. This is the scalar OID which will return non-indexed SNMP data to create resource attribute values for unique resources. Metric configurations will reference these resource attribute configurations in order to assign metrics data to resources | string |
86+
| `indexed_value_prefix` | Required if no `scalar_oid` or `oid`. This is a string prefix which will be added to the indices of returned metric indexed SNMP data to create resource attribute values for unique resources. Metric configurations will reference these resource attribute configurations in order to assign metrics data to resources | string |
8687
| `description` | Definition of what the resource attribute represents | string |
8788

8889
#### Attribute Configuration
@@ -125,6 +126,7 @@ Attribute configurations are used to define what resource attributes will be use
125126
| Field Name | Description | Value | Default |
126127
| -- | -- | -- | -- |
127128
| `oid` | The SNMP scalar OID value to grab data from (must end in .0). | string | |
129+
| `resource_attributes` | The names of the related resource attribute configurations, allowing scalar oid metrics to be added to resources that have one or more scalar oid resource attributes. Cannot have indexed resource attributes as values. | string[] | |
128130
| `attributes` | The names of the related attribute enum configurations as well as the values to attach to this returned SNMP scalar data. This can be used to have a metric config with multiple ScalarOIDs as different datapoints with different attributue values within the same metric | Attribute | |
129131

130132
#### ColumnOID Configuration

0 commit comments

Comments
 (0)