Skip to content

Commit 947ddba

Browse files
committed
Merge branch 'master' into pil0txia/admin_4847
# Conflicts: # eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/AbstractHTTPServer.java # eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/EventMeshServer.java
2 parents 74b2fbb + 2e4fc1b commit 947ddba

File tree

147 files changed

+6088
-2083
lines changed

Some content is hidden

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

147 files changed

+6088
-2083
lines changed

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ jobs:
4747
exempt-issue-labels: 'pinned,discussion,help wanted,WIP,weopen-star,GLCC,summer of code'
4848
exempt-pr-labels: 'help wanted,dependencies'
4949
exempt-all-milestones: true # Exempt all issues/PRs with milestones from stale
50-
operations-per-run: 30
50+
operations-per-run: 300

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ node_modules
2727
h2/db.mv.db
2828

2929
# license check tmp file
30-
all-dependencies.txt
30+
/tools/dependency-check/all-dependencies.txt
3131
self-modules.txt
3232
third-party-dependencies.txt
3333

@@ -50,4 +50,4 @@ bld/
5050
**/org/apache/eventmesh/connector/jdbc/antlr4/autogeneration/*
5151

5252
#rust
53-
Cargo.lock
53+
Cargo.lock

build.gradle

Lines changed: 90 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,58 @@ allprojects {
139139
}
140140
}
141141

142-
task tar(type: Tar) {
142+
tasks.register('dist') {
143+
subprojects.forEach { subProject ->
144+
dependsOn("${subProject.path}:jar")
145+
}
146+
def includedProjects =
147+
["eventmesh-common",
148+
"eventmesh-meta:eventmesh-meta-api",
149+
"eventmesh-metrics-plugin:eventmesh-metrics-api",
150+
"eventmesh-protocol-plugin:eventmesh-protocol-api",
151+
"eventmesh-retry:eventmesh-retry-api",
152+
"eventmesh-runtime",
153+
"eventmesh-security-plugin:eventmesh-security-api",
154+
"eventmesh-spi",
155+
"eventmesh-starter",
156+
"eventmesh-storage-plugin:eventmesh-storage-api",
157+
"eventmesh-trace-plugin:eventmesh-trace-api",
158+
"eventmesh-webhook:eventmesh-webhook-api",
159+
"eventmesh-webhook:eventmesh-webhook-admin",
160+
"eventmesh-webhook:eventmesh-webhook-receive"]
161+
doLast {
162+
includedProjects.each {
163+
def subProject = findProject(it)
164+
logger.lifecycle('Install module: module: {}', subProject.name)
165+
copy {
166+
from subProject.jar.archivePath
167+
into rootProject.file('dist/apps')
168+
}
169+
copy {
170+
from subProject.file('bin')
171+
into rootProject.file('dist/bin')
172+
}
173+
copy {
174+
from subProject.file('conf')
175+
from subProject.sourceSets.main.resources.srcDirs
176+
into rootProject.file('dist/conf')
177+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
178+
exclude 'META-INF'
179+
}
180+
copy {
181+
from subProject.configurations.runtimeClasspath
182+
into rootProject.file('dist/lib')
183+
exclude 'eventmesh-*'
184+
}
185+
}
186+
copy {
187+
from 'tools/third-party-licenses'
188+
into rootProject.file('dist')
189+
}
190+
}
191+
}
192+
193+
tasks.register('tar', Tar) {
143194
archiveBaseName.set(project.name)
144195
archiveVersion.set(project.version.toString())
145196
archiveExtension.set('tar.gz')
@@ -150,7 +201,7 @@ task tar(type: Tar) {
150201
}
151202
}
152203

153-
task zip(type: Zip) {
204+
tasks.register('zip', Zip) {
154205
archiveBaseName.set(project.name)
155206
archiveVersion.set(project.version.toString())
156207
archiveExtension.set('zip')
@@ -160,50 +211,39 @@ task zip(type: Zip) {
160211
}
161212
}
162213

163-
task installPlugin() {
164-
if (!new File("${rootDir}/dist").exists()) {
165-
return
214+
tasks.register('installPlugin') {
215+
var pluginProjects = subprojects.findAll {
216+
it.file('gradle.properties').exists()
217+
&& it.properties.containsKey('pluginType')
218+
&& it.properties.containsKey('pluginName')
219+
}
220+
doLast {
221+
String[] libJars = java.util.Optional.ofNullable(file('dist/lib').list()).orElse(new String[0])
222+
pluginProjects.forEach(subProject -> {
223+
var pluginType = subProject.properties.get('pluginType')
224+
var pluginName = subProject.properties.get('pluginName')
225+
logger.lifecycle('Install plugin: pluginType: {}, pluginInstanceName: {}, module: {}', pluginType,
226+
pluginName, subProject.name)
227+
copy {
228+
from subProject.jar.archivePath
229+
into rootProject.file("dist/plugin/${pluginType}/${pluginName}")
230+
}
231+
copy {
232+
from subProject.configurations.runtimeClasspath
233+
into rootProject.file("dist/plugin/${pluginType}/${pluginName}")
234+
exclude(libJars)
235+
}
236+
copy {
237+
from subProject.file('conf')
238+
from subProject.sourceSets.main.resources.srcDirs
239+
into rootProject.file("dist/conf")
240+
exclude 'META-INF'
241+
}
242+
})
166243
}
167-
String[] libJars = java.util.Optional.ofNullable(new File("${rootDir}/dist/lib").list()).orElseGet(() -> new String[0])
168-
getAllprojects().forEach(subProject -> {
169-
var file = new File("${subProject.projectDir}/gradle.properties")
170-
if (!file.exists()) {
171-
return
172-
}
173-
var properties = new Properties()
174-
properties.load(new FileInputStream(file))
175-
var pluginType = properties.getProperty("pluginType")
176-
var pluginName = properties.getProperty("pluginName")
177-
if (pluginType == null || pluginName == null) {
178-
return
179-
}
180-
var pluginFile = new File("${rootDir}/dist/plugin/${pluginType}/${pluginName}")
181-
if (pluginFile.exists()) {
182-
return
183-
}
184-
pluginFile.mkdirs()
185-
println String.format(
186-
"install plugin, pluginType: %s, pluginInstanceName: %s, module: %s", pluginType, pluginName, subProject.getName()
187-
)
188-
189-
copy {
190-
into "${rootDir}/dist/plugin/${pluginType}/${pluginName}"
191-
from "${subProject.getProjectDir()}/dist/apps"
192-
}
193-
copy {
194-
into "${rootDir}/dist/plugin/${pluginType}/${pluginName}"
195-
from "${subProject.getProjectDir()}/dist/lib/"
196-
exclude(libJars)
197-
}
198-
copy {
199-
into "${rootDir}/dist/conf"
200-
from "${subProject.getProjectDir()}/dist/conf"
201-
exclude 'META-INF'
202-
}
203-
})
204244
}
205245

206-
task printProjects() {
246+
tasks.register('printProjects') {
207247
getAllprojects().forEach(subProject -> {
208248
if ("EventMesh".equals(subProject.getName())) {
209249
return
@@ -303,77 +343,6 @@ subprojects {
303343
}
304344
}
305345

306-
task dist(dependsOn: ['jar']) {
307-
doFirst {
308-
new File("${projectDir}/dist/bin").mkdirs()
309-
new File("${projectDir}/dist/apps").mkdirs()
310-
new File("${projectDir}/dist/conf").mkdirs()
311-
new File("${projectDir}/dist/lib").mkdirs()
312-
new File("${projectDir}/dist/licenses").mkdirs()
313-
}
314-
Set<String> rootProject = ["eventmesh-common",
315-
"eventmesh-storage-api",
316-
"eventmesh-metrics-api",
317-
"eventmesh-meta-api",
318-
"eventmesh-trace-api",
319-
"eventmesh-retry-api",
320-
"eventmesh-runtime",
321-
"eventmesh-security-api",
322-
"eventmesh-protocol-api",
323-
"eventmesh-starter",
324-
"eventmesh-spi",
325-
"eventmesh-webhook-api",
326-
"eventmesh-webhook-admin",
327-
"eventmesh-webhook-receive"]
328-
doLast {
329-
copy {
330-
into("${projectDir}/dist/apps")
331-
from project.jar.getArchivePath()
332-
}
333-
copy {
334-
into("${projectDir}/dist/lib")
335-
from project.configurations.runtimeClasspath
336-
}
337-
copy {
338-
into("${projectDir}/dist/bin")
339-
from 'bin'
340-
}
341-
copy {
342-
into("${projectDir}/dist/conf")
343-
from 'conf', sourceSets.main.resources.srcDirs
344-
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
345-
exclude 'META-INF'
346-
}
347-
if (rootProject.contains(project.name)) {
348-
new File("${rootDir}/dist/apps").mkdirs()
349-
new File("${rootDir}/dist/lib").mkdirs()
350-
new File("${rootDir}/dist/bin").mkdirs()
351-
new File("${rootDir}/dist/conf").mkdirs()
352-
copy {
353-
into("${rootDir}/dist/apps")
354-
from "${projectDir}/dist/apps"
355-
}
356-
copy {
357-
into "${rootDir}/dist/lib"
358-
from "${projectDir}/dist/lib"
359-
exclude "eventmesh-*"
360-
}
361-
copy {
362-
into "${rootDir}/dist/bin"
363-
from "${projectDir}/dist/bin"
364-
}
365-
copy {
366-
into "${rootDir}/dist/conf"
367-
from "${projectDir}/dist/conf"
368-
}
369-
}
370-
copy {
371-
into "${rootDir}/dist"
372-
from "${rootDir}/tools/third-party-licenses"
373-
}
374-
}
375-
}
376-
377346
javadoc {
378347
source = sourceSets.main.java
379348
destinationDir = reporting.file("javadoc")
@@ -491,7 +460,6 @@ subprojects {
491460
dependency "org.apache.logging.log4j:log4j-api:${log4jVersion}"
492461
dependency "org.apache.logging.log4j:log4j-core:${log4jVersion}"
493462
dependency "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
494-
dependency "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}" // used with SLF4J 1.7.x or older for third-party dependencies
495463

496464
dependency "com.lmax:disruptor:3.4.2"
497465

@@ -513,15 +481,13 @@ subprojects {
513481
dependency "io.dropwizard.metrics:metrics-annotation:4.1.0"
514482
dependency "io.dropwizard.metrics:metrics-json:4.1.0"
515483

516-
dependency 'io.opentelemetry:opentelemetry-api:1.3.0'
517-
dependency 'io.opentelemetry:opentelemetry-sdk:1.3.0'
518-
dependency 'io.opentelemetry:opentelemetry-sdk-metrics:1.3.0-alpha'
519-
dependency 'io.opentelemetry:opentelemetry-exporter-prometheus:1.3.0-alpha'
520-
dependency 'io.prometheus:simpleclient:0.8.1'
521-
dependency 'io.prometheus:simpleclient_httpserver:0.8.1'
522-
dependency 'io.opentelemetry:opentelemetry-exporter-zipkin:1.3.0'
523-
dependency 'io.opentelemetry:opentelemetry-semconv:1.3.0-alpha'
524-
dependency 'io.opentelemetry:opentelemetry-exporter-jaeger:1.4.0'
484+
dependency 'io.opentelemetry:opentelemetry-api:1.36.0'
485+
dependency 'io.opentelemetry:opentelemetry-sdk:1.36.0'
486+
dependency 'io.opentelemetry:opentelemetry-sdk-metrics:1.36.0'
487+
dependency 'io.opentelemetry:opentelemetry-exporter-prometheus:1.36.0-alpha'
488+
dependency 'io.opentelemetry:opentelemetry-exporter-zipkin:1.36.0'
489+
dependency 'io.opentelemetry:opentelemetry-semconv:1.30.1-alpha'
490+
dependency 'io.opentelemetry:opentelemetry-exporter-jaeger:1.34.1'
525491

526492
dependency "io.openmessaging:openmessaging-api:2.2.1-pubsub"
527493

eventmesh-common/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ dependencies {
3232

3333
api "com.alibaba.fastjson2:fastjson2"
3434

35-
implementation "org.apache.logging.log4j:log4j-api"
36-
implementation "org.apache.logging.log4j:log4j-core"
37-
implementation "org.apache.logging.log4j:log4j-slf4j2-impl"
35+
runtimeOnly "org.apache.logging.log4j:log4j-core"
36+
runtimeOnly "org.apache.logging.log4j:log4j-slf4j2-impl"
3837

3938
implementation 'com.github.seancfoley:ipaddress'
4039

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.eventmesh.common;
19+
20+
21+
public class MetricsConstants {
22+
23+
private MetricsConstants() {
24+
25+
}
26+
27+
public static final String UNKOWN = "unkown";
28+
29+
public static final String LABEL_PROCESSOR = "processor";
30+
31+
public static final String CLIENT_ADDRESS = "client.address";
32+
33+
public static final String RPC_SYSTEM = "rpc.system";
34+
35+
public static final String RPC_SERVICE = "rpc.service";
36+
37+
//GRPC-https://opentelemetry.io/docs/reference/specification/metrics/semantic_conventions/rpc-metrics/
38+
public static final String GRPC_NET_PEER_PORT = "net.peer.port";
39+
40+
public static final String GRPC_NET_PEER_NAME = "net.peer.name";
41+
42+
public static final String GRPC_NET_SOCK_PEER_ADDR = "net.sock.peer.addr";
43+
44+
public static final String GRPC_NET_SOCK_PEER_PORT = "net.sock.peer.port";
45+
46+
// HTTP https://opentelemetry.io/docs/reference/specification/metrics/semantic_conventions/http-metrics/
47+
48+
public static final String HTTP_HTTP_SCHEME = "http.scheme";
49+
50+
public static final String HTTP_HTTP_FLAVOR = "http.flavor";
51+
52+
public static final String HTTP_NET_HOST_NAME = "net.host.name";
53+
54+
public static final String HTTP_NET_HOST_PORT = "net.host.port";
55+
56+
//TCP
57+
public static final String TCP_NET_HOST_NAME = "net.host.name";
58+
59+
public static final String TCP_NET_HOST_PORT = "net.host.port";
60+
61+
62+
public static final String CLIENT_PROTOCOL_TYPE = "client.protocol.type";
63+
64+
65+
}

0 commit comments

Comments
 (0)