diff --git a/Makefile b/Makefile index bb5b1e7..721e20f 100644 --- a/Makefile +++ b/Makefile @@ -112,7 +112,9 @@ DEB: scripts/cc-metric-collector.deb.control $(APP) #@mkdir --parents --verbose $$DEBIANDIR @CONTROLFILE="$${BASEDIR}/scripts/cc-metric-collector.deb.control" @COMMITISH="HEAD" + @git describe --tags --abbrev=0 $${COMMITISH} @VERS=$$(git describe --tags --abbrev=0 $${COMMITISH}) + @if [ -z "$$VERS" ]; then VERS=${GITHUB_REF_NAME}; fi @VERS=$${VERS#v} @VERS=$$(echo $$VERS | sed -e s+'-'+'_'+g) @ARCH=$$(uname -m) @@ -121,8 +123,14 @@ DEB: scripts/cc-metric-collector.deb.control $(APP) @SIZE_BYTES=$$(du -bcs --exclude=.dpkgbuild "$$WORKSPACE"/ | awk '{print $$1}' | head -1 | sed -e 's/^0\+//') @SIZE="$$(awk -v size="$$SIZE_BYTES" 'BEGIN {print (size/1024)+1}' | awk '{print int($$0)}')" #@sed -e s+"{VERSION}"+"$$VERS"+g -e s+"{INSTALLED_SIZE}"+"$$SIZE"+g -e s+"{ARCH}"+"$$ARCH"+g $$CONTROLFILE > $${DEBIANDIR}/control + @echo "Version: $$VERS" + @echo "Size: $$SIZE" + @echo "Arch: $$ARCH" @sed -e s+"{VERSION}"+"$$VERS"+g -e s+"{INSTALLED_SIZE}"+"$$SIZE"+g -e s+"{ARCH}"+"$$ARCH"+g $$CONTROLFILE > $${DEBIANBINDIR}/control @make PREFIX=$${WORKSPACE} install @DEB_FILE="cc-metric-collector_$${VERS}_$${ARCH}.deb" @dpkg-deb -b $${WORKSPACE} "$$DEB_FILE" + @if [ "$${GITHUB_ACTIONS}" = "true" ]; then + @ echo "::set-output name=DEB::$${DEB_FILE}" + @fi @rm -r "$${WORKSPACE}" diff --git a/collectors/ipmiMetric.go b/collectors/ipmiMetric.go index 69e03ee..01a2603 100644 --- a/collectors/ipmiMetric.go +++ b/collectors/ipmiMetric.go @@ -13,7 +13,6 @@ import ( "strings" "time" - cclog "github.com/ClusterCockpit/cc-metric-collector/pkg/ccLogger" lp "github.com/ClusterCockpit/cc-metric-collector/pkg/ccMetric" ) diff --git a/go.mod b/go.mod index 54d512a..9a9bf4b 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( golang.org/x/sys v0.3.0 ) + require ( github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/sinks/httpSink.md b/sinks/httpSink.md index 23203a2..7251ff2 100644 --- a/sinks/httpSink.md +++ b/sinks/httpSink.md @@ -8,7 +8,9 @@ The `http` sink uses POST requests to a HTTP server to submit the metrics in the { "": { "type": "http", - "meta_as_tags" : true, + "meta_as_tags" : [ + "meta-key" + ], "url" : "https://my-monitoring.example.com:1234/api/write", "jwt" : "blabla.blabla.blabla", "timeout": "5s", @@ -20,7 +22,7 @@ The `http` sink uses POST requests to a HTTP server to submit the metrics in the ``` - `type`: makes the sink an `http` sink -- `meta_as_tags`: print all meta information as tags in the output (optional) +- `meta_as_tags`: Move specific meta information to the tags in the output (optional) - `url`: The full URL of the endpoint - `jwt`: JSON web tokens for authentification (Using the *Bearer* scheme) - `timeout`: General timeout for the HTTP client (default '5s')