You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-18Lines changed: 29 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,35 @@ Exposes basic metrics for your repositories from the GitHub API, to a Prometheus
4
4
5
5
## Configuration
6
6
7
-
This exporter is setup to take input from environment variables. All variables are optional:
8
-
9
-
*`ORGS` If supplied, the exporter will enumerate all repositories for that organization. Expected in the format "org1, org2".
10
-
*`REPOS` If supplied, The repos you wish to monitor, expected in the format "user/repo1, user/repo2". Can be across different Github users/orgs.
11
-
*`USERS` If supplied, the exporter will enumerate all repositories for that users. Expected in
12
-
the format "user1, user2".
13
-
*`GITHUB_TOKEN` If supplied, enables the user to supply a github authentication token that allows the API to be queried more often. Optional, but recommended.
14
-
*`GITHUB_TOKEN_FILE` If supplied _instead of_`GITHUB_TOKEN`, enables the user to supply a path to a file containing a github authentication token that allows the API to be queried more often. Optional, but recommended.
15
-
*`GITHUB_APP` If true , authenticates ass GitHub app to the API.
16
-
*`GITHUB_APP_ID` The APP ID of the GitHub App.
17
-
*`GITHUB_APP_INSTALLATION_ID` The INSTALLATION ID of the GitHub App.
18
-
*`GITHUB_APP_KEY_PATH` The path to the github private key.
19
-
*`GITHUB_RATE_LIMIT` The RATE LIMIT that suppose to be for github app (default is 15,000). If the exporter sees the value is below this variable it generating new token for the app.
20
-
*`API_URL` Github API URL, shouldn't need to change this. Defaults to `https://api.github.com`
21
-
*`LISTEN_PORT` The port you wish to run the container on, the Dockerfile defaults this to `9171`
22
-
*`METRICS_PATH` the metrics URL path you wish to use, defaults to `/metrics`
23
-
*`LOG_LEVEL` The level of logging the exporter will run with, defaults to `debug`
24
-
7
+
This exporter is configured via environment variables. All variables are optional unless otherwise stated. Below is a list of supported configuration values:
When authenticating with the GitHub API, the exporter uses credentials in the following order of precedence:
30
+
31
+
1.**GitHub App credentials** (`GITHUB_APP=true` with `GITHUB_APP_ID`, `GITHUB_APP_INSTALLATION_ID`, and `GITHUB_APP_KEY_PATH`): If enabled, the exporter authenticates as a GitHub App and ignores any personal access token or token file.
32
+
2.**Token file** (`GITHUB_TOKEN_FILE`): If a token file is provided (and GitHub App is not enabled), the exporter reads the token from the specified file.
33
+
3.**Direct token** (`GITHUB_TOKEN`): If neither GitHub App nor token file is provided, the exporter uses the token supplied directly via the environment variable.
34
+
35
+
If none of these credentials are provided, the exporter will make unauthenticated requests, which are subject to very strict rate limits.
0 commit comments