Skip to content

Commit

Permalink
[pdata] Deprecate [Metrics|Logs|Traces].MoveTo methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryax committed Feb 2, 2023
1 parent c0a08e3 commit e24cce3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .chloggen/pdata-deprecate-moveto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: deprecation

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate [Metrics|Logs|Traces].MoveTo methods.

# One or more tracking issues or pull requests related to the change
issues: [7091]
1 change: 1 addition & 0 deletions pdata/plog/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func NewLogs() Logs {

// MoveTo moves the Logs instance overriding the destination and
// resetting the current instance to its zero value.
// Deprecated: [1.0.0-rc5] The method can be replaced with a plain assignment.
func (ms Logs) MoveTo(dest Logs) {
*dest.getOrig() = *ms.getOrig()
*ms.getOrig() = otlpcollectorlog.ExportLogsServiceRequest{}
Expand Down
1 change: 1 addition & 0 deletions pdata/pmetric/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (ms Metrics) CopyTo(dest Metrics) {

// MoveTo moves the Metrics instance overriding the destination and
// resetting the current instance to its zero value.
// Deprecated: [1.0.0-rc5] The method can be replaced with a plain assignment.
func (ms Metrics) MoveTo(dest Metrics) {
*dest.getOrig() = *ms.getOrig()
*ms.getOrig() = otlpcollectormetrics.ExportMetricsServiceRequest{}
Expand Down
1 change: 1 addition & 0 deletions pdata/ptrace/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func NewTraces() Traces {

// MoveTo moves the Traces instance overriding the destination and
// resetting the current instance to its zero value.
// Deprecated: [1.0.0-rc5] The method can be replaced with a plain assignment.
func (ms Traces) MoveTo(dest Traces) {
*dest.getOrig() = *ms.getOrig()
*ms.getOrig() = otlpcollectortrace.ExportTraceServiceRequest{}
Expand Down

0 comments on commit e24cce3

Please sign in to comment.