Skip to content

Commit 8b9aeca

Browse files
authored
Merge branch 'main' into fix/14307-aix-crash
2 parents 30d4877 + 7c31dd5 commit 8b9aeca

File tree

135 files changed

+997
-219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+997
-219
lines changed

.chloggen/add-metrics-scraper.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. receiver/otlp)
7+
component: pkg/scraperhelper
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Introduce `AddMetricsScraper` to be more explicit than `AddScraper`.
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [14428]
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]
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: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. receiver/otlp)
7+
component: pkg/scraperhelper
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Deprecate the `AddScraper` method.
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [14428]
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]
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. receiver/otlp)
7+
component: receiver/otlp
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add metrics tracking the number of receiver, refused and failed profile samples
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [14226]
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]
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. receiver/otlp)
7+
component: pkg/receiverhelper
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add support for profile samples metrics
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [14226]
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]
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. receiver/otlp)
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: Validate stability level for entities
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [14425]
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: []

cmd/mdatagen/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ require (
4040
github.com/davecgh/go-spew v1.1.1 // indirect
4141
github.com/go-logr/logr v1.4.3 // indirect
4242
github.com/go-logr/stdr v1.2.2 // indirect
43-
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
43+
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
4444
github.com/gobwas/glob v0.2.3 // indirect
4545
github.com/google/uuid v1.6.0 // indirect
4646
github.com/hashicorp/go-version v1.8.0 // indirect

cmd/mdatagen/go.sum

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

cmd/mdatagen/internal/loader_test.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ func TestLoadMetadata(t *testing.T) {
244244
FullName: "opt_in_bool_attr",
245245
RequirementLevel: AttributeRequirementLevelOptIn,
246246
},
247+
"required_string_attr": {
248+
Description: "A required attribute with a string value",
249+
Type: ValueType{
250+
ValueType: pcommon.ValueTypeStr,
251+
},
252+
FullName: "required_string_attr",
253+
RequirementLevel: AttributeRequirementLevelRequired,
254+
},
247255
},
248256
Metrics: map[MetricName]Metric{
249257
"default.metric": {
@@ -267,7 +275,7 @@ func TestLoadMetadata(t *testing.T) {
267275
"reaggregate.metric": {
268276
Signal: Signal{
269277
Enabled: true,
270-
Description: "Metric for testing spacial reaggregation",
278+
Description: "Metric for testing spatial reaggregation",
271279
Stability: Stability{Level: component.StabilityLevelBeta},
272280
Attributes: []AttributeName{"string_attr", "boolean_attr"},
273281
},
@@ -276,6 +284,18 @@ func TestLoadMetadata(t *testing.T) {
276284
MetricValueType: MetricValueType{pmetric.NumberDataPointValueTypeDouble},
277285
},
278286
},
287+
"reaggregate.metric.with_required": {
288+
Signal: Signal{
289+
Enabled: true,
290+
Description: "Metric for testing spatial reaggregation with required attributes",
291+
Stability: Stability{Level: component.StabilityLevelBeta},
292+
Attributes: []AttributeName{"required_string_attr", "string_attr", "boolean_attr"},
293+
},
294+
Unit: strPtr("1"),
295+
Gauge: &Gauge{
296+
MetricValueType: MetricValueType{pmetric.NumberDataPointValueTypeDouble},
297+
},
298+
},
279299
"system.cpu.time": {
280300
Signal: Signal{
281301
Enabled: true,

cmd/mdatagen/internal/metadata.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"strconv"
1212
"strings"
1313

14+
"go.opentelemetry.io/collector/component"
1415
"go.opentelemetry.io/collector/filter"
1516
"go.opentelemetry.io/collector/pdata/pcommon"
1617
)
@@ -628,7 +629,7 @@ type Entity struct {
628629
// Brief is a brief description of the entity.
629630
Brief string `mapstructure:"brief"`
630631
// Stability is the stability level of the entity.
631-
Stability string `mapstructure:"stability"`
632+
Stability component.StabilityLevel `mapstructure:"stability"`
632633
// Identity contains references to resource attributes that uniquely identify the entity.
633634
Identity []EntityAttributeRef `mapstructure:"identity"`
634635
// Description contains references to resource attributes that describe the entity.

cmd/mdatagen/internal/metadata_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ func TestValidate(t *testing.T) {
140140
name: "testdata/entity_duplicate_types.yaml",
141141
wantErr: `duplicate entity type: host`,
142142
},
143+
{
144+
name: "testdata/invalid_entity_stability.yaml",
145+
wantErr: `unsupported stability level: "stable42"`,
146+
},
143147
}
144148
for _, tt := range tests {
145149
t.Run(tt.name, func(t *testing.T) {

0 commit comments

Comments
 (0)