Skip to content

Commit e420700

Browse files
authored
Merge pull request #220 from vvanholl/es730
Upgrade to ES 7.3.0 and Release version 7.3.0.0
2 parents 0a84052 + 713ce40 commit e420700

File tree

7 files changed

+33
-13
lines changed

7 files changed

+33
-13
lines changed

.gitlab-ci.yml

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ stages:
1313

1414
build:
1515
stage: "build"
16+
tags:
17+
- "gradle"
1618
script: "su gradle -c 'gradle --build-cache assemble'"
1719
cache:
1820
key: "$CI_COMMIT_REF_NAME"
@@ -23,6 +25,8 @@ build:
2325

2426
test:
2527
stage: "test"
28+
tags:
29+
- "gradle"
2630
script: "su gradle -c 'gradle check'"
2731
artifacts:
2832
reports:
@@ -40,6 +44,8 @@ release:
4044
- "6.x"
4145
- "master"
4246
stage: "release"
47+
tags:
48+
- "gradle"
4349
script: "su gradle -c 'gradle release'"
4450
cache:
4551
key: "$CI_COMMIT_REF_NAME"

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ It collects all relevant metrics and makes them available to Prometheus via the
2727

2828
| Elasticsearch | Plugin | Release date |
2929
| -------------- | -------------- | ------------ |
30+
| 7.3.0 | 7.3.0.0 | Sep 17, 2019 |
3031
| 7.2.1 | 7.2.1.0 | Jul 31, 2019 |
3132
| 7.2.0 | 7.2.0.0 | Jul 12, 2019 |
3233
| 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
133134
## Install
134135

135136
- 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`
137138

138139
- Since Elasticsearch 6.0.0 :
139140
`./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`

build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,11 @@ task release() {
154154
dependsOn(["githubRelease"])
155155
}
156156
}
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+
}

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
group = org.elasticsearch.plugin.prometheus
22

3-
version = 7.2.1.0-SNAPSHOT
3+
version = 7.3.0.0
44

55
pluginName = prometheus-exporter
66
pluginClassname = org.elasticsearch.plugin.prometheus.PrometheusExporterPlugin

settings.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
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'

src/main/java/org/compuscene/metrics/prometheus/PrometheusMetricsCollector.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.elasticsearch.action.admin.indices.stats.IndexStats;
2525
import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
2626
import org.elasticsearch.cluster.health.ClusterIndexHealth;
27-
import org.elasticsearch.cluster.node.DiscoveryNode.Role;
27+
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
2828
import org.elasticsearch.http.HttpStats;
2929
import org.elasticsearch.indices.NodeIndicesStats;
3030
import org.elasticsearch.indices.breaker.AllCircuitBreakerStats;
@@ -129,14 +129,17 @@ private void registerNodeMetrics() {
129129

130130
private void updateNodeMetrics(NodeStats ns) {
131131
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.
132135
Map<String, Integer> roles = new HashMap<>();
133136

134137
roles.put("master", 0);
135138
roles.put("data", 0);
136139
roles.put("ingest", 0);
137140

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);
140143
}
141144

142145
for (String k : roles.keySet()) {

src/main/java/org/elasticsearch/action/NodePrometheusMetricsAction.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,16 @@
2121
/**
2222
* Action class for Prometheus Exporter plugin.
2323
*/
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
2529
public static final NodePrometheusMetricsAction INSTANCE = new NodePrometheusMetricsAction();
2630
public static final String NAME = "cluster:monitor/prometheus/metrics";
2731

2832
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);
3634
}
3735

3836
@Override

0 commit comments

Comments
 (0)