curl -L -o lagoon-solr-metrics https://github.com/salsadigitalauorg/lagoon-solr-metrics/releases/latest/download/lagoon-solr-metrics-$(uname -s)-$(uname -m)
chmod +x lagoon-solr-metrics
mv lagoon-solr-metrics /usr/local/bin/lagoon-solr-metrics
Run directly from a docker image:
docker run --rm ghcr.io/salsadigitalauorg/lagoon-solr-metrics:latest lagoon-solr-metrics
Or add to your docker image:
COPY --from=ghcr.io/salsadigitalauorg/lagoon-solr-metrics:latest /usr/local/bin/lagoon-solr-metrics /usr/local/bin/lagoon-solr-metrics
The application needs a few environmental variables set so that it can know where to collect the metrics from and where to push it.
SOLR_HOST=solr
SOLR_PORT=8983
SOLR_CORE=drupal
LAGOON_INSIGHTS_ENDPOINT="http://lagoon-remote-insights-remote.lagoon.svc"
The above are the defaults that the application will use, but you can override them as needed in your runtime environment.
git clone git@github.com:salsadigitalauorg/lagoon-solr-metrics.git && cd lagoon-solr-metrics
go generate ./...
go build -ldflags="-s -w" -o build/lagoon-solr-metrics .
go run . -h
go generate ./...
go test -v ./... -coverprofile=build/coverage.out
View coverage results:
go tool cover -html=build/coverage.out