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

[exporter/datadog] Move Sanitize functionality into Validate and Unmarshal #8829

Merged

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Mar 24, 2022

Description:

  • Move functionality currently on Sanitize to Validate and Unmarshal. In particular:
    • Move API key space trimming into Unmarshal
    • Move empty API key validation and metadata settings invalid combinations to Validate
    • Move determining metrics and traces endpoints to Unmarshal
    • Move default settings logic into the default config function
    • Refactor tests to test via Validate and Unmarshal.
  • Deprecate Sanitize method. Its only use now is logging warnings, and it will be removed once we move Config to the main package.

This has a minor change on the Go API: right now if one passes a Config struct with an empty metrics or traces endpoint, the default one would have been populated by Sanitize. After this change, this results in an error. This does not affect end-users of the binary in any way. We can fix this on the future, depending on how the Go API usage evolves, since going from an error to not-an-error is not a breaking change.

Link to tracking Issue: relates to #8373

Testing: Added more unit tests for validate and unmarshaling

Documentation: Updated Sanitize docs

@mx-psi mx-psi marked this pull request as ready for review March 24, 2022 16:33
@mx-psi mx-psi requested review from a team and anuraaga March 24, 2022 16:33
@mx-psi

This comment was marked as outdated.

@mx-psi mx-psi marked this pull request as draft March 25, 2022 08:20
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Apr 16, 2022
@mx-psi mx-psi removed the Stale label Apr 20, 2022
@mx-psi mx-psi force-pushed the mx-psi/sanitize-validate-unmarshal branch from 658ea76 to 4cff6bf Compare April 27, 2022 11:19
@mx-psi mx-psi marked this pull request as ready for review April 27, 2022 11:25
@bogdandrutu
Copy link
Member

@mx-psi ready for review?

@mx-psi
Copy link
Member Author

mx-psi commented May 4, 2022

@mx-psi ready for review?

Yes! I shared this internally so someone from Datadog should review it at some point, but reviews are generally welcome :)

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label May 19, 2022
@mx-psi mx-psi removed the Stale label May 23, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2022

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 7, 2022
@mx-psi mx-psi removed the Stale label Jun 7, 2022
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, aside from conflicts that need resolution.

@mx-psi, are you still waiting on internal review?

@mx-psi
Copy link
Member Author

mx-psi commented Jun 10, 2022

@djaglowski We have the CODEOWNER review now and the conflicts have been solved :) Could you have a final look?

@djaglowski djaglowski merged commit cc35e00 into open-telemetry:main Jun 10, 2022
kentquirk pushed a commit to McSick/opentelemetry-collector-contrib that referenced this pull request Jun 14, 2022
…`Unmarshal` (open-telemetry#8829)

* [exporter/datadog] Move validation to `Validate`

* [exporter/datadog] Move some unmarshaling steps to `Unmarshal`; deprecate `Sanitize`

* [exporter/datadog] Move endpoint override logic to `Unmarshal`

* [exporter/datadog] Remove unnecessary calls to `Sanitize`

* Fix changelog

* Update deprecation version
@mx-psi mx-psi deleted the mx-psi/sanitize-validate-unmarshal branch June 28, 2022 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants