Skip to content

Commit f5417bd

Browse files
FlorentinDDarthMax
andauthored
Initialize metrics lazily (#10133)
* Initialize metrics lazily Prepare for using non-default CollectorRegistry for Neo4j plugin setup. * Register algo metrics in registry (also non-default) Co-authored-by: Max Kießling <max.kiessling@neo4j.com> * Improve error details for flaky test --------- Co-authored-by: Max Kießling <max.kiessling@neo4j.com>
1 parent 9c8543a commit f5417bd

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Neo4j is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.neo4j.gds.settings;
21+
22+
import org.neo4j.annotations.service.ServiceProvider;
23+
import org.neo4j.configuration.Description;
24+
import org.neo4j.configuration.SettingImpl;
25+
import org.neo4j.configuration.SettingsDeclaration;
26+
import org.neo4j.graphdb.config.Setting;
27+
28+
import static org.neo4j.configuration.SettingValueParsers.BOOL;
29+
30+
@ServiceProvider
31+
public class GdsMetricsSettings implements SettingsDeclaration {
32+
33+
// Replacement for the prometheus server from GDS (used for Sessions)
34+
@Description("Use GDS-only prometeheus server instead of relying on DBMS")
35+
public static final Setting<Boolean> gds_metrics_server_enabled = SettingImpl.newBuilder(
36+
"internal.gds.custom_metrics_server", BOOL, Boolean.FALSE)
37+
.immutable()
38+
.internal()
39+
.build();
40+
41+
}

neo4j-settings/src/main/java/org/neo4j/gds/settings/GdsSettings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ public static Setting<Path> exportLocation() {
3434
public static Setting<Boolean> validateUsingMaxMemoryEstimation() {
3535
return MemoryEstimationSettings.validate_using_max_memory_estimation;
3636
}
37+
38+
public static Setting<Boolean> useGdsMetricsServer() {
39+
return GdsMetricsSettings.gds_metrics_server_enabled;
40+
}
3741
}

0 commit comments

Comments
 (0)