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

Support macOS Metrics When CGO Is On #33393

Closed
EddieV2 opened this issue Jun 5, 2024 · 11 comments
Closed

Support macOS Metrics When CGO Is On #33393

EddieV2 opened this issue Jun 5, 2024 · 11 comments

Comments

@EddieV2
Copy link

EddieV2 commented Jun 5, 2024

Component(s)

receiver/hostmetrics

Describe the issue you're reporting

Currently, CPU and Disk scrapers are not supported on macOS due to the lack of CGO. I understand that this is due to complications with CGO, so I'm asking for these Mac metrics to be turned on while CGO is on.

@EddieV2 EddieV2 added the needs triage New item requiring triage label Jun 5, 2024
Copy link
Contributor

github-actions bot commented Jun 5, 2024

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@pureklkl
Copy link
Contributor

pureklkl commented Jul 24, 2024

open-telemetry/opentelemetry-collector-releases#374
cgo support was rejected before.

You can build your own collector that supports cgo by setting CGO_ENABLED=1.
https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/distributions/otelcol-contrib/.goreleaser.yaml#L49
It will support Mac cpu if it was compiled on Mac, otherwise you will need to set up a cross compile environment.

@atoulme
Copy link
Contributor

atoulme commented Jul 24, 2024

Because it was rejected before for linux doesn't preclude we don't consider it for Mac OS.

@pureklkl
Copy link
Contributor

There are 2 options to support it

  1. Build a cross compiling environment. It need some effort, example, there is a github action for cgo compilation.
  2. Use a mac runner which is 10x expensive than the linux runner ref, but it saves a lot of effort to maintain the cross compiling environment, example, telegraf

And we will still need mac runners for testing, example, iostat_darwin.

@atoulme
Copy link
Contributor

atoulme commented Jul 25, 2024

Sure, are you interested in working on this?

@pureklkl
Copy link
Contributor

Yes, please assign to me, I will try the mac runner first.

@atoulme
Copy link
Contributor

atoulme commented Jul 25, 2024

ok, if you'd like, you can request a mac runner in the same manner as this large runner was asked for: open-telemetry/community#2156

@pureklkl
Copy link
Contributor

@atoulme @EddieV2
Do we need to support the old Mac OS versions?
Currently, we can only guarantee that the binary will run on latest mac version (macos-14), because it was compiled and tested on that runner.
I have tested the macos-14 compiled binary on macos-12 and macos-13 and it is working, but if we want to support them officially, we would better to add tests for them.

@EddieV2
Copy link
Author

EddieV2 commented Aug 14, 2024

@atoulme @EddieV2
Do we need to support the old Mac OS versions?
Currently, we can only guarantee that the binary will run on latest mac version (macos-14), because it was compiled and tested on that runner.
I have tested the macos-14 compiled binary on macos-12 and macos-13 and it is working, but if we want to support them officially, we would better to add tests for them.

Hi @pureklkl, we would want to cover 13, 14, and 15 considering that release will be soon as well and we're preparing for that. 12 would be nice, but isn't much of a concern for us considering 15 being released soon.

MovieStoreGuy added a commit that referenced this issue Oct 10, 2024
**Description:** <Describe what has changed.>
In order to add CGO support, add compatibility test for old macos
versions.
Due macos-12 and macos-13 are using amd64 instead of arm64, cross
compiling is used.

**Link to tracking Issue:** <Issue number if applicable>
#33393 

**Testing:** <Describe what testing was performed and which tests were
added.>
Added tests for hostmetrics receiver for macos-12 and macos-13

**Documentation:** <Describe the documentation added.>

---------

Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Oct 14, 2024
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2024
sbylica-splunk pushed a commit to sbylica-splunk/opentelemetry-collector-contrib that referenced this issue Dec 17, 2024
**Description:** <Describe what has changed.>
In order to add CGO support, add compatibility test for old macos
versions.
Due macos-12 and macos-13 are using amd64 instead of arm64, cross
compiling is used.

**Link to tracking Issue:** <Issue number if applicable>
open-telemetry#33393 

**Testing:** <Describe what testing was performed and which tests were
added.>
Added tests for hostmetrics receiver for macos-12 and macos-13

**Documentation:** <Describe the documentation added.>

---------

Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants