|
11 | 11 |
|
12 | 12 | ## Usage |
13 | 13 |
|
| 14 | +``` |
| 15 | +$ make |
| 16 | +$ ./exporter --sendgrid.api-key='secret' --web.listen-address=':9154' --web.disable-exporter-metrics |
| 17 | +``` |
| 18 | + |
| 19 | +``` |
| 20 | +$ curl localhost:9154/-/healthy |
| 21 | +$ curl localhost:9154/metrics |
| 22 | +``` |
| 23 | + |
| 24 | +``` |
| 25 | +$ ./exporter -h |
| 26 | +usage: exporter [<flags>] |
| 27 | +
|
| 28 | +Flags: |
| 29 | + -h, --help Show context-sensitive help (also try --help-long and --help-man). |
| 30 | + --web.listen-address=":9154" |
| 31 | + Address to listen on for web interface and telemetry. |
| 32 | + --web.disable-exporter-metrics |
| 33 | + Exclude metrics about the exporter itself (promhttp_*, process_*, go_*). |
| 34 | + --sendgrid.username="" Set SendGrid username |
| 35 | + --sendgrid.api-key="secret" |
| 36 | + Set SendGrid API key |
| 37 | + --log.level=info Only log messages with the given severity or above. One of: [debug, info, warn, error] |
| 38 | + --log.format=logfmt Output format of log messages. One of: [logfmt, json] |
| 39 | + --version Show application version. |
| 40 | +``` |
| 41 | + |
| 42 | +## Endpoints |
| 43 | + |
| 44 | +Name | Description |
| 45 | +---------|------------- |
| 46 | +`/metrics` | get metrics |
| 47 | +`/-/healthy` | for health check |
| 48 | + |
| 49 | +## Metrics |
| 50 | + |
| 51 | +Name | Description |
| 52 | +---------|------------ |
| 53 | +blocks | dummy |
| 54 | +bounce_drops | dummy |
| 55 | +bounces | dummy |
| 56 | +deferred | dummy |
| 57 | +delivered | dummy |
| 58 | +invalid_emails | dummy |
| 59 | +processed | dummy |
| 60 | +requests | dummy |
| 61 | +spam_report_drops | dummy |
| 62 | +spam_reports | dummy |
| 63 | +unique_clicks | dummy |
| 64 | +unique_opens | dummy |
| 65 | +unsubscribe_drops | dummy |
| 66 | +unsubscribes | dummy |
| 67 | + |
14 | 68 | ### Running with Docker |
15 | 69 |
|
16 | 70 | (TBW) |
@@ -40,46 +94,3 @@ $ make |
40 | 94 | ``` |
41 | 95 | $ docker build -t sendgrid-stats-exporter . |
42 | 96 | ``` |
43 | | - |
44 | | -## Configuration |
45 | | - |
46 | | -### Exporter |
47 | | - |
48 | | -You can specify a user name as environment variable to identify metrics for multiple users, as well as categories. |
49 | | - |
50 | | -Name | Description | Default |
51 | | ----------|-------------|---- |
52 | | -`SENDGRID_API_KEY` | API key for calling stats API (v3) | `""` |
53 | | -`SENDGRID_USER_NAME` | (Optional) Label for metrics | `""` |
54 | | -`SENDGRID_CATEGORY` | (not implemented) | `""` |
55 | | - |
56 | | -### Prometheus |
57 | | - |
58 | | -Example: |
59 | | - |
60 | | -```yaml |
61 | | -scrape_configs: |
62 | | - - job_name: 'sendgrid' |
63 | | - static_configs: |
64 | | - - targets: |
65 | | - - https://sendgrid-stats-exporter.example.com:2112 |
66 | | -``` |
67 | | -
|
68 | | -## Metrics |
69 | | -
|
70 | | -Name | Description |
71 | | ----------|------------ |
72 | | -blocks | dummy |
73 | | -bounce_drops | dummy |
74 | | -bounces | dummy |
75 | | -deferred | dummy |
76 | | -delivered | dummy |
77 | | -invalid_emails | dummy |
78 | | -processed | dummy |
79 | | -requests | dummy |
80 | | -spam_report_drops | dummy |
81 | | -spam_reports | dummy |
82 | | -unique_clicks | dummy |
83 | | -unique_opens | dummy |
84 | | -unsubscribe_drops | dummy |
85 | | -unsubscribes | dummy |
|
0 commit comments