Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ public static class Metrics {

public static final String SOURCE_ORG_ID = "source_org_id";

public static final String ORG_ID = "org_id";

public static final String ORG_NAME = "org_name";

public static final String SOURCE_PROJECT_ID = "source_project_id";

public static final String SOURCE_PROJECT_NAME = "source_project_name";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ private void recordContextSourceTag() {
String sourceInstanceId = baggage.get(Constants.Metrics.SOURCE_INSTANCE_ID);
String sourceTerminusKey = baggage.get(Constants.Metrics.SOURCE_TERMINUS_KEY);
String sourceServiceId = baggage.get(Constants.Metrics.SOURCE_SERVICE_ID);
String sourceOrgName = System.getenv("DICE_ORG_NAME");

tags.put(Constants.Metrics.SOURCE_ADDON_TYPE_METRIC, sourceAddonType);
tags.put(Constants.Metrics.SOURCE_ADDON_ID_METRIC, sourceAddonId);
Expand All @@ -128,6 +129,8 @@ private void recordContextSourceTag() {
tags.put(Constants.Metrics.SOURCE_INSTANCE_ID, sourceInstanceId);
tags.put(Constants.Metrics.SOURCE_TERMINUS_KEY, sourceTerminusKey);
tags.put(Constants.Metrics.SOURCE_SERVICE_ID, sourceServiceId);
tags.put(Constants.Metrics.ORG_NAME, sourceOrgName);
tags.put(Constants.Metrics.ORG_ID, sourceOrgId);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public static TransactionMetricBuilder createHttpMetric(String host) {
public static TransactionMetricBuilder createMiroServiceMetric(String addonType) {
return (TransactionMetricBuilder)new TransactionMetricBuilder(Constants.Metrics.APPLICATION_MICRO_SERVICE, false)
.tag(Constants.Metrics.TARGET_ADDON_TYPE, addonType)
.tag(Constants.Metrics.ORG_ID, System.getenv("DICE_ORG_ID"))
.tag(Constants.Metrics.ORG_NAME, System.getenv("DICE_ORG_NAME"))
.tag(Constants.Metrics.TARGET_ADDON_ID, addonType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public void beforeMethod(IMethodInterceptContext context, MethodInterceptResult
.tag(Constants.Tags.PEER_SERVICE, invoker.getInterface().getName() + "." + invocation.getMethodName())
.tag(Constants.Tags.DB_HOST, rpcContext.getLocalAddressString())
.tag(Constants.Tags.DUBBO_SERVICE, invoker.getInterface().getName())
.tag(Constants.Metrics.ORG_ID, System.getenv("DICE_ORG_ID"))
.tag(Constants.Metrics.ORG_NAME, System.getenv("DICE_ORG_NAME"))
.tag(Constants.Tags.DUBBO_METHOD, invocation.getMethodName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public void beforeMethod(IMethodInterceptContext context, MethodInterceptResult
.tag(Constants.Tags.PEER_SERVICE, invoker.getInterface().getName() + "." + invocation.getMethodName())
.tag(Constants.Tags.DB_HOST, rpcContext.getLocalAddressString())
.tag(Constants.Tags.DUBBO_SERVICE, invoker.getInterface().getName())
.tag(Constants.Metrics.ORG_ID, System.getenv("DICE_ORG_ID"))
.tag(Constants.Metrics.ORG_NAME, System.getenv("DICE_ORG_NAME"))
.tag(Constants.Tags.DUBBO_METHOD, invocation.getMethodName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public void beforeMethod(IMethodInterceptContext context, MethodInterceptResult
.tag(Constants.Tags.DB_HOST, connectInfo.getDatabasePeer())
.tag(Constants.Tags.DB_INSTANCE, connectInfo.getDatabaseName())
.tag(Constants.Tags.DB_STATEMENT, statement)
.tag(Constants.Metrics.ORG_ID, System.getenv("DICE_ORG_ID"))
.tag(Constants.Metrics.ORG_NAME, System.getenv("DICE_ORG_NAME"))
.tag(Constants.Tags.DB_SYSTEM, connectInfo.getDBType());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public void beforeMethod(IMethodInterceptContext context, MethodInterceptResult
.tag(Constants.Tags.PEER_HOSTNAME, peer)
.tag(Constants.Tags.DB_HOST, peer)
.tag(Constants.Tags.DB_STATEMENT, statement)
.tag(Constants.Metrics.ORG_ID, System.getenv("DICE_ORG_ID"))
.tag(Constants.Metrics.ORG_NAME, System.getenv("DICE_ORG_NAME"))
.tag(Constants.Tags.DB_SYSTEM, Constants.Tags.DB_TYPE_REDIS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public void beforeMethod(IMethodInterceptContext context, MethodInterceptResult
.tag(Constants.Tags.PEER_SERVICE, peer)
.tag(Constants.Tags.DB_HOST, peer)
.tag(Constants.Tags.DB_STATEMENT, dbStatement.toString())
.tag(Constants.Metrics.ORG_ID, System.getenv("DICE_ORG_ID"))
.tag(Constants.Metrics.ORG_NAME, System.getenv("DICE_ORG_NAME"))
.tag(Constants.Tags.DB_SYSTEM, Constants.Tags.DB_TYPE_REDIS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public void beforeMethod(IMethodInterceptContext context, MethodInterceptResult
.tag(Constants.Tags.PEER_HOSTNAME, peer)
.tag(Constants.Tags.DB_HOST, peer)
.tag(Constants.Tags.DB_STATEMENT, dbStatement.toString())
.tag(Constants.Metrics.ORG_ID, System.getenv("DICE_ORG_ID"))
.tag(Constants.Metrics.ORG_NAME, System.getenv("DICE_ORG_NAME"))
.tag(Constants.Tags.DB_SYSTEM, Constants.Tags.DB_TYPE_REDIS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public void beforeMethod(IMethodInterceptContext context, MethodInterceptResult
.tag(SPAN_KIND, SPAN_KIND_PRODUCER)
.tag(PEER_ADDRESS, nameServerAddress)
.tag(DB_HOST, nameServerAddress)
.tag(Constants.Metrics.ORG_ID, System.getenv("DICE_ORG_ID"))
.tag(Constants.Metrics.ORG_NAME, System.getenv("DICE_ORG_NAME"))
.tag(MESSAGE_BUS_DESTINATION, message.getTopic());
if (IS_SYNC.get()) {
context.setAttachment(Constants.Keys.METRIC_BUILDER, transactionMetricBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ private void preRequest(IMethodInterceptContext context, HttpServletRequest requ
span.tag(Constants.Tags.SPAN_LAYER, Constants.Tags.SPAN_LAYER_HTTP);
span.tag(Constants.Tags.SPAN_KIND, Constants.Tags.SPAN_KIND_SERVER);
span.tag(Constants.Tags.COMPONENT, getComponent());
span.tag(Constants.Metrics.ORG_NAME, System.getenv("DICE_ORG_NAME"));
span.tag(Constants.Metrics.ORG_ID, System.getenv("DICE_ORG_ID"));
span.log(DateTime.currentTimeNano()).event(LogFields.Event, "server received");
if (Strings.isEmpty(request.getRequestURI())) {
return;
Expand Down
1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ cat > "dist/erda-java-agent/build" <<EOF
${BUILD_VERSION}
EOF

# in darwin os, use this command choose jdk 8 version JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_371`
mvn clean package -Dmaven.test.skip=true