Skip to content

pkg/trace: stop using info.Version#12849

Merged
ajgajg1134 merged 6 commits into
mainfrom
andrew.glaude/VersionFixes
Aug 2, 2022
Merged

pkg/trace: stop using info.Version#12849
ajgajg1134 merged 6 commits into
mainfrom
andrew.glaude/VersionFixes

Conversation

@ajgajg1134
Copy link
Copy Markdown
Contributor

@ajgajg1134 ajgajg1134 commented Jul 22, 2022

What does this PR do?

This PR unifies the version info used by the trace-agent into a single source of truth: The incoming config. This config is set in cmd/trace-agent.

Motivation

This greatly simplifies the disparate places where version info was coming from for the trace-agent.

Additional Notes

Possible Drawbacks / Trade-offs

This change removes a tiny bit of detail from the trace-agent /info endpoint (the build_date). This is a breaking change for that API which could cause issues for any tracers or code relying on the exact. I did a search through the various tracers and did not find any users of this data, I also asked in slack and it doesn't seem anyone is using it. However, it might be better to instead of dropping the field, just put a static date to absolutely ensure no breakage for users (Please leave thoughts about this as a comment!)

Describe how to test/QA your changes

Reviewer's Checklist

I'm not very familiar with the build system (which seems to be across a number of different things here both in ruby and python?) So I'm not confident at all in my changes to the ruby files. There's also the make file here that I believe can be changed but I'm unsure if it's just dropping version info entirely?

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the config template has been updated.

@ajgajg1134 ajgajg1134 force-pushed the andrew.glaude/VersionFixes branch from d15f68e to 5b7c0a4 Compare July 22, 2022 18:01
@ajgajg1134 ajgajg1134 added this to the 7.39.0 milestone Jul 25, 2022
@ajgajg1134 ajgajg1134 added the team/agent-apm trace-agent label Jul 25, 2022
@ajgajg1134 ajgajg1134 marked this pull request as ready for review July 25, 2022 20:25
@ajgajg1134 ajgajg1134 requested review from a team as code owners July 25, 2022 20:25
@ajgajg1134 ajgajg1134 requested a review from a team July 25, 2022 20:25
@ajgajg1134 ajgajg1134 requested a review from a team as a code owner July 25, 2022 20:25
Copy link
Copy Markdown
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Very nice work Andrew 👏🏻 🎉

This was very much needed! 🙏🏻

Comment thread cmd/trace-agent/run.go Outdated
Comment thread cmd/trace-agent/run.go Outdated
block do
# defer compilation step in a block to allow getting the project's build version, which is populated
# only once the software that the project takes its version from (i.e. `datadog-agent`) has finished building
env['TRACE_AGENT_VERSION'] = project.build_version.gsub(/[^0-9\.]/, '') # used by gorake.rb in the trace-agent, only keep digits and dots
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍🏻

Comment thread omnibus/config/software/datadog-iot-agent.rb
Comment thread pkg/trace/api/info.go Outdated
Comment thread pkg/trace/stats/client_stats_aggregator.go Outdated
Comment thread pkg/trace/stats/concentrator.go Outdated
Comment thread releasenotes/notes/consistent-agent-version-c701a790d52bdc6c.yaml Outdated
Comment thread releasenotes/notes/consistent-agent-version-c701a790d52bdc6c.yaml Outdated
Comment thread pkg/trace/writer/sender.go
Copy link
Copy Markdown
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Really nice Andrew! Thanks a bunch for doing this! This will allow us now to correctly monitor versions of incoming data!

Comment thread cmd/trace-agent/run.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/agent-apm trace-agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants