Skip to content

Commit

Permalink
[OTEL-1738] Deprecate APMStatsConsumer (#320)
Browse files Browse the repository at this point in the history
* [OTEL-1738] Deprecate APMStatsConsumer

* Add PR number

* lint

* Update changelog
  • Loading branch information
songy23 committed Apr 22, 2024
1 parent db41deb commit aafbbc6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
16 changes: 16 additions & 0 deletions .chloggen/deprecate-apm-stats-consumer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component (e.g. pkg/quantile)
component: pkg/otlp/metrics

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate the APMStatsConsumer interface and remove it from the Consumer interface.

# The PR related to this change
issues: [320]

# (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: "The only breaking change is users can no longer do consumer.(*Consumer).ConsumeAPMStats(), instead they can do consumer.(*APMStatsConsumer).ConsumeAPMStats(). Everything else is backwards-compatible."
2 changes: 1 addition & 1 deletion pkg/otlp/metrics/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ type SketchConsumer interface {
type Consumer interface {
TimeSeriesConsumer
SketchConsumer
APMStatsConsumer
}

// Deprecated: use WithStatsOut instead
// APMStatsConsumer implementations are able to consume APM Stats generated by
// a Translator.
type APMStatsConsumer interface {
Expand Down
5 changes: 0 additions & 5 deletions pkg/otlp/metrics/metrics_translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1922,11 +1922,6 @@ var _ SketchConsumer = (*mockFullConsumer)(nil)
type mockFullConsumer struct {
mockTimeSeriesConsumer
sketches []sketch
apmstats []*pb.ClientStatsPayload
}

func (c *mockFullConsumer) ConsumeAPMStats(p *pb.ClientStatsPayload) {
c.apmstats = append(c.apmstats, p)
}

func (c *mockFullConsumer) ConsumeSketch(_ context.Context, dimensions *Dimensions, ts uint64, sk *quantile.Sketch) {
Expand Down
7 changes: 0 additions & 7 deletions pkg/otlp/metrics/sketches_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"go.opentelemetry.io/collector/pdata/pmetric"
"go.uber.org/zap"

pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace"
"github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest"
"github.com/DataDog/opentelemetry-mapping-go/pkg/quantile"
)
Expand All @@ -40,12 +39,6 @@ type sketchConsumer struct {
sk *quantile.Sketch
}

func (c *sketchConsumer) ConsumeAPMStats(_ *pb.ClientStatsPayload) {
// not used for this consumer, but do warn the user if they
// try to use it
panic("(*sketchConsumer).ConsumeAPMStats not implemented")
}

// ConsumeSketch implements the translator.Consumer interface.
func (c *sketchConsumer) ConsumeSketch(
_ context.Context,
Expand Down
7 changes: 0 additions & 7 deletions pkg/otlp/metrics/testhelper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"strings"
"testing"

pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace"
"github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes"
"github.com/DataDog/opentelemetry-mapping-go/pkg/quantile"
"github.com/DataDog/opentelemetry-mapping-go/pkg/quantile/summary"
Expand Down Expand Up @@ -132,12 +131,6 @@ type testConsumer struct {
testMetrics TestMetrics
}

func (t *testConsumer) ConsumeAPMStats(_ *pb.ClientStatsPayload) {
// not used for this consumer, but do warn the user if they
// try to use it
panic("(*testConsumer).ConsumeAPMStats not implemented")
}

func (t *testConsumer) ConsumeTimeSeries(
_ context.Context,
dimensions *Dimensions,
Expand Down

0 comments on commit aafbbc6

Please sign in to comment.