Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OTEL-1738] Deprecate APMStatsConsumer #320

Merged
merged 4 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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: deprecation
songy23 marked this conversation as resolved.
Show resolved Hide resolved

# 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:
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