Skip to content

Commit

Permalink
moves off deprecated error code in dubbo
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
Adrian Cole committed Jan 6, 2024
1 parent e250f09 commit d88ccab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 The OpenZipkin Authors
* Copyright 2013-2024 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -13,6 +13,7 @@
*/
package brave.dubbo.rpc;

import brave.rpc.RpcTracing;
import brave.test.ITRemote;
import com.alibaba.dubbo.common.extension.ExtensionLoader;
import com.alibaba.dubbo.config.ReferenceConfig;
Expand All @@ -32,7 +33,7 @@ public abstract class ITTracingFilter extends ITRemote {
TracingFilter init() {
TracingFilter filter = (TracingFilter) ExtensionLoader.getExtensionLoader(Filter.class)
.getExtension("tracing");
filter.setTracing(tracing);
filter.setRpcTracing(RpcTracing.create(tracing));
return filter;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 The OpenZipkin Authors
* Copyright 2013-2024 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -205,7 +205,7 @@ class ITTracingFilter_Consumer extends ITTracingFilter {
MutableSpan span =
testSpanHandler.takeRemoteSpanWithErrorMessage(CLIENT, ".*Not found exported service.*");
assertThat(span.tags())
.containsEntry("dubbo.error_code", "1");
.containsEntry("rpc.error_code", "NETWORK_EXCEPTION");
}

/** Shows if you aren't using RpcTracing, the old "dubbo.error_code" works */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 The OpenZipkin Authors
* Copyright 2013-2024 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -13,6 +13,7 @@
*/
package brave.dubbo;

import brave.rpc.RpcTracing;
import brave.test.ITRemote;
import org.apache.dubbo.common.extension.ExtensionLoader;
import org.apache.dubbo.config.ApplicationConfig;
Expand Down Expand Up @@ -44,7 +45,7 @@ static ApplicationConfig getApplicationConfig() {
TracingFilter init() {
TracingFilter filter = (TracingFilter) ExtensionLoader.getExtensionLoader(Filter.class)
.getExtension("tracing");
filter.setTracing(tracing);
filter.setRpcTracing(RpcTracing.create(tracing));
return filter;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 The OpenZipkin Authors
* Copyright 2013-2024 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -236,7 +236,7 @@ class ITTracingFilter_Consumer extends ITTracingFilter {
testSpanHandler.takeRemoteSpanWithErrorMessage(CLIENT, ".*Fail to decode request.*");

assertThat(span.tags())
.containsEntry("dubbo.error_code", "1");
.containsEntry("rpc.error_code", "NETWORK_EXCEPTION");
}

/** Shows if you aren't using RpcTracing, the old "dubbo.error_code" works */
Expand Down

0 comments on commit d88ccab

Please sign in to comment.