-h, --help Show context-sensitive help.
-o, --organization=STRING Name of the Organization to scrape from ($TF_ORGANIZATION).
-t, --api-token=STRING User token for autheticating with the API ($TF_API_TOKEN).
--api-token-file=/path/to/file File containing user token for autheticating with the API.
--api-address=https://app.terraform.io/ Terraform API address to scrape metrics from.
--api-insecure-skip-verify Accept any certificate presented by the API.
--listen-address="0.0.0.0:9100" Address to listen on for web interface and telemetry.
--log-level="info" Only log messages with the given severity or above. One of: [debug,info,warn,error]
--log-format="logfmt" Output format of log messages. One of: [logfmt,json]
Contributing
Dev environment
Create a .env file with your token:
TF_API_TOKEN=<Your.atlasv1.Token>
TF_ORGANIZATION=<YourOrg>
TF_API_ADDRESS=<YourApiAddress - Optional: Only required for Terraform enterprise.>
Run the Exporter, in one of two modes:
Standalone exporter: docker-compose run --rm --service-ports --entrypoint sh exporter
Run code: go run main.go
View metricts: curl localhost:9100/metrics
Full Prometheus stack: docker-compose up
Open Grafana: http://localhost:3000/
Clean up: docker-compode down
Go tests
Apply style guides: go fmt ./...
Static analysis: go vet ./...
Run tests: go test -v ./... -coverprofile cover.out
Examine code coverage: go tool cover -func=cover.out