Closed fearful-symmetry closed 1 year ago
This pull request does not have a backport label. If this is a bug or security fix, could you label this PR @fearful-symmetry? 🙏. For such, you'll need to label your PR with:
To fixup this pull request, you need to add the backport labels for the needed branches, such as:
backport-v8./d.0
is the label to automatically backport to the 8./d
branch. /d
is the digitthe below badges are clickable and redirect to their specific view in the CI or DOCS
#### Build stats * Start Time: 2023-03-30T23:39:17.608+0000 * Duration: 19 min 45 sec
No test was executed to be analysed.
To re-run your PR in the CI, just comment with: - `/test` : Re-trigger the build.
Whoop, go linter doesn't like my go.mod replace line for https://github.com/elastic/elastic-agent-system-metrics/pull/80
Okay, just noticed a major problem with this while testing. The shipper is built on the assumption that any of its sub-components can be arbitrarily stopped and start, but the monitoring code used is mostly global, and will usually panic if you try to re-register or update something. Will start poking at a fix.
@leehinman you've run into this before on windows, right?
error creating API for registry reporter: parse "unix://C:\\Users\\jenkins\\AppData\\Local\\Temp\\mon1680036856.sock": invalid port ":\\Users\\jenkins\\AppData\\Local\\Temp\\mon1680036856.sock" after host
@leehinman you've run into this before on windows, right?
error creating API for registry reporter: parse "unix://C:\\Users\\jenkins\\AppData\\Local\\Temp\\mon1680036856.sock": invalid port ":\\Users\\jenkins\\AppData\\Local\\Temp\\mon1680036856.sock" after host
yeah, that looks a lot like what was happening with the grpc socket. On windows you need to use a named pipe.
"github.com/elastic/elastic-agent-libs/api/npipe
Alright, lets see what this does...
/test
Kinda baffled by the CI error:
[2023-03-29T00:14:27.444Z] ⨯ build failed after 84.06s error=failed to build for darwin_arm64: exit status 2: # github.com/elastic/elastic-agent-shipper/monitoring
[2023-03-29T00:14:27.444Z] monitoring/queuemon.go:216:9: undefined: report.SetupInfoUserMetrics
tried building locally on an ARM macbook, works fine.
Alright, can reproduce it with mage package
on a Macbook:
⨯ build failed after 19.73s error=failed to build for darwin_arm64: exit status 2: # github.com/elastic/elastic-agent-shipper/monitoring
monitoring/queuemon.go:216:9: undefined: report.SetupInfoUserMetrics
My first thought is that it was a cgo issue, but if that was the case, it would have failed on SetupMetrics
first, and not SetupInfoUserMetrics
.
@fearful-symmetry Shot in the dark, but could the build tags here have something to do with the error?
My first thought is that it was a cgo issue, but if that was the case, it would have failed on
SetupMetrics
first, and notSetupInfoUserMetrics
.
Not necessarily, since SetupMetrics
is defined twice, once in setup.go
and once in setup_other.go
, each file having complementary build tags. However, SetupInfoUserMetrics
is only defined in setup.go
.
Not necessarily, since SetupMetrics is defined twice, once in setup.go and once in setup_other.go, each file having complementary build tags.
@ycombinator argh, I didn't even notice there was a setup_other.go
Put in https://github.com/elastic/elastic-agent-system-metrics/pull/82 since that code doesn't require cgo.
However, that raises another question, should mage package
have cgo
disabled?
/test
What does this PR do?
Part of fix for https://github.com/elastic/elastic-agent-shipper/issues/267
This accomplishes a few things:
/shipper
and/stats
and/state
endpoint to http monitoringhttp.expvar
that re-exports expvar metrics.golangci.yml
lint file to match that in beats, since we're running into issues with cgo again.Note that this currently won't work with agent, as changes on the agent side are needed to make agent scrape metrics from the shipper.
Why is it important?
Needed to integrate the shipper with other agent monitoring
Checklist
CHANGELOG.md
orCHANGELOG-developer.md
.Author's Checklist
How to test this PR locally
http.enabled: true
/
,/shipper
,/stats
and/state
endpoints, make sure they're reporting valid data.