-
Notifications
You must be signed in to change notification settings - Fork 878
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong dubbo trace caused by using rpcContext.isProviderSide() (#1…
…2930) Co-authored-by: Lauri Tulmin <ltulmin@splunk.com> Co-authored-by: Lauri Tulmin <tulmin@gmail.com>
- Loading branch information
1 parent
e12ae97
commit ca3fbac
Showing
10 changed files
with
175 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...o/opentelemetry/javaagent/instrumentation/apachedubbo/v2_7/OpenTelemetryClientFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.javaagent.instrumentation.apachedubbo.v2_7; | ||
|
||
import org.apache.dubbo.common.extension.Activate; | ||
import org.apache.dubbo.rpc.Filter; | ||
import org.apache.dubbo.rpc.Invocation; | ||
import org.apache.dubbo.rpc.Invoker; | ||
import org.apache.dubbo.rpc.Result; | ||
|
||
@Activate(group = {"consumer"}) | ||
public final class OpenTelemetryClientFilter implements Filter { | ||
|
||
private final Filter delegate; | ||
|
||
public OpenTelemetryClientFilter() { | ||
delegate = DubboSingletons.CLIENT_FILTER; | ||
} | ||
|
||
@Override | ||
public Result invoke(Invoker<?> invoker, Invocation invocation) { | ||
return delegate.invoke(invoker, invocation); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...o/opentelemetry/javaagent/instrumentation/apachedubbo/v2_7/OpenTelemetryServerFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.javaagent.instrumentation.apachedubbo.v2_7; | ||
|
||
import org.apache.dubbo.common.extension.Activate; | ||
import org.apache.dubbo.rpc.Filter; | ||
import org.apache.dubbo.rpc.Invocation; | ||
import org.apache.dubbo.rpc.Invoker; | ||
import org.apache.dubbo.rpc.Result; | ||
|
||
@Activate(group = {"provider"}) | ||
public final class OpenTelemetryServerFilter implements Filter { | ||
|
||
private final Filter delegate; | ||
|
||
public OpenTelemetryServerFilter() { | ||
delegate = DubboSingletons.SERVER_FILTER; | ||
} | ||
|
||
@Override | ||
public Result invoke(Invoker<?> invoker, Invocation invocation) { | ||
return delegate.invoke(invoker, invocation); | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...bo-2.7/javaagent/src/main/resources/apache-dubbo-2.7/META-INF/org.apache.dubbo.rpc.Filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
io.opentelemetry.javaagent.instrumentation.apachedubbo.v2_7.OpenTelemetryFilter | ||
io.opentelemetry.javaagent.instrumentation.apachedubbo.v2_7.OpenTelemetryClientFilter | ||
io.opentelemetry.javaagent.instrumentation.apachedubbo.v2_7.OpenTelemetryServerFilter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ain/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/OpenTelemetryServerFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.apachedubbo.v2_7; | ||
|
||
import io.opentelemetry.api.GlobalOpenTelemetry; | ||
import org.apache.dubbo.common.extension.Activate; | ||
import org.apache.dubbo.rpc.Filter; | ||
import org.apache.dubbo.rpc.Invocation; | ||
import org.apache.dubbo.rpc.Invoker; | ||
import org.apache.dubbo.rpc.Result; | ||
|
||
@Activate(group = {"provider"}) | ||
public final class OpenTelemetryServerFilter implements Filter { | ||
|
||
private final Filter delegate; | ||
|
||
public OpenTelemetryServerFilter() { | ||
delegate = DubboTelemetry.create(GlobalOpenTelemetry.get()).newServerFilter(); | ||
} | ||
|
||
@Override | ||
public Result invoke(Invoker<?> invoker, Invocation invocation) { | ||
return delegate.invoke(invoker, invocation); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
....7/library-autoconfigure/src/main/resources/META-INF/services/org.apache.dubbo.rpc.Filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
io.opentelemetry.instrumentation.apachedubbo.v2_7.OpenTelemetryFilter | ||
io.opentelemetry.instrumentation.apachedubbo.v2_7.OpenTelemetryClientFilter | ||
io.opentelemetry.instrumentation.apachedubbo.v2_7.OpenTelemetryServerFilter |