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

[BUG] broken compatibility because of opentelemetry-mapping-go, can't build my project #33674

Open
rosti-il opened this issue Feb 3, 2025 · 3 comments
Labels

Comments

@rosti-il
Copy link

rosti-il commented Feb 3, 2025

github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes version v0.25.0 broke compatibility with its previous version v0.24.0 and datadog-agent depends on it. After upgrading dependencies by go get -u ./... command in my project that uses datadog-agent it can't be built.

# github.com/DataDog/datadog-agent/pkg/trace/traceutil
../../../go/pkg/mod/github.com/!data!dog/datadog-agent/pkg/[email protected]/traceutil/otel_util.go:413:46: not enough arguments in call to tr.ResourceToSource
        have (context.Context, pcommon.Resource, "go.opentelemetry.io/otel/attribute".Set)
        want (context.Context, pcommon.Resource, "go.opentelemetry.io/otel/attribute".Set, "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes".HostFromAttributesHandler)
Collapse

both the opentelemetry-mapping-go and datadog-agent are projects of DataDog.

Please do:

  • Fix the datadog-agent.
  • Don't release incompatible versions of dependencies without switching to a newer major release number (for example v0.24.0 ==> v1.0.0 instead v0.24.0 ==> v0.25.0), so go get -u ./... will not bring them.

Temporary workaround is downgrading opentelemetry-mapping-go by running:
go get github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/[email protected]

@github-actions github-actions bot added the team/opentelemetry OpenTelemetry team label Feb 3, 2025
@ogaca-dd
Copy link
Contributor

ogaca-dd commented Feb 3, 2025

Hi,
Sorry for the trouble.
This PR was merged. Rebase from the latest main branch should fix the issue.

@ericfialkowski
Copy link

ericfialkowski commented Feb 4, 2025

Is there a planned date to cut a new release with the fix?

@ogaca-dd
Copy link
Contributor

ogaca-dd commented Feb 19, 2025

According to the Go modules reference, version v0 does not guarantee compatibility between releases:

A version is considered unstable if its major version is 0 or it has a pre-release suffix. Unstable versions are not subject to compatibility requirements. For example, v0.2.0 may not be compatible with v0.1.0, and v1.5.0-beta may not be compatible with v1.5.0.

This can be a little surprising at first.

Since the API of our functions is not yet stable, our modules are still released with v0. This means that our modules may not be easily used from other repositories, as breaking changes can occur between minor versions.

A workaround is to use the replace directive in your go.mod file for both github.com/DataDog/datadog-agent and opentelemetry-mapping-go:

replace github.com/DataDog/datadog-agent/comp/core/config => github.com/DataDog/datadog-agent/comp/core/config v0.62.3

This ensures that even if you run go get -u ./..., the specified version (v0.62.3) will be used. Note that replace only affects builds of your own module locally and does not propagate when another module depends on it. If your module is used as a dependency by another project, the replace directive in your go.mod will not be considered, meaning that the upstream module will still fetch the default version specified in its go.mod file unless it also explicitly includes a replace directive.

Please let me know if it help.

The next release of the Agent, version 7.64, is currently in its final development phase. We will stop adding new features to this release by the end of this week, after which we will focus on extensive testing and issue resolution. This stabilization phase typically takes around four weeks. Once testing is complete and all critical issues are addressed, the final version will be released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants