|
| 1 | +http response prometheus /api/v1/metadata 200 {"status":"success","data":{}} |
| 2 | +http response prometheus /api/v1/status/config 200 {"status":"success","data":{"yaml":"global:\n scrape_interval: 30s\n"}} |
| 3 | +http response prometheus /api/v1/status/flags 200 {"status":"success","data":{"storage.tsdb.retention.time": "1d"}} |
| 4 | +http response prometheus /api/v1/query_range 200 {"status":"success","data":{"resultType":"matrix","result":[]}} |
| 5 | +http response prometheus /api/v1/query 200 {"status":"success","data":{"resultType":"vector","result":[]}} |
| 6 | +http start prometheus 127.0.0.1:7160 |
| 7 | + |
| 8 | +mkdir testrepo |
| 9 | +cd testrepo |
| 10 | +exec git init --initial-branch=main . |
| 11 | + |
| 12 | +cp ../src/v0.yml rules.yml |
| 13 | +cp ../src/.pint.hcl . |
| 14 | +env GIT_AUTHOR_NAME=pint |
| 15 | + |
| 16 | +env GIT_COMMITTER_NAME=pint |
| 17 | + |
| 18 | +exec git add . |
| 19 | +exec git commit -am 'import rules and config' |
| 20 | + |
| 21 | +exec git checkout -b v1 |
| 22 | +cp ../src/v1.yml rules.yml |
| 23 | +exec git commit -am 'v1' |
| 24 | +pint.ok --no-color ci |
| 25 | +cmp stderr ../stderrV1.txt |
| 26 | + |
| 27 | +exec git checkout main |
| 28 | +exec git merge v1 |
| 29 | + |
| 30 | +exec git checkout -b v2 |
| 31 | +cp ../src/v2.yml rules.yml |
| 32 | +exec git commit -am 'v2' |
| 33 | +pint.error --no-color ci |
| 34 | +! stdout . |
| 35 | +cmp stderr ../stderrV2.txt |
| 36 | + |
| 37 | +-- stderrV1.txt -- |
| 38 | +level=INFO msg="Loading configuration file" path=.pint.hcl |
| 39 | +level=INFO msg="Finding all rules to check on current git branch" base=main |
| 40 | +level=INFO msg="Configured new Prometheus server" name=prom uris=1 uptime=up tags=[] include=[] exclude=[] |
| 41 | +-- stderrV2.txt -- |
| 42 | +level=INFO msg="Loading configuration file" path=.pint.hcl |
| 43 | +level=INFO msg="Finding all rules to check on current git branch" base=main |
| 44 | +level=INFO msg="Configured new Prometheus server" name=prom uris=1 uptime=up tags=[] include=[] exclude=[] |
| 45 | +level=WARN msg="No results for Prometheus uptime metric, you might have set uptime config option to a missing metric, please check your config" name=prom metric=up |
| 46 | +level=WARN msg="Using dummy Prometheus uptime metric results with no gaps" name=prom metric=up |
| 47 | +level=WARN msg="No results for Prometheus uptime metric, you might have set uptime config option to a missing metric, please check your config" name=prom metric=up |
| 48 | +level=WARN msg="Using dummy Prometheus uptime metric results with no gaps" name=prom metric=up |
| 49 | +level=INFO msg="Problems found" Bug=2 |
| 50 | +rules.yml:8 Bug: `prom` Prometheus server at http://127.0.0.1:7160 didn't have any series for `up` metric in the last 1w. (promql/series) |
| 51 | + 8 | expr: up == 0 |
| 52 | + |
| 53 | +rules.yml:16 Bug: `prom` Prometheus server at http://127.0.0.1:7160 didn't have any series for `up` metric in the last 1w. (promql/series) |
| 54 | + 16 | expr: up == 0 |
| 55 | + |
| 56 | +level=ERROR msg="Fatal error" err="problems found" |
| 57 | +-- src/v0.yml -- |
| 58 | +groups: |
| 59 | +- name: g1 |
| 60 | + rules: [] |
| 61 | +-- src/v1.yml -- |
| 62 | +groups: |
| 63 | +- name: g1 |
| 64 | + rules: |
| 65 | + - alert: DownAlert |
| 66 | + # foo |
| 67 | + # pint disable promql/series(up) |
| 68 | + # bar |
| 69 | + expr: up == 0 |
| 70 | + annotations: |
| 71 | + summary: 'Service is down' |
| 72 | + labels: |
| 73 | + cluster: dev |
| 74 | + - record: up:sum |
| 75 | + # foo |
| 76 | + # pint disable promql/series(up) |
| 77 | + # bar |
| 78 | + expr: up == 0 |
| 79 | + labels: |
| 80 | + cluster: dev |
| 81 | +-- src/v2.yml -- |
| 82 | +groups: |
| 83 | +- name: g1 |
| 84 | + rules: |
| 85 | + - alert: DownAlert |
| 86 | + # foo |
| 87 | + # pint disable promql/series(xxx) |
| 88 | + # bar |
| 89 | + expr: up == 0 |
| 90 | + annotations: |
| 91 | + summary: 'Service is down' |
| 92 | + labels: |
| 93 | + cluster: dev |
| 94 | + - record: up:sum |
| 95 | + # foo |
| 96 | + # bar |
| 97 | + expr: up == 0 |
| 98 | + labels: |
| 99 | + cluster: dev |
| 100 | +-- src/.pint.hcl -- |
| 101 | +ci { |
| 102 | + baseBranch = "main" |
| 103 | +} |
| 104 | +prometheus "prom" { |
| 105 | + uri = "http://127.0.0.1:7160" |
| 106 | + timeout = "5s" |
| 107 | + required = true |
| 108 | +} |
0 commit comments