[component/componenttest] Remove the deprecated componenttest.TestTelemetry (#12545)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Remove the deprecated componenttest.TestTelemetry in favor of
componenttest.Telemetry

<!-- Issue number if applicable -->
#### Link to tracking issue
Relevant to #12419 

<!--Describe what testing was performed and which tests were added.-->
#### Testing
n/a

<!--Describe the documentation added.-->
#### Documentation
n/a

<!--Please delete paragraphs that you did not use before submitting.-->
This commit is contained in:
Chao Weng 2025-03-04 20:22:23 +08:00 committed by GitHub
parent 6e82944c1a
commit b6e4fc2164
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 33 deletions

View File

@ -0,0 +1,25 @@
# 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. otlpreceiver)
component: component/componenttest
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove the deprecated componenttest.TestTelemetry in favor of componenttest.Telemetry
# One or more tracking issues or pull requests related to the change
issues: [12419]
# (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:
# 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: [api]

View File

@ -1,33 +0,0 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package componenttest // import "go.opentelemetry.io/collector/component/componenttest"
import (
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/collector/component"
)
// Deprecated: [v0.121.0] use the componenttest.Telemetry instead.
type TestTelemetry struct {
*Telemetry
id component.ID
}
// Deprecated: [v0.121.0] use the NewTelemetrySettings from componenttest.Telemetry.
func (tts *TestTelemetry) TelemetrySettings() component.TelemetrySettings {
return tts.NewTelemetrySettings()
}
// Deprecated: [v0.121.0] use the componenttest.NewTelemetry instead.
func SetupTelemetry(id component.ID) (TestTelemetry, error) {
return TestTelemetry{
Telemetry: NewTelemetry(
WithMetricOptions(sdkmetric.WithResource(resource.Empty())),
WithTraceOptions(sdktrace.WithResource(resource.Empty()))),
id: id,
}, nil
}