File tree 7 files changed +33
-13
lines changed
compuscene/metrics/prometheus
7 files changed +33
-13
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ stages:
13
13
14
14
build :
15
15
stage : " build"
16
+ tags :
17
+ - " gradle"
16
18
script : " su gradle -c 'gradle --build-cache assemble'"
17
19
cache :
18
20
key : " $CI_COMMIT_REF_NAME"
23
25
24
26
test :
25
27
stage : " test"
28
+ tags :
29
+ - " gradle"
26
30
script : " su gradle -c 'gradle check'"
27
31
artifacts :
28
32
reports :
@@ -40,6 +44,8 @@ release:
40
44
- " 6.x"
41
45
- " master"
42
46
stage : " release"
47
+ tags :
48
+ - " gradle"
43
49
script : " su gradle -c 'gradle release'"
44
50
cache :
45
51
key : " $CI_COMMIT_REF_NAME"
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ It collects all relevant metrics and makes them available to Prometheus via the
27
27
28
28
| Elasticsearch | Plugin | Release date |
29
29
| -------------- | -------------- | ------------ |
30
+ | 7.3.0 | 7.3.0.0 | Sep 17, 2019 |
30
31
| 7.2.1 | 7.2.1.0 | Jul 31, 2019 |
31
32
| 7.2.0 | 7.2.0.0 | Jul 12, 2019 |
32
33
| 7.1.1 | 7.1.1.0 | May 31, 2019 |
@@ -133,7 +134,7 @@ It collects all relevant metrics and makes them available to Prometheus via the
133
134
## Install
134
135
135
136
- Since Elasticsearch 7.0.0 :
136
- ` ./bin/elasticsearch-plugin install -b https://github.com/vvanholl/elasticsearch-prometheus-exporter/releases/download/7.2.1 .0/prometheus-exporter-7.2.1 .0.zip `
137
+ ` ./bin/elasticsearch-plugin install -b https://github.com/vvanholl/elasticsearch-prometheus-exporter/releases/download/7.3.0 .0/prometheus-exporter-7.3.0 .0.zip `
137
138
138
139
- Since Elasticsearch 6.0.0 :
139
140
` ./bin/elasticsearch-plugin install -b https://github.com/vvanholl/elasticsearch-prometheus-exporter/releases/download/6.8.0.0/prometheus-exporter-6.8.0.0.zip `
Original file line number Diff line number Diff line change @@ -154,3 +154,11 @@ task release() {
154
154
dependsOn([" githubRelease" ])
155
155
}
156
156
}
157
+
158
+ // Fix for https://github.com/elastic/elasticsearch/issues/45073
159
+ // TODO(lukas-vlcek): Should be removed for ES v7.3.1 and later.
160
+ configurations. all {
161
+ resolutionStrategy. dependencySubstitution {
162
+ substitute project(' :rest-api-spec' ) with module (" org.elasticsearch:rest-api-spec:${ versions.elasticsearch} " )
163
+ }
164
+ }
Original file line number Diff line number Diff line change 1
1
group = org.elasticsearch.plugin.prometheus
2
2
3
- version = 7.2.1.0-SNAPSHOT
3
+ version = 7.3.0.0
4
4
5
5
pluginName = prometheus-exporter
6
6
pluginClassname = org.elasticsearch.plugin.prometheus.PrometheusExporterPlugin
Original file line number Diff line number Diff line change 1
1
rootProject. name = " prometheus-exporter"
2
+
3
+ // Fix for https://github.com/elastic/elasticsearch/issues/45073
4
+ // TODO(lukas-vlcek): Should be removed for ES v7.3.1 and later.
5
+ include ' :rest-api-spec'
Original file line number Diff line number Diff line change 24
24
import org .elasticsearch .action .admin .indices .stats .IndexStats ;
25
25
import org .elasticsearch .action .admin .indices .stats .IndicesStatsResponse ;
26
26
import org .elasticsearch .cluster .health .ClusterIndexHealth ;
27
- import org .elasticsearch .cluster .node .DiscoveryNode . Role ;
27
+ import org .elasticsearch .cluster .node .DiscoveryNodeRole ;
28
28
import org .elasticsearch .http .HttpStats ;
29
29
import org .elasticsearch .indices .NodeIndicesStats ;
30
30
import org .elasticsearch .indices .breaker .AllCircuitBreakerStats ;
@@ -129,14 +129,17 @@ private void registerNodeMetrics() {
129
129
130
130
private void updateNodeMetrics (NodeStats ns ) {
131
131
if (ns != null ) {
132
+
133
+ // Plugins can introduce custom node roles from 7.3.0: https://github.com/elastic/elasticsearch/pull/43175
134
+ // TODO(lukas-vlcek): List of node roles can not be static but needs to be created dynamically.
132
135
Map <String , Integer > roles = new HashMap <>();
133
136
134
137
roles .put ("master" , 0 );
135
138
roles .put ("data" , 0 );
136
139
roles .put ("ingest" , 0 );
137
140
138
- for (Role r : ns .getNode ().getRoles ()) {
139
- roles .put (r .getRoleName (), 1 );
141
+ for (DiscoveryNodeRole r : ns .getNode ().getRoles ()) {
142
+ roles .put (r .roleName (), 1 );
140
143
}
141
144
142
145
for (String k : roles .keySet ()) {
Original file line number Diff line number Diff line change 21
21
/**
22
22
* Action class for Prometheus Exporter plugin.
23
23
*/
24
- public class NodePrometheusMetricsAction extends Action <NodePrometheusMetricsResponse > {
24
+ public class NodePrometheusMetricsAction extends ActionType <NodePrometheusMetricsResponse > {
25
+ // TODO(lukas-vlcek): There are ongoing changes for ActionType class. This code needs additional review.
26
+ // - https://github.com/elastic/elasticsearch/pull/43778
27
+ // - https://github.com/elastic/elasticsearch/commit/b33ffc1ae06035e934277f17c4b5d9851f607056#diff-80df90ca727aadbbe854902f81bda313
28
+ // - https://github.com/elastic/elasticsearch/commit/5a9f81791a1be7fe6dd97728384ebafb189ab211#diff-80df90ca727aadbbe854902f81bda313
25
29
public static final NodePrometheusMetricsAction INSTANCE = new NodePrometheusMetricsAction ();
26
30
public static final String NAME = "cluster:monitor/prometheus/metrics" ;
27
31
28
32
private NodePrometheusMetricsAction () {
29
- super (NAME );
30
- }
31
-
32
- @ Override
33
- @ SuppressWarnings ("deprecation" )
34
- public NodePrometheusMetricsResponse newResponse () {
35
- throw new UnsupportedOperationException ("usage of Streamable is to be replaced by Writeable" );
33
+ super (NAME , null );
36
34
}
37
35
38
36
@ Override
You can’t perform that action at this time.
0 commit comments