Skip to content

Commit 1cd622d

Browse files
committed
8.13.2.0
1 parent 2d9e695 commit 1cd622d

File tree

8 files changed

+40
-23
lines changed

8 files changed

+40
-23
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- "7.x"
1212

1313
env:
14-
gradle-version: "8.5"
14+
gradle-version: "8.7"
1515
java-version: "17"
1616

1717
jobs:

README.md

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

5757
| Elasticsearch | Plugin | Release date |
5858
|---------------|----------|--------------|
59+
| 8.13.2 | 8.13.2.0 | Apr 20, 2024 |
5960
| 8.12.2 | 8.12.2.0 | Feb 24, 2024 |
6061
| 8.12.1 | 8.12.1.0 | Feb 10, 2024 |
6162
| 8.12.0 | 8.12.0.0 | Jan 19, 2024 |
@@ -104,7 +105,7 @@ It collects all relevant metrics and makes them available to Prometheus via the
104105

105106
```
106107
./bin/elasticsearch-plugin install -b \
107-
https://github.com/mindw/elasticsearch-prometheus-exporter/releases/download/8.12.2.0/prometheus-exporter-8.12.2.0.zip
108+
https://github.com/mindw/elasticsearch-prometheus-exporter/releases/download/8.13.2.0/prometheus-exporter-8.13.2.0.zip
108109
```
109110

110111
**Do not forget to restart the node after the installation!**

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ dependencies {
8585
releaseJars "${project.group}:${project.name}:${project.version}"
8686
}
8787

88-
tasks.withType(JavaCompile) {
88+
tasks.withType(JavaCompile).configureEach {
8989
options.compilerArgs << "-Xlint:unchecked,deprecation"
9090
}
9191

@@ -97,7 +97,7 @@ esplugin {
9797
classname pluginClassname
9898
}
9999

100-
testClusters.all {
100+
testClusters.configureEach {
101101
numberOfNodes = 2
102102
}
103103

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 = 8.12.2.1-SNAPSHOT
3+
version = 8.13.2.0
44

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

gradlew.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ private void updatePerIndexContextMetrics(String indexName, String context, Comm
566566
catalog.setClusterGauge("index_doc_number", idx.getDocs().getCount(), indexName, context);
567567
catalog.setClusterGauge("index_doc_deleted_number", idx.getDocs().getDeleted(), indexName, context);
568568

569-
catalog.setClusterGauge("index_store_size", idx.getStore().getSizeInBytes(), indexName, context);
569+
catalog.setClusterGauge("index_store_size", idx.getStore().sizeInBytes(), indexName, context);
570570

571571
var idxTotal = idx.getIndexing().getTotal();
572572
catalog.setClusterGauge("index_indexing_delete_count", idxTotal.getDeleteCount(), indexName, context);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ public class NodePrometheusMetricsAction extends ActionType<NodePrometheusMetric
2525
public static final String NAME = "cluster:monitor/prometheus/metrics";
2626

2727
private NodePrometheusMetricsAction() {
28-
super(NAME, NodePrometheusMetricsResponse::new);
28+
super(NAME);
2929
}
3030
}

src/main/java/org/elasticsearch/plugin/prometheus/PrometheusExporterPlugin.java

+22-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
import org.elasticsearch.action.TransportNodePrometheusMetricsAction;
2929
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
3030
import org.elasticsearch.cluster.node.DiscoveryNodes;
31+
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
3132
import org.elasticsearch.common.settings.*;
33+
import org.elasticsearch.features.NodeFeature;
3234
import org.elasticsearch.plugins.ActionPlugin;
3335
import org.elasticsearch.plugins.Plugin;
3436
import org.elasticsearch.rest.RestController;
@@ -38,6 +40,7 @@
3840
import java.util.Arrays;
3941
import java.util.Collections;
4042
import java.util.List;
43+
import java.util.function.Predicate;
4144
import java.util.function.Supplier;
4245

4346
/**
@@ -53,17 +56,30 @@ public PrometheusExporterPlugin() {
5356
@Override
5457
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
5558
return singletonList(
56-
new ActionHandler<>(NodePrometheusMetricsAction.INSTANCE, TransportNodePrometheusMetricsAction.class)
59+
new ActionHandler<>(
60+
NodePrometheusMetricsAction.INSTANCE,
61+
TransportNodePrometheusMetricsAction.class
62+
)
5763
);
5864
}
5965

6066
@Override
61-
public List<RestHandler> getRestHandlers(Settings settings, RestController restController, ClusterSettings clusterSettings,
62-
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter,
63-
IndexNameExpressionResolver indexNameExpressionResolver,
64-
Supplier<DiscoveryNodes> nodesInCluster) {
67+
public List<RestHandler> getRestHandlers(
68+
Settings settings,
69+
NamedWriteableRegistry namedWriteableRegistry,
70+
RestController restController,
71+
ClusterSettings clusterSettings,
72+
IndexScopedSettings indexScopedSettings,
73+
SettingsFilter settingsFilter,
74+
IndexNameExpressionResolver indexNameExpressionResolver,
75+
Supplier<DiscoveryNodes> nodesInCluster,
76+
Predicate<NodeFeature> clusterSupportsFeature
77+
) {
6578
return singletonList(
66-
new RestPrometheusMetricsAction(settings, clusterSettings)
79+
new RestPrometheusMetricsAction(
80+
settings,
81+
clusterSettings
82+
)
6783
);
6884
}
6985

0 commit comments

Comments
 (0)