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

internal/osinfo: setup for kernel info #2933

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

eliottness
Copy link
Contributor

What does this PR do?

This PR refactors the internal/osinfo to include kernel data and better OS info:

  • try to open /etc/os-release on all UNIX systems
  • Call to unix.Uname to access kernel Name, Release and Version
  • Map this data to telemetry as described as mandatory in the telemetry spec
  • Move all this to init functions because all of this is static data

Motivation

Fix reporting from telemetry and prepare for the new telemetry client revamp incoming.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@eliottness eliottness requested a review from a team as a code owner October 17, 2024 15:41
@eliottness eliottness marked this pull request as draft October 17, 2024 15:41
@pr-commenter
Copy link

pr-commenter bot commented Oct 17, 2024

Benchmarks

Benchmark execution time: 2024-10-24 08:46:10

Comparing candidate commit 4c13d60 in PR branch eliott.bouhana/better-osinfo with baseline commit 2edf445 in branch main.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 0 unstable metrics.

scenario:BenchmarkInjectW3C-24

  • 🟩 execution_time [-174.820ns; -130.180ns] or [-4.037%; -3.007%]

@eliottness eliottness marked this pull request as ready for review October 21, 2024 12:27
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024 Datadog, Inc.

//go:build unix
Copy link
Contributor Author

@eliottness eliottness Oct 21, 2024

Choose a reason for hiding this comment

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

I have to add the go:build line there because of golang/go#20322 so I decided to add go:build to all the files that need it in this package

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
@eliottness eliottness enabled auto-merge (squash) October 28, 2024 16:09
@eliottness eliottness merged commit 4b56ee5 into main Oct 28, 2024
149 of 150 checks passed
@eliottness eliottness deleted the eliott.bouhana/better-osinfo branch October 28, 2024 16:16
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.

2 participants