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

prometheus-statsd-exporter: add new package #7635

Merged
merged 1 commit into from
Dec 13, 2018

Conversation

dhewg
Copy link
Contributor

@dhewg dhewg commented Dec 11, 2018

statsd_exporter receives StatsD-style metrics and exports them as Prometheus
metrics.

Signed-off-by: Andre Heider [email protected]

Maintainer: @aparcar (for related prometheus)
Compile tested: arm/sunxi, Cubieboard 2, master
Run tested: arm/sunxi, Cubieboard 2, master, asterisk<->prometheus interop

Description:
Not ready yet for merging! While the package is built, there's an issue with make clean because all the files in $BUILD_DIR/.go_work/build/pkg/mod are not writable, so they cannot be removed. I'm not sure what the root cause is, anyone got an idea?

Apart from that, the resulting package works fine, and I'm using it with the openwrt asterisk packages. Asterisk doesn't support prometheus metrics directly, but has various statsd modules. Using those to push to this exporter, I can scrape from prometheus successfully. Asterisk statsd->prometheus label mapping are included in the yml config file.

@dhewg
Copy link
Contributor Author

dhewg commented Dec 11, 2018

See buildpr log for the make clean issue

@aparcar
Copy link
Member

aparcar commented Dec 11, 2018

@dhewg thanks for your work! Did you check if the clean works locally? Maybe Go puts some special access flags so no other programs/user interfere while it's compiling stuff? Maybe chmod -R +w $HOME/.go_work/ (odd I guess) fixes the issue?

@dhewg
Copy link
Contributor Author

dhewg commented Dec 11, 2018

@aparcar Yeah, I get the same permission problem locally. chmod won't work either, as the current user doesn't have permissions for that either ;)
I grep'ed around, but couldn't find any related umask or chmod commands responsible for this issue. But I've never done anything with go, so maybe I just did something stupid? I compared this package to others using go though, and they look similar, so dunno why this happens here...

@aparcar
Copy link
Member

aparcar commented Dec 11, 2018

Sorry I'm no go pro neither, I think the build system doesn't swap users while building...

@dhewg
Copy link
Contributor Author

dhewg commented Dec 11, 2018

Looking at the golang history, maybe @jefferyto knows?

@jefferyto
Copy link
Member

jefferyto commented Dec 11, 2018

I think the issue is golang/go#27455 - I'll need to add a call to go clean -modcache or fix the permissions somewhere 😒

@dhewg
Copy link
Contributor Author

dhewg commented Dec 11, 2018

That indeed sounds like the issue. "Working as intented", I don't even...
On the good side you now have a test candidate for 'proper' modcache cleaning ;)

@thess
Copy link
Member

thess commented Dec 11, 2018

Looking at the build output - it seems that our SDK's have CONFIG_AUTOREMOVE=y which is the trigger to your errors. With this disabled, the build would be fine. You do not need the CI environment to re-produce this problem.

@dhewg
Copy link
Contributor Author

dhewg commented Dec 11, 2018

Then that's why it fails for me locally (I have it set because I build on a ramdisk)

jefferyto added a commit to jefferyto/openwrt-packages that referenced this pull request Dec 11, 2018
go 1.11 added modules, which are cached locally. The go developers have
decided to make this cache read-only (golang/go#27455), which causes
problems with package clean / autoremove (openwrt#7635).

This adds a call to clear this cache right after building, as currently
there is no easy way to hook into autoremove (it may be possible to hook
into package clean).

This also adds whitespace (blank lines) to certain places in make
output, to aid debugging.

Signed-off-by: Jeffery To <[email protected]>
statsd_exporter receives StatsD-style metrics and exports them as Prometheus
metrics.

Signed-off-by: Andre Heider <[email protected]>
@dhewg dhewg force-pushed the pull/prometheus-statsd-exporter branch from 84c7e55 to b57f6b1 Compare December 12, 2018 06:42
@dhewg
Copy link
Contributor Author

dhewg commented Dec 12, 2018

Thanks for the quick fix! Rebased to force a rebuild, and it builds fine now ;)

@thess thess merged commit 1cba36a into openwrt:master Dec 13, 2018
@dhewg dhewg deleted the pull/prometheus-statsd-exporter branch December 14, 2018 05:34
thiagoricciardi pushed a commit to thiagoricciardi/packages that referenced this pull request Apr 3, 2019
go 1.11 added modules, which are cached locally. The go developers have
decided to make this cache read-only (golang/go#27455), which causes
problems with package clean / autoremove (openwrt#7635).

This adds a call to clear this cache right after building, as currently
there is no easy way to hook into autoremove (it may be possible to hook
into package clean).

This also adds whitespace (blank lines) to certain places in make
output, to aid debugging.

Signed-off-by: Jeffery To <[email protected]>
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.

4 participants