Skip to content

Commit

Permalink
Merge branch 'main' into move-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
odubajDT authored Oct 1, 2024
2 parents 591dd5a + 1b9c8c8 commit 32aae5a
Show file tree
Hide file tree
Showing 145 changed files with 3,803 additions and 446 deletions.
27 changes: 27 additions & 0 deletions .chloggen/hostmetricsreceiver-mute-all-errors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: hostmetricsreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add ability to mute all errors (mainly due to access rights) coming from process scraper of the hostmetricsreceiver

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [20435]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
27 changes: 27 additions & 0 deletions .chloggen/kubeletstats_featuregate_metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: kubeletstats

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Introduce feature gate for deprecation of container.cpu.utilization, k8s.pod.cpu.utilization and k8s.node.cpu.utilization metrics

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35139]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
27 changes: 27 additions & 0 deletions .chloggen/metricsgeneration_relax_type_req.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: metricsgenerationprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Allow metric calculations to be done on sum metrics

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35428]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
27 changes: 27 additions & 0 deletions .chloggen/ottl-add-element-xml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'enhancement'

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: pkg/ottl

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add InsertXML Converter

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35436]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
27 changes: 27 additions & 0 deletions .chloggen/remove_exclusion_rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: signalfxexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Do not exclude the metric `container.memory.working_set`

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35475]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
27 changes: 27 additions & 0 deletions .chloggen/sqlserver_computer_rattr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: sqlserverreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add computer name resource attribute to relevant metrics

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35040]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
3 changes: 1 addition & 2 deletions connector/countconnector/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ func TestConfigErrors(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
err := tc.input.Validate()
assert.Error(t, err)
assert.Contains(t, err.Error(), tc.expect)
assert.ErrorContains(t, err, tc.expect)
})
}
}
3 changes: 1 addition & 2 deletions connector/sumconnector/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,7 @@ func TestConfigErrors(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
err := tc.input.Validate()
assert.Error(t, err)
assert.Contains(t, err.Error(), tc.expect)
assert.ErrorContains(t, err, tc.expect)
})
}
}
3 changes: 1 addition & 2 deletions exporter/clickhouseexporter/exporter_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ func TestLogsExporter_New(t *testing.T) {

failWithMsg := func(msg string) validate {
return func(t *testing.T, _ *logsExporter, err error) {
require.Error(t, err)
require.Contains(t, err.Error(), msg)
require.ErrorContains(t, err, msg)
}
}

Expand Down
20 changes: 7 additions & 13 deletions exporter/kafkaexporter/kafka_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,15 @@ func TestNewExporter_err_auth_type(t *testing.T) {
texp := newTracesExporter(c, exportertest.NewNopSettings())
require.NotNil(t, texp)
err := texp.start(context.Background(), componenttest.NewNopHost())
assert.Error(t, err)
assert.Contains(t, err.Error(), "failed to load TLS config")
assert.ErrorContains(t, err, "failed to load TLS config")
mexp := newMetricsExporter(c, exportertest.NewNopSettings())
require.NotNil(t, mexp)
err = mexp.start(context.Background(), componenttest.NewNopHost())
assert.Error(t, err)
assert.Contains(t, err.Error(), "failed to load TLS config")
assert.ErrorContains(t, err, "failed to load TLS config")
lexp := newLogsExporter(c, exportertest.NewNopSettings())
require.NotNil(t, lexp)
err = lexp.start(context.Background(), componenttest.NewNopHost())
assert.Error(t, err)
assert.Contains(t, err.Error(), "failed to load TLS config")
assert.ErrorContains(t, err, "failed to load TLS config")

}

Expand All @@ -157,7 +154,7 @@ func TestNewExporter_err_compression(t *testing.T) {
require.NotNil(t, texp)
err := texp.start(context.Background(), componenttest.NewNopHost())
assert.Error(t, err)
assert.Contains(t, err.Error(), "producer.compression should be one of 'none', 'gzip', 'snappy', 'lz4', or 'zstd'. configured value idk")
assert.ErrorContains(t, err, "producer.compression should be one of 'none', 'gzip', 'snappy', 'lz4', or 'zstd'. configured value idk")
}

func TestTracesExporter_encoding_extension(t *testing.T) {
Expand Down Expand Up @@ -249,8 +246,7 @@ func TestTracesPusher_marshal_error(t *testing.T) {
}
td := testdata.GenerateTraces(2)
err := p.tracesPusher(context.Background(), td)
require.Error(t, err)
assert.Contains(t, err.Error(), expErr.Error())
assert.ErrorContains(t, err, expErr.Error())
}

func TestMetricsDataPusher(t *testing.T) {
Expand Down Expand Up @@ -331,8 +327,7 @@ func TestMetricsDataPusher_marshal_error(t *testing.T) {
}
md := testdata.GenerateMetrics(2)
err := p.metricsDataPusher(context.Background(), md)
require.Error(t, err)
assert.Contains(t, err.Error(), expErr.Error())
assert.ErrorContains(t, err, expErr.Error())
}

func TestLogsDataPusher(t *testing.T) {
Expand Down Expand Up @@ -413,8 +408,7 @@ func TestLogsDataPusher_marshal_error(t *testing.T) {
}
ld := testdata.GenerateLogs(1)
err := p.logsDataPusher(context.Background(), ld)
require.Error(t, err)
assert.Contains(t, err.Error(), expErr.Error())
assert.ErrorContains(t, err, expErr.Error())
}

type tracesErrorMarshaler struct {
Expand Down
3 changes: 1 addition & 2 deletions exporter/lokiexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ func TestConfigValidate(t *testing.T) {
t.Run(tc.desc, func(t *testing.T) {
err := tc.cfg.Validate()
if tc.err != nil {
require.Error(t, err)
assert.Contains(t, err.Error(), tc.err.Error())
assert.ErrorContains(t, err, tc.err.Error())
} else {
require.NoError(t, err)
}
Expand Down
9 changes: 3 additions & 6 deletions exporter/otelarrowexporter/internal/arrow/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,10 @@ func TestStreamStatusUnavailableInvalid(t *testing.T) {
}()
// sender should get "test unavailable" once, success second time.
err := tc.mustSendAndWait()
require.Error(t, err)
require.Contains(t, err.Error(), "test unavailable")
require.ErrorContains(t, err, "test unavailable")

err = tc.mustSendAndWait()
require.Error(t, err)
require.Contains(t, err.Error(), "test invalid")
require.ErrorContains(t, err, "test invalid")

err = tc.mustSendAndWait()
require.NoError(t, err)
Expand Down Expand Up @@ -282,8 +280,7 @@ func TestStreamStatusUnrecognized(t *testing.T) {
channel.recv <- statusUnrecognizedFor(batch.BatchId)
}()
err := tc.mustSendAndWait()
require.Error(t, err)
require.Contains(t, err.Error(), "test unrecognized")
require.ErrorContains(t, err, "test unrecognized")

// Note: do not cancel the context, the stream should be
// shutting down due to the error.
Expand Down
7 changes: 3 additions & 4 deletions exporter/otelarrowexporter/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ func TestDuplicateMetadataKeys(t *testing.T) {
cfg := createDefaultConfig().(*Config)
cfg.MetadataKeys = []string{"myTOKEN", "mytoken"}
err := cfg.Validate()
require.Error(t, err)
require.Contains(t, err.Error(), "duplicate")
require.Contains(t, err.Error(), "mytoken")
require.ErrorContains(t, err, "duplicate")
require.ErrorContains(t, err, "mytoken")
}

func TestMetadataExporterCardinalityLimit(t *testing.T) {
Expand Down Expand Up @@ -196,7 +195,7 @@ func TestMetadataExporterCardinalityLimit(t *testing.T) {
err = exp.ConsumeTraces(ctx, td)
require.Error(t, err)
assert.True(t, consumererror.IsPermanent(err))
assert.Contains(t, err.Error(), "too many")
assert.ErrorContains(t, err, "too many")

assert.Eventually(t, func() bool {
return rcv.requestCount.Load() == int32(cardLimit)
Expand Down
3 changes: 1 addition & 2 deletions exporter/otelarrowexporter/otelarrow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1133,8 +1133,7 @@ func TestSendArrowFailedTraces(t *testing.T) {
// Send two trace items.
td := testdata.GenerateTraces(2)
err = exp.ConsumeTraces(context.Background(), td)
assert.Error(t, err)
assert.Contains(t, err.Error(), "test failed")
assert.ErrorContains(t, err, "test failed")

// Wait until it is received.
assert.Eventually(t, func() bool {
Expand Down
4 changes: 2 additions & 2 deletions exporter/signalfxexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func TestConsumeMetrics(t *testing.T) {
assert.Error(t, err)
assert.True(t, consumererror.IsPermanent(err))
assert.True(t, strings.HasPrefix(err.Error(), tt.expectedErrorMsg))
assert.Contains(t, err.Error(), "response content")
assert.ErrorContains(t, err, "response content")
return
}

Expand Down Expand Up @@ -1843,7 +1843,7 @@ func TestConsumeMixedMetrics(t *testing.T) {
assert.Error(t, err)
assert.True(t, consumererror.IsPermanent(err))
assert.True(t, strings.HasPrefix(err.Error(), tt.expectedErrorMsg))
assert.Contains(t, err.Error(), "response content")
assert.ErrorContains(t, err, "response content")
return
}

Expand Down
2 changes: 1 addition & 1 deletion exporter/signalfxexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func TestDefaultExcludes_not_translated(t *testing.T) {
require.NoError(t, err)

md := getMetrics(metrics)
require.Equal(t, 69, md.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().Len())
require.Equal(t, 68, md.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().Len())
dps := converter.MetricsToSignalFxV2(md)
require.Empty(t, dps)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestTrackerStart(t *testing.T) {
if tt.wantErr {
require.Error(t, err)
if tt.errMsg != "" {
require.Contains(t, err.Error(), tt.errMsg)
require.ErrorContains(t, err, tt.errMsg)
}
} else {
require.NoError(t, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ exclude_metrics:
- /^(?i:(container)|(k8s\.node)|(k8s\.pod))\.memory\.page_faults$/
- /^(?i:(container)|(k8s\.node)|(k8s\.pod))\.memory\.rss$/
- /^(?i:(k8s\.node)|(k8s\.pod))\.memory\.usage$/
- /^(?i:(container)|(k8s\.node)|(k8s\.pod))\.memory\.working_set$/
- /^(?i:(k8s\.node)|(k8s\.pod))\.memory\.working_set$/
# matches (k8s.node|k8s.pod).filesystem...
- /^k8s\.(?i:(node)|(pod))\.filesystem\.available$/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@
{
"container.memory.rss": null
},
{
"container.memory.working_set": null
},
{
"k8s.pod.memory.available": null
},
Expand Down
Loading

0 comments on commit 32aae5a

Please sign in to comment.