| 1 | { config, ... }: |
| 2 | |
| 3 | { |
| 4 | # Note that the credentials are technically in the nixos-search repo in plaintext, |
| 5 | # so mostly using age here for good form. |
| 6 | age.secrets.elasticsearch-exporter-env.file = ../../../secrets/elasticsearch-exporter-env.age; |
| 7 | |
| 8 | services.prometheus = { |
| 9 | exporters.elasticsearch = { |
| 10 | enable = true; |
| 11 | listenAddress = "127.0.0.1"; |
| 12 | url = "https://nixos-search-7-1733963800.us-east-1.bonsaisearch.net"; |
| 13 | environmentFile = config.age.secrets.elasticsearch-exporter-env.path; |
| 14 | extraFlags = [ |
| 15 | "--es.all" |
| 16 | "--es.indices" |
| 17 | "--collector.clustersettings" |
| 18 | "--collector.snapshots" |
| 19 | ]; |
| 20 | }; |
| 21 | |
| 22 | scrapeConfigs = [ |
| 23 | { |
| 24 | job_name = "prometheus-elasticsearch-exporter"; |
| 25 | static_configs = [ { targets = [ "127.0.0.1:9114" ]; } ]; |
| 26 | } |
| 27 | ]; |
| 28 | }; |
| 29 | } |