Skip to content

Commit 0c4a8d6

Browse files
authored
Merge pull request #5 from liurui-software/main2
Sort out configuration related issues
2 parents 696e942 + 85fcc7f commit 0c4a8d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+165
-93
lines changed

README.md

+17-3

ojr-dameng-db/README.md

-5

ojr-dameng-db/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "com.ojr"
7-
version = "0.1.0"
7+
version = "0.5.0"
88

99
java {
1010
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -28,9 +28,9 @@ dependencies {
2828
implementation("io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.28.0-alpha")
2929
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2")
3030

31-
implementation(files("libs/ojr-core-0.1.0.jar"))
32-
implementation(files("libs/ojr-vault-all-0.1.0.jar"))
33-
implementation(files("libs/ojr-rdb-0.1.0.jar"))
31+
implementation(files("libs/ojr-core-0.5.0.jar"))
32+
implementation(files("libs/ojr-vault-all-0.4.0.jar"))
33+
implementation(files("libs/ojr-rdb-0.5.0.jar"))
3434
implementation(files("libs/DmJdbcDriver8.jar"))
3535

3636
testImplementation platform('org.junit:junit-bom:5.11.3')

ojr-dameng-db/libs/ojr-core-0.1.0.jar

-43.6 KB
Binary file not shown.

ojr-dameng-db/libs/ojr-core-0.5.0.jar

44.5 KB
Binary file not shown.
Binary file not shown.

ojr-ibmmq/README.md

-5

ojr-ibmmq/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
implementation('org.apache.commons:commons-lang3:3.17.0')
3131
implementation('com.ibm.mq:com.ibm.mq.allclient:9.4.1.1')
3232

33-
implementation(files("libs/ojr-core-0.1.0.jar"))
33+
implementation(files("libs/ojr-core-0.5.0.jar"))
3434

3535
testImplementation platform('org.junit:junit-bom:5.11.3')
3636
testImplementation 'org.junit.jupiter:junit-jupiter'

ojr-ibmmq/libs/ojr-core-0.1.0.jar

-43.6 KB
Binary file not shown.

ojr-ibmmq/libs/ojr-core-0.5.0.jar

44.5 KB
Binary file not shown.

ojr-informix-db/README.md

-5

ojr-informix-db/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "com.ojr"
7-
version = "0.1.0"
7+
version = "0.4.0"
88

99
java {
1010
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -31,9 +31,9 @@ dependencies {
3131
implementation("org.apache.commons:commons-dbcp2:2.11.0")
3232
implementation("com.ibm.informix:jdbc:4.50.10")
3333

34-
implementation(files("libs/ojr-core-0.1.0.jar"))
35-
implementation(files("libs/ojr-vault-all-0.1.0.jar"))
36-
implementation(files("libs/ojr-rdb-0.1.0.jar"))
34+
implementation(files("libs/ojr-core-0.5.0.jar"))
35+
implementation(files("libs/ojr-vault-all-0.4.0.jar"))
36+
implementation(files("libs/ojr-rdb-0.5.0.jar"))
3737

3838
testImplementation platform('org.junit:junit-bom:5.11.3')
3939
testImplementation 'org.junit.jupiter:junit-jupiter'
-43.6 KB
Binary file not shown.
44.5 KB
Binary file not shown.
Binary file not shown.

ojr-linux-host/README.md

-5

ojr-linux-host/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "com.ojr"
7-
version = "0.1.0"
7+
version = "0.4.0"
88

99
java {
1010
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -28,8 +28,8 @@ dependencies {
2828
implementation("io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.28.0-alpha")
2929
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2")
3030

31-
implementation(files("libs/ojr-core-0.1.0.jar"))
32-
implementation(files("libs/ojr-host-0.1.0.jar"))
31+
implementation(files("libs/ojr-core-0.5.0.jar"))
32+
implementation(files("libs/ojr-host-0.5.0.jar"))
3333

3434
testImplementation platform('org.junit:junit-bom:5.11.3')
3535
testImplementation 'org.junit.jupiter:junit-jupiter'
-43.6 KB
Binary file not shown.
44.5 KB
Binary file not shown.

ojr-mq-appliance/README.md

-5

ojr-mq-appliance/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "com.ojr"
7-
version = "0.1.0"
7+
version = "0.4.0"
88

99
java {
1010
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -28,8 +28,8 @@ dependencies {
2828
implementation("io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.28.0-alpha")
2929
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2")
3030

31-
implementation(files("libs/ojr-core-0.1.0.jar"))
32-
implementation(files("libs/ojr-host-0.1.0.jar"))
31+
implementation(files("libs/ojr-core-0.5.0.jar"))
32+
implementation(files("libs/ojr-host-0.5.0.jar"))
3333

3434
testImplementation platform('org.junit:junit-bom:5.11.3')
3535
testImplementation 'org.junit.jupiter:junit-jupiter'
-43.6 KB
Binary file not shown.
44.5 KB
Binary file not shown.

ojr-oceanbase-db/README.md

-5

ojr-oceanbase-db/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "com.ojr"
7-
version = "0.1.0"
7+
version = "0.4.0"
88

99
java {
1010
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -29,9 +29,9 @@ dependencies {
2929
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2")
3030
implementation("mysql:mysql-connector-java:5.1.46")
3131

32-
implementation(files("libs/ojr-core-0.1.0.jar"))
33-
implementation(files("libs/ojr-vault-all-0.1.0.jar"))
34-
implementation(files("libs/ojr-rdb-0.1.0.jar"))
32+
implementation(files("libs/ojr-core-0.5.0.jar"))
33+
implementation(files("libs/ojr-vault-all-0.4.0.jar"))
34+
implementation(files("libs/ojr-rdb-0.5.0.jar"))
3535

3636
testImplementation platform('org.junit:junit-bom:5.11.3')
3737
testImplementation 'org.junit.jupiter:junit-jupiter'
-43.6 KB
Binary file not shown.
44.5 KB
Binary file not shown.

ojr-snmp-host/README.md

-5

ojr-snmp-host/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "com.ojr"
7-
version = "0.1.0"
7+
version = "0.4.0"
88

99
java {
1010
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -29,9 +29,9 @@ dependencies {
2929
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2")
3030
implementation("org.snmp4j:snmp4j-agent:3.8.1")
3131

32-
implementation(files("libs/ojr-core-0.1.0.jar"))
33-
implementation(files("libs/ojr-snmp-0.1.0.jar"))
34-
implementation(files("libs/ojr-host-0.1.0.jar"))
32+
implementation(files("libs/ojr-core-0.5.0.jar"))
33+
implementation(files("libs/ojr-snmp-0.4.0.jar"))
34+
implementation(files("libs/ojr-host-0.5.0.jar"))
3535

3636
testImplementation platform('org.junit:junit-bom:5.11.3')
3737
testImplementation 'org.junit.jupiter:junit-jupiter'

ojr-snmp-host/libs/ojr-core-0.1.0.jar

-43.6 KB
Binary file not shown.

ojr-snmp-host/libs/ojr-core-0.5.0.jar

44.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

sdk/ojr-core/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "com.ojr"
7-
version = "0.1.0"
7+
version = "0.5.0"
88

99
java {
1010
sourceCompatibility = JavaVersion.VERSION_1_8

sdk/ojr-core/src/main/java/com/ojr/core/AbstractDc.java

+27-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public abstract class AbstractDc<Cfg extends BasicDcConfig> implements IDc<Cfg>
7070

7171
private int prometheusPort = DcUtil.DEFAULT_PROMETHEUS_PORT;
7272
private String prometheusHost = DcUtil.DEFAULT_PROMETHEUS_HOST;
73+
private String[] prometricsMetricRestrictions = null;
7374

7475
private String serviceName = DcUtil.DEFAULT_OTEL_SERVICE_NAME;
7576
private String serviceInstanceId = null;
@@ -194,6 +195,30 @@ public void setPrometheusHost(String prometheusHost) {
194195
this.prometheusHost = prometheusHost;
195196
}
196197

198+
@Override
199+
public String[] getPrometricsMetricRestrictions() {
200+
return prometricsMetricRestrictions;
201+
}
202+
203+
@Override
204+
public void setPrometricsMetricRestrictions(String metricRestrictionString) {
205+
if (metricRestrictionString != null) {
206+
String[] restrictions = metricRestrictionString.split(",");
207+
prometricsMetricRestrictions = new String[restrictions.length];
208+
for (int i = 0; i < restrictions.length; i++) {
209+
prometricsMetricRestrictions[i] = restrictions[i].trim();
210+
}
211+
212+
} else {
213+
prometricsMetricRestrictions = null;
214+
}
215+
}
216+
217+
@Override
218+
public void setPrometricsMetricRestrictions(String[] prometricsMetricRestrictions) {
219+
this.prometricsMetricRestrictions = prometricsMetricRestrictions;
220+
}
221+
197222
@Override
198223
public String getHostname() {
199224
if (hostname != null)
@@ -459,7 +484,7 @@ public synchronized OjrPrometheusHttpServer createPrometheusHttpServerIfNotExist
459484
if (prometheusHttpServer != null) {
460485
return prometheusHttpServer; // Return early if the server is already created
461486
}
462-
prometheusHttpServer = new OjrPrometheusHttpServer(prometheusHost, prometheusPort, null, MemoryMode.REUSABLE_DATA);
487+
prometheusHttpServer = new OjrPrometheusHttpServer(prometheusHost, prometheusPort, null, MemoryMode.REUSABLE_DATA, prometricsMetricRestrictions);
463488
return prometheusHttpServer;
464489
}
465490

@@ -578,6 +603,7 @@ public void readBuiltinParameters(Map<String, Object> properties, Cfg config) {
578603

579604
setPrometheusPort((Integer) properties.getOrDefault(DcUtil.PROMETHEUS_PORT, DcUtil.DEFAULT_PROMETHEUS_PORT));
580605
setPrometheusHost((String) properties.get(DcUtil.PROMETHEUS_HOST));
606+
setPrometricsMetricRestrictions((String) properties.get(DcUtil.PROMETHEUS_RESTRICTED_METRICS));
581607

582608
setServiceName((String) properties.getOrDefault(DcUtil.OTEL_SERVICE_NAME, DcUtil.DEFAULT_OTEL_SERVICE_NAME));
583609
setServiceInstanceId((String) properties.get(DcUtil.OTEL_SERVICE_INSTANCE_ID));

0 commit comments

Comments
 (0)