Skip to content

Commit

Permalink
remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Boten committed Sep 29, 2022
1 parent 7740c7b commit 130dd96
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 256 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

## Unreleased

### 🛑 Breaking changes 🛑

- Delete deprecated `go.opentelemetry.io/collector/service/featuregate`. (#6178)
- Delete deprecated `pmetric.OptionalType`. (#6178)
- Delete deprecated `ptrace.Span[Link]?.TraceStateStruct`. (#6178)
- Delete deprecated `pcommon.NewValueBytesEmpty`. (#6178)
- Delete deprecated `pmetric.MetricDataType`. (#6178)
- Delete deprecated `pmetric.Metric.DataType()`. (#6178)
- Delete deprecated `pmetric.NumberDataPoint.[Set]?[Int|Double]Val()`. (#6178)
- Delete deprecated `pmetric.Exemplar.[Set]?[Int|Double]Val()`. (#6178)
- Delete deprecated `p[metric|log|trace]otlp.[Client|Server]`. (#6178)
- Delete deprecated pdata Clone methods. (#6178)
- Delete deprecated `pcommon.Value` getter/setter methods with `Val` suffix. (#6178)
- Delete deprecated `StringVal` and `SetStringVal` methods. (#6178)
- Delete deprecated `ValueTypeString` method. (#6178)

## v0.61.0 Beta

### 🛑 Breaking changes 🛑
Expand Down
76 changes: 0 additions & 76 deletions pdata/pcommon/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ const (
ValueTypeBytes
)

// Deprecated: [0.61.0] Use ValueTypeStr instead
const ValueTypeString = ValueTypeStr

// String returns the string representation of the ValueType.
func (avt ValueType) String() string {
switch avt {
Expand Down Expand Up @@ -128,9 +125,6 @@ func NewValueBytes() Value {
return newValue(&otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_BytesValue{BytesValue: nil}})
}

// Deprecated: [0.61.0] Use NewValueBytes instead
var NewValueBytesEmpty = NewValueBytes

func newValue(orig *otlpcommon.AnyValue) Value {
return Value(internal.NewValue(orig))
}
Expand Down Expand Up @@ -326,76 +320,6 @@ func (v Value) SetEmptySlice() Slice {
return newSlice(&av.ArrayValue.Values)
}

// Deprecated: [0.61.0] Use Str instead.
func (v Value) StringVal() string {
return v.Str()
}

// Deprecated: [0.61.0] Use GetInt instead.
func (v Value) IntVal() int64 {
return v.Int()
}

// Deprecated: [0.61.0] Use GetDouble instead.
func (v Value) DoubleVal() float64 {
return v.Double()
}

// Deprecated: [0.61.0] Use GetBool instead.
func (v Value) BoolVal() bool {
return v.Bool()
}

// Deprecated: [0.61.0] Use GetMap instead.
func (v Value) MapVal() Map {
return v.Map()
}

// Deprecated: [0.61.0] Use GetSlice instead.
func (v Value) SliceVal() Slice {
return v.Slice()
}

// Deprecated: [0.61.0] Use GetBytes instead.
func (v Value) BytesVal() ByteSlice {
return v.Bytes()
}

// Deprecated: [0.61.0] Use SetStr instead.
func (v Value) SetStringVal(sv string) {
v.SetStr(sv)
}

// Deprecated: [0.61.0] Use SetInt instead.
func (v Value) SetIntVal(iv int64) {
v.SetInt(iv)
}

// Deprecated: [0.61.0] Use SetDouble instead.
func (v Value) SetDoubleVal(dv float64) {
v.SetDouble(dv)
}

// Deprecated: [0.61.0] Use SetBool instead.
func (v Value) SetBoolVal(bv bool) {
v.SetBool(bv)
}

// Deprecated: [0.61.0] Use SetEmptyBytes instead.
func (v Value) SetEmptyBytesVal() ByteSlice {
return v.SetEmptyBytes()
}

// Deprecated: [0.61.0] Use SetEmptyMap instead.
func (v Value) SetEmptyMapVal() Map {
return v.SetEmptyMap()
}

// Deprecated: [0.61.0] Use SetEmptySlice instead.
func (v Value) SetEmptySliceVal() Slice {
return v.SetEmptySlice()
}

// CopyTo copies the attribute to a destination.
func (v Value) CopyTo(dest Value) {
destOrig := dest.getOrig()
Expand Down
11 changes: 0 additions & 11 deletions pdata/plog/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@ func (ms Logs) CopyTo(dest Logs) {
ms.ResourceLogs().CopyTo(dest.ResourceLogs())
}

// Clone returns a copy of Logs.
// Deprecated: [0.61.0] Replace with:
//
// newLogs := NewLogs()
// ms.CopyTo(newLogs)
func (ms Logs) Clone() Logs {
cloneLd := NewLogs()
ms.ResourceLogs().CopyTo(cloneLd.ResourceLogs())
return cloneLd
}

// LogRecordCount calculates the total number of log records.
func (ms Logs) LogRecordCount() int {
logCount := 0
Expand Down
6 changes: 0 additions & 6 deletions pdata/plog/plogotlp/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ type GRPCClient interface {
Export(ctx context.Context, request Request, opts ...grpc.CallOption) (Response, error)
}

// Deprecated: [0.61.0] Use GRPCClient instead
type Client = GRPCClient

type logsClient struct {
rawClient otlpcollectorlog.LogsServiceClient
}
Expand All @@ -152,9 +149,6 @@ type GRPCServer interface {
Export(context.Context, Request) (Response, error)
}

// Deprecated: [0.61.0] Use GRPCServer instead
type Server = GRPCServer

// RegisterServer registers the Server to the grpc.Server.
func RegisterServer(s *grpc.Server, srv GRPCServer) {
otlpcollectorlog.RegisterLogsServiceServer(s, &rawLogsServer{srv: srv})
Expand Down
95 changes: 0 additions & 95 deletions pdata/pmetric/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ func (ms Metrics) CopyTo(dest Metrics) {
ms.ResourceMetrics().CopyTo(dest.ResourceMetrics())
}

// Clone returns a copy of Metrics.
// Deprecated: [0.61.0] Replace with:
//
// newMetrics := NewMetrics()
// ms.CopyTo(newMetrics)
func (ms Metrics) Clone() Metrics {
cloneMd := NewMetrics()
ms.ResourceMetrics().CopyTo(cloneMd.ResourceMetrics())
return cloneMd
}

// MoveTo moves all properties from the current struct to dest
// resetting the current instance to its zero value.
func (ms Metrics) MoveTo(dest Metrics) {
Expand Down Expand Up @@ -109,29 +98,6 @@ func (ms Metrics) DataPointCount() (dataPointCount int) {
return
}

// Deprecated: [v0.61.0] use MetricType.
type MetricDataType = MetricType

const (
// Deprecated: [v0.61.0] use MetricTypeNone.
MetricDataTypeNone = MetricTypeNone
// Deprecated: [v0.61.0] use MetricTypeGauge.
MetricDataTypeGauge = MetricTypeGauge
// Deprecated: [v0.61.0] use MetricTypeSum.
MetricDataTypeSum = MetricTypeSum
// Deprecated: [v0.61.0] use MetricTypeHistogram.
MetricDataTypeHistogram = MetricTypeHistogram
// Deprecated: [v0.61.0] use MetricTypeExponentialHistogram.
MetricDataTypeExponentialHistogram = MetricTypeExponentialHistogram
// Deprecated: [v0.61.0] use MetricTypeSummary.
MetricDataTypeSummary = MetricTypeSummary
)

// Deprecated: [v0.61.0] use Metric.Type().
func (ms Metric) DataType() MetricDataType {
return ms.Type()
}

// MetricType specifies the type of data in a Metric.
type MetricType int32

Expand Down Expand Up @@ -224,64 +190,3 @@ func (nt ExemplarValueType) String() string {
}
return ""
}

// Deprecated: [v0.61.0] not used, will be deleted in next release.
type OptionalType int32

const (
// Deprecated: [v0.61.0] not used, will be deleted in next release.
OptionalTypeNone OptionalType = iota
// Deprecated: [v0.61.0] not used, will be deleted in next release.
OptionalTypeDouble
)

// Deprecated: [v0.61.0] not used, will be deleted in next release.
func (ot OptionalType) String() string {
switch ot {
case OptionalTypeNone:
return "None"
case OptionalTypeDouble:
return "Double"
}
return ""
}

// Deprecated: [v0.61.0] use NumberDataPoint.DoubleValue().
func (ms NumberDataPoint) DoubleVal() float64 {
return ms.DoubleValue()
}

// Deprecated: [v0.61.0] use NumberDataPoint.SetDoubleValue().
func (ms NumberDataPoint) SetDoubleVal(v float64) {
ms.SetDoubleValue(v)
}

// Deprecated: [v0.61.0] use NumberDataPoint.IntValue().
func (ms NumberDataPoint) IntVal() int64 {
return ms.IntValue()
}

// Deprecated: [v0.61.0] use NumberDataPoint.SetIntValue().
func (ms NumberDataPoint) SetIntVal(v int64) {
ms.SetIntValue(v)
}

// Deprecated: [v0.61.0] use Exemplar.DoubleValue().
func (ms Exemplar) DoubleVal() float64 {
return ms.DoubleValue()
}

// Deprecated: [v0.61.0] use Exemplar.SetDoubleValue().
func (ms Exemplar) SetDoubleVal(v float64) {
ms.SetDoubleValue(v)
}

// Deprecated: [v0.61.0] use Exemplar.IntValue().
func (ms Exemplar) IntVal() int64 {
return ms.IntValue()
}

// Deprecated: [v0.61.0] use Exemplar.SetIntValue().
func (ms Exemplar) SetIntVal(v int64) {
ms.SetIntValue(v)
}
6 changes: 0 additions & 6 deletions pdata/pmetric/pmetricotlp/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ type GRPCClient interface {
Export(ctx context.Context, request Request, opts ...grpc.CallOption) (Response, error)
}

// Deprecated: [0.61.0] Use GRPCClient instead
type Client = GRPCClient

type metricsClient struct {
rawClient otlpcollectormetrics.MetricsServiceClient
}
Expand All @@ -148,9 +145,6 @@ type GRPCServer interface {
Export(context.Context, Request) (Response, error)
}

// Deprecated: [0.61.0] Use GRPCServer instead
type Server = GRPCServer

// RegisterServer registers the GRPCServer to the grpc.Server.
func RegisterServer(s *grpc.Server, srv GRPCServer) {
otlpcollectormetrics.RegisterMetricsServiceServer(s, &rawMetricsServer{srv: srv})
Expand Down
6 changes: 0 additions & 6 deletions pdata/ptrace/ptraceotlp/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ type GRPCClient interface {
Export(ctx context.Context, request Request, opts ...grpc.CallOption) (Response, error)
}

// Deprecated: [0.61.0] Use GRPCClient instead
type Client = GRPCClient

type tracesClient struct {
rawClient otlpcollectortrace.TraceServiceClient
}
Expand All @@ -153,9 +150,6 @@ type GRPCServer interface {
Export(context.Context, Request) (Response, error)
}

// Deprecated: [0.61.0] Use GRPCServer instead
type Server = GRPCServer

// RegisterServer registers the GRPCServer to the grpc.Server.
func RegisterServer(s *grpc.Server, srv GRPCServer) {
otlpcollectortrace.RegisterTraceServiceServer(s, &rawTracesServer{srv: srv})
Expand Down
22 changes: 0 additions & 22 deletions pdata/ptrace/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"go.opentelemetry.io/collector/pdata/internal"
otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1"
otlptrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1"
"go.opentelemetry.io/collector/pdata/pcommon"
)

// Traces is the top-level struct that is propagated through the traces pipeline.
Expand Down Expand Up @@ -50,17 +49,6 @@ func (ms Traces) CopyTo(dest Traces) {
ms.ResourceSpans().CopyTo(dest.ResourceSpans())
}

// Clone returns a copy of Traces.
// Deprecated: [0.61.0] Replace with:
//
// newTraces := NewTraces()
// ms.CopyTo(newTraces)
func (ms Traces) Clone() Traces {
cloneTd := NewTraces()
ms.ResourceSpans().CopyTo(cloneTd.ResourceSpans())
return cloneTd
}

// SpanCount calculates the total number of spans.
func (ms Traces) SpanCount() int {
spanCount := 0
Expand All @@ -80,16 +68,6 @@ func (ms Traces) ResourceSpans() ResourceSpansSlice {
return newResourceSpansSlice(&ms.getOrig().ResourceSpans)
}

// Deprecated: [v0.61.0] use TraceState().AsRaw().
func (ms Span) TraceStateStruct() pcommon.TraceState {
return ms.TraceState()
}

// Deprecated: [v0.61.0] use TraceState().AsRaw().
func (ms SpanLink) TraceStateStruct() pcommon.TraceState {
return ms.TraceState()
}

// SpanKind is the type of span. Can be used to specify additional relationships between spans
// in addition to a parent/child relationship.
type SpanKind int32
Expand Down
34 changes: 0 additions & 34 deletions service/featuregate/deprecated.go

This file was deleted.

0 comments on commit 130dd96

Please sign in to comment.