Skip to content

Commit a990b9f

Browse files
committed
Rename mixin, add CI
1 parent c8bfd23 commit a990b9f

22 files changed

+622
-4
lines changed

.github/workflows/mixin.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: mixin
3+
on:
4+
pull_request:
5+
paths:
6+
- "elasticsearch-mixin/**"
7+
8+
jobs:
9+
lint:
10+
name: lint
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
- name: Setup Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: 1.22.5
19+
- name: Install dependencies
20+
run: |
21+
go install github.com/google/go-jsonnet/cmd/[email protected]
22+
go install github.com/google/go-jsonnet/cmd/[email protected]
23+
go install github.com/google/go-jsonnet/cmd/[email protected]
24+
- name: Lint
25+
run: bash ./scripts/lint-jsonnet.sh

elasticsearch_mixin/README.md renamed to elasticsearch-mixin/README.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,33 @@ This is a mixin for the elasticsearch_exporter to define dashboards, alerts, and
55
Good example of upstream mixin for reference: https://github.com/kubernetes-monitoring/kubernetes-mixin
66

77

8+
docker-compose
9+
- docker-compose exec elasticsearch bash
10+
- bin/elasticsearch-reset-password -u elastic -f
11+
- login to grafana
12+
- add prometheus datasource (http://prometheus:9090)
13+
- http://127.0.0.1:3000
14+
- http://127.0.0.1:9090/targets?search=
15+
- http://127.0.0.1:9114/metrics
16+
817
## Development
918

1019
### JSONNET
20+
https://jsonnet.org/
21+
1122
```go install github.com/google/go-jsonnet/cmd/jsonnet@latest```
1223

1324
### JSONNET BUNDLER
1425
jsonnet bundler is a package manager for jsonnet
1526

16-
```go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest```
27+
https://github.com/jsonnet-bundler/jsonnet-bundler
1728

29+
```go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest```
1830

1931
### Grafonnet
32+
Grafana libraries for jsonnet: https://grafana.github.io/grafonnet/
33+
2034
```jb install github.com/grafana/grafonnet/gen/grafonnet-latest@main```
35+
36+
validate
37+
go install github.com/grafana/dashboard-linter@latest
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
local dashboards = (import 'mixin.libsonnet').grafanaDashboards;
22

3-
{ [name]: dashboards[name] for name in std.objectFields(dashboards)}
3+
{ [name]: dashboards[name] for name in std.objectFields(dashboards) }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'

elasticsearch_mixin/dashboards/variables.libsonnet renamed to elasticsearch-mixin/dashboards/variables.libsonnet

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ local var = g.dashboard.variable;
1111
+ var.query.queryTypes.withLabelValues(
1212
'cluster',
1313
'elasticsearch_cluster_health_status',
14-
)
14+
),
1515
}

0 commit comments

Comments
 (0)