Skip to content

Breaking change in v5.7.0 #332

Description

@eliottness

Starting with the new v5.7.0 version we started see failures because the prototype of the Count, Gauge and multiple other methods on statsd.NoOpClientDirect and stats.DirectClient were modified in #327 to add a variadic parameter.

This is a problem for users using dd-trace-go because they cannot upgrade their dependencies using go get -u anymore without causing the following error:

# github.com/DataDog/dd-trace-go/v2/internal
Error: internal/statsd.go:35:10: cannot use &statsd.NoOpClientDirect{} (value of type *statsd.NoOpClientDirect) as StatsdClient value in return statement: *statsd.NoOpClientDirect does not implement StatsdClient (wrong type for method Count)
		have Count(string, int64, []string, float64, ...statsd.Parameter) error
		want Count(string, int64, []string, float64) error
Error: internal/statsd.go:37:9: cannot use client (variable of type *statsd.ClientDirect) as StatsdClient value in return statement: *statsd.ClientDirect does not implement StatsdClient (wrong type for method Count)
		have Count(string, int64, []string, float64, ...statsd.Parameter) error
		want Count(string, int64, []string, float64) error
# github.com/DataDog/datadog-agent/pkg/obfuscate
Error: ../../../go/pkg/mod/github.com/!data!dog/datadog-agent/pkg/[email protected]/obfuscate.go:344:16: cannot use &statsd.NoOpClient{} (value of type *statsd.NoOpClient) as StatsClient value in assignment: *statsd.NoOpClient does not implement StatsClient (wrong type for method Gauge)
		have Gauge(string, float64, []string, float64, ...statsd.Parameter) error
		want Gauge(string, float64, []string, float64) error
Error: Process completed with exit code 1.

More generally this creates a coupling between dd-trace-go and datadog-go because users of dd-trace-go cannot use the latest version of datadog-go and vise-versa: users of datadog-go cannot use an older version of dd-trace-go.

I understood why it went under the radar because variadic parameters can be omitted when used directly but this is not the case for interfaces which we use in this case. The Go toolchain expects packages to respect semver properly and thus not introduce breaking changes without doing a major release like done here.

Side note: The datadog-agent also seems impacted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions