Skip to content

Commit ac520a5

Browse files
authored
[mdatagen] Add functions for processing structured events (#12961)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Add functions for processing structured events <!-- Issue number if applicable --> #### Link to tracking issue Part of #12571 <!--Describe what testing was performed and which tests were added.--> #### Testing Added <!--Describe the documentation added.--> #### Documentation Added <!--Please delete paragraphs that you did not use before submitting.-->
1 parent 8a38616 commit ac520a5

File tree

13 files changed

+904
-27
lines changed

13 files changed

+904
-27
lines changed

.chloggen/metadata-events-func.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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. otlpreceiver)
7+
component: cmd/mdatagen
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add functions for processing structured events in mdatagen
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [12571]
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:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: [api]

cmd/mdatagen/internal/loader_test.go

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,30 @@ func TestLoadMetadata(t *testing.T) {
250250
},
251251
Events: map[EventName]Event{
252252
"default.event": {
253-
Enabled: true,
254-
Description: "Example event enabled by default.",
255-
ExtendedDocumentation: "The event will be renamed soon.",
253+
Enabled: true,
254+
Description: "Example event enabled by default.",
256255
Warnings: Warnings{
257256
IfEnabledNotSet: "This event will be disabled by default soon.",
258257
},
259-
Attributes: []AttributeName{"string_attr", "boolean_attr"},
258+
Attributes: []AttributeName{"string_attr", "overridden_int_attr", "enum_attr", "slice_attr", "map_attr"},
259+
},
260+
"default.event.to_be_renamed": {
261+
Enabled: false,
262+
Description: "[DEPRECATED] Example event disabled by default.",
263+
ExtendedDocumentation: "The event will be renamed soon.",
264+
Warnings: Warnings{
265+
IfConfigured: "This event is deprecated and will be renamed soon.",
266+
},
267+
Attributes: []AttributeName{"string_attr", "boolean_attr", "boolean_attr2"},
268+
},
269+
"default.event.to_be_removed": {
270+
Enabled: true,
271+
Description: "[DEPRECATED] Example to-be-removed event enabled by default.",
272+
ExtendedDocumentation: "The event will be will be removed soon.",
273+
Warnings: Warnings{
274+
IfEnabled: "This event is deprecated and will be removed soon.",
275+
},
276+
Attributes: []AttributeName{"string_attr", "overridden_int_attr", "enum_attr", "slice_attr", "map_attr"},
260277
},
261278
},
262279
Telemetry: Telemetry{

cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config.go

Lines changed: 32 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)