You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by lu...@apache.org on 2023/11/15 06:38:51 UTC
(skywalking-go) branch fix-wrong-dir-structure created (now 2d9e964)
This is an automated email from the ASF dual-hosted git repository.
lujiajing pushed a change to branch fix-wrong-dir-structure
in repository https://gitbox.apache.org/repos/asf/skywalking-go.git
at 2d9e964 fix wrong plugin structure
This branch includes the following new commits:
new 2d9e964 fix wrong plugin structure
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(skywalking-go) 01/01: fix wrong plugin structure
Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lujiajing pushed a commit to branch fix-wrong-dir-structure
in repository https://gitbox.apache.org/repos/asf/skywalking-go.git
commit 2d9e9649457c75e12ec2501c56272629642efff6
Author: Megrez Lu <lu...@gmail.com>
AuthorDate: Wed Nov 15 14:36:57 2023 +0800
fix wrong plugin structure
---
go.work.sum | 16 ++----
plugins/trace-activation/instrument.go | 62 ++++++++++++++--------
.../{ => trace}/add_log_intercepter.go | 0
.../{ => trace}/async_finish_intercepter.go | 0
.../{ => trace}/async_log_intercepter.go | 0
.../{ => trace}/async_prepare_intercepter.go | 0
.../{ => trace}/async_tag_intercepter.go | 0
.../{ => trace}/capture_intercepter.go | 0
.../{ => trace}/continue_intercepter.go | 0
.../{ => trace}/correlation_get_intercepter.go | 0
.../{ => trace}/correlation_set_intercepter.go | 0
.../{ => trace}/create_entryspan_intercepter.go | 0
.../{ => trace}/create_exitspan_intercepter.go | 0
.../{ => trace}/create_localspan_intercepter.go | 0
.../{ => trace}/get_segmentid_intercepter.go | 0
.../{ => trace}/get_spanid_intercepter.go | 0
.../{ => trace}/get_traceid_intercepter.go | 0
.../{ => trace}/set_component_interceptor.go | 0
.../{ => trace}/set_name_intercepter.go | 0
.../{ => trace}/set_tag_intercepter.go | 0
.../{ => trace}/stopspan_intercepter.go | 0
test/plugins/scenarios/plugin_exclusion/go.sum | 33 ++++++++++++
tools/go-agent/instrument/plugins/instrument.go | 14 +++--
23 files changed, 89 insertions(+), 36 deletions(-)
diff --git a/go.work.sum b/go.work.sum
index 74ee681..566b746 100644
--- a/go.work.sum
+++ b/go.work.sum
@@ -829,8 +829,6 @@ github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2Vvl
github.com/exoscale/egoscale v0.46.0/go.mod h1:mpEXBpROAa/2i5GC0r33rfxG+TxSEka11g1PIXt9+zc=
github.com/exoscale/egoscale v0.67.0 h1:qgWh7T5IZGrNWtg6ib4dr+76WThvB+odTtGG+DGbXF8=
github.com/exoscale/egoscale v0.67.0/go.mod h1:wi0myUxPsV8SdEtdJHQJxFLL/wEw9fiw9Gs1PWRkvkM=
-github.com/fasthttp/router v1.0.2 h1:rdYdcAmwOLqWuFgc4afa409SYmuw4t0A66K5Ib+GT3I=
-github.com/fasthttp/router v1.0.2/go.mod h1:Myk/ofrwtfiLSCIfbE44+e+PyP3mR6JhZg3AYzqwJI0=
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 h1:Ghm4eQYC0nEPnSJdVkTrXpu9KtoVCSo1hg7mtI7G9KU=
github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
@@ -1146,7 +1144,6 @@ github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHz
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4=
github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE=
-github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.10.5/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
@@ -1154,7 +1151,6 @@ github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQan
github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kElDUEM=
github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w=
-github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/knadh/koanf v1.4.4/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs=
github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs=
github.com/koding/multiconfig v0.0.0-20171124222453-69c27309b2d7 h1:SWlt7BoQNASbhTUD0Oy5yysI2seJ7vWuGUp///OM4TM=
@@ -1416,6 +1412,8 @@ github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCko
github.com/performancecopilot/speed v3.0.0+incompatible h1:2WnRzIquHa5QxaJKShDkLM+sc0JPuwhXzK8OYOyt3Vg=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
+github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw=
+github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0=
github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A=
github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0=
github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
@@ -1474,8 +1472,6 @@ github.com/sagikazarmark/crypt v0.4.0 h1:Rqcx6Sf/bWQUmmfGQhcFx3wQQEfb2UZWhAKvGRa
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU=
github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
-github.com/savsgio/gotils v0.0.0-20200319105752-a9cc718f6a3f h1:XfUnevLK4O22at3R77FlyQHKwlQs75LELdsH2wRX2KQ=
-github.com/savsgio/gotils v0.0.0-20200319105752-a9cc718f6a3f/go.mod h1:lHhJedqxCoHN+zMtwGNTXWmF0u9Jt363FYRhV6g0CdY=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210127161313-bd30bebeac4f h1:WSnaD0/cvbKJgSTYbjAPf4RJXVvNNDAwVm+W8wEmnGE=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210127161313-bd30bebeac4f/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/sclevine/spec v1.2.0 h1:1Jwdf9jSfDl9NVmt8ndHqbTZ7XCCPbh1jI3hkDBHVYA=
@@ -1542,6 +1538,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.287/go.mod
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.287 h1:O/ycBVvdOAmwFlXm0fCtLz2WOr1EaWZQTDM/4pmVT+s=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.287/go.mod h1:CuOaLxOQr477GhMWAQPYQFUJrsZbW+ZqkAgP2uHDZXg=
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
+github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0=
+github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw=
github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw=
github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM=
github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=
@@ -1567,14 +1565,9 @@ github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/valyala/fasthttp v0.0.0-20171207120941-e5f51c11919d/go.mod h1:+g/po7GqyG5E+1CNgquiIxJnsXEi5vwFn5weFujbO78=
github.com/valyala/fasthttp v0.1.0/go.mod h1:t3OdzjTRgk6Z0UTItK5gxQindPvtd5fPpkV/vXcGOZU=
-github.com/valyala/fasthttp v1.9.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w=
-github.com/valyala/fasthttp v1.10.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=
-github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
-github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
-github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
github.com/vinyldns/go-vinyldns v0.0.0-20200917153823-148a5f6b8f14/go.mod h1:RWc47jtnVuQv6+lY3c768WtXCas/Xi+U5UFc5xULmYg=
github.com/vinyldns/go-vinyldns v0.9.16 h1:GZJStDkcCk1F1AcRc64LuuMh+ENL8pHA0CVd4ulRMcQ=
github.com/vinyldns/go-vinyldns v0.9.16/go.mod h1:5qIJOdmzAnatKjurI+Tl4uTus7GJKJxb+zitufjHs3Q=
@@ -1747,7 +1740,6 @@ golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
diff --git a/plugins/trace-activation/instrument.go b/plugins/trace-activation/instrument.go
index cf73421..479ef0a 100644
--- a/plugins/trace-activation/instrument.go
+++ b/plugins/trace-activation/instrument.go
@@ -39,7 +39,7 @@ func (i *Instrument) Name() string {
}
func (i *Instrument) BasePackage() string {
- return "github.com/apache/skywalking-go/toolkit/trace"
+ return "github.com/apache/skywalking-go/toolkit"
}
func (i *Instrument) VersionChecker(version string) bool {
@@ -49,82 +49,102 @@ func (i *Instrument) VersionChecker(version string) bool {
func (i *Instrument) Points() []*instrument.Point {
return []*instrument.Point{
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStructEnhance("SpanRef"),
+ PackagePath: "trace",
+ At: instrument.NewStructEnhance("SpanRef"),
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("CreateEntrySpan"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("CreateEntrySpan"),
Interceptor: "CreateEntrySpanInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("CreateLocalSpan"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("CreateLocalSpan"),
Interceptor: "CreateLocalSpanInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("CreateExitSpan"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("CreateExitSpan"),
Interceptor: "CreateExitSpanInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("StopSpan"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("StopSpan"),
Interceptor: "StopSpanInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("CaptureContext"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("CaptureContext"),
Interceptor: "CaptureContextInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("ContinueContext"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("ContinueContext"),
Interceptor: "ContinueContextInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("GetTraceID"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("GetTraceID"),
Interceptor: "GetTraceIDInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("GetSegmentID"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("GetSegmentID"),
Interceptor: "GetSegmentIDInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("GetSpanID"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("GetSpanID"),
Interceptor: "GetSpanIDInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewMethodEnhance("*SpanRef", "SetTag"),
+ PackagePath: "trace",
+ At: instrument.NewMethodEnhance("*SpanRef", "SetTag"),
Interceptor: "AsyncTagInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewMethodEnhance("*SpanRef", "AddLog"),
+ PackagePath: "trace",
+ At: instrument.NewMethodEnhance("*SpanRef", "AddLog"),
Interceptor: "AsyncLogInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("AddLog"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("AddLog"),
Interceptor: "AddLogInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("SetTag"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("SetTag"),
Interceptor: "SetTagInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("SetOperationName"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("SetOperationName"),
Interceptor: "SetOperationNameInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewMethodEnhance("*SpanRef", "PrepareAsync"),
+ PackagePath: "trace",
+ At: instrument.NewMethodEnhance("*SpanRef", "PrepareAsync"),
Interceptor: "PrepareAsyncInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewMethodEnhance("*SpanRef", "AsyncFinish"),
+ PackagePath: "trace",
+ At: instrument.NewMethodEnhance("*SpanRef", "AsyncFinish"),
Interceptor: "AsyncFinishInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("GetCorrelation"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("GetCorrelation"),
Interceptor: "GetCorrelationInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("SetCorrelation"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("SetCorrelation"),
Interceptor: "SetCorrelationInterceptor",
},
{
- PackagePath: "", PackageName: "trace", At: instrument.NewStaticMethodEnhance("SetComponent"),
+ PackagePath: "trace",
+ At: instrument.NewStaticMethodEnhance("SetComponent"),
Interceptor: "SetComponentInterceptor",
},
}
diff --git a/plugins/trace-activation/add_log_intercepter.go b/plugins/trace-activation/trace/add_log_intercepter.go
similarity index 100%
rename from plugins/trace-activation/add_log_intercepter.go
rename to plugins/trace-activation/trace/add_log_intercepter.go
diff --git a/plugins/trace-activation/async_finish_intercepter.go b/plugins/trace-activation/trace/async_finish_intercepter.go
similarity index 100%
rename from plugins/trace-activation/async_finish_intercepter.go
rename to plugins/trace-activation/trace/async_finish_intercepter.go
diff --git a/plugins/trace-activation/async_log_intercepter.go b/plugins/trace-activation/trace/async_log_intercepter.go
similarity index 100%
rename from plugins/trace-activation/async_log_intercepter.go
rename to plugins/trace-activation/trace/async_log_intercepter.go
diff --git a/plugins/trace-activation/async_prepare_intercepter.go b/plugins/trace-activation/trace/async_prepare_intercepter.go
similarity index 100%
rename from plugins/trace-activation/async_prepare_intercepter.go
rename to plugins/trace-activation/trace/async_prepare_intercepter.go
diff --git a/plugins/trace-activation/async_tag_intercepter.go b/plugins/trace-activation/trace/async_tag_intercepter.go
similarity index 100%
rename from plugins/trace-activation/async_tag_intercepter.go
rename to plugins/trace-activation/trace/async_tag_intercepter.go
diff --git a/plugins/trace-activation/capture_intercepter.go b/plugins/trace-activation/trace/capture_intercepter.go
similarity index 100%
rename from plugins/trace-activation/capture_intercepter.go
rename to plugins/trace-activation/trace/capture_intercepter.go
diff --git a/plugins/trace-activation/continue_intercepter.go b/plugins/trace-activation/trace/continue_intercepter.go
similarity index 100%
rename from plugins/trace-activation/continue_intercepter.go
rename to plugins/trace-activation/trace/continue_intercepter.go
diff --git a/plugins/trace-activation/correlation_get_intercepter.go b/plugins/trace-activation/trace/correlation_get_intercepter.go
similarity index 100%
rename from plugins/trace-activation/correlation_get_intercepter.go
rename to plugins/trace-activation/trace/correlation_get_intercepter.go
diff --git a/plugins/trace-activation/correlation_set_intercepter.go b/plugins/trace-activation/trace/correlation_set_intercepter.go
similarity index 100%
rename from plugins/trace-activation/correlation_set_intercepter.go
rename to plugins/trace-activation/trace/correlation_set_intercepter.go
diff --git a/plugins/trace-activation/create_entryspan_intercepter.go b/plugins/trace-activation/trace/create_entryspan_intercepter.go
similarity index 100%
rename from plugins/trace-activation/create_entryspan_intercepter.go
rename to plugins/trace-activation/trace/create_entryspan_intercepter.go
diff --git a/plugins/trace-activation/create_exitspan_intercepter.go b/plugins/trace-activation/trace/create_exitspan_intercepter.go
similarity index 100%
rename from plugins/trace-activation/create_exitspan_intercepter.go
rename to plugins/trace-activation/trace/create_exitspan_intercepter.go
diff --git a/plugins/trace-activation/create_localspan_intercepter.go b/plugins/trace-activation/trace/create_localspan_intercepter.go
similarity index 100%
rename from plugins/trace-activation/create_localspan_intercepter.go
rename to plugins/trace-activation/trace/create_localspan_intercepter.go
diff --git a/plugins/trace-activation/get_segmentid_intercepter.go b/plugins/trace-activation/trace/get_segmentid_intercepter.go
similarity index 100%
rename from plugins/trace-activation/get_segmentid_intercepter.go
rename to plugins/trace-activation/trace/get_segmentid_intercepter.go
diff --git a/plugins/trace-activation/get_spanid_intercepter.go b/plugins/trace-activation/trace/get_spanid_intercepter.go
similarity index 100%
rename from plugins/trace-activation/get_spanid_intercepter.go
rename to plugins/trace-activation/trace/get_spanid_intercepter.go
diff --git a/plugins/trace-activation/get_traceid_intercepter.go b/plugins/trace-activation/trace/get_traceid_intercepter.go
similarity index 100%
rename from plugins/trace-activation/get_traceid_intercepter.go
rename to plugins/trace-activation/trace/get_traceid_intercepter.go
diff --git a/plugins/trace-activation/set_component_interceptor.go b/plugins/trace-activation/trace/set_component_interceptor.go
similarity index 100%
rename from plugins/trace-activation/set_component_interceptor.go
rename to plugins/trace-activation/trace/set_component_interceptor.go
diff --git a/plugins/trace-activation/set_name_intercepter.go b/plugins/trace-activation/trace/set_name_intercepter.go
similarity index 100%
rename from plugins/trace-activation/set_name_intercepter.go
rename to plugins/trace-activation/trace/set_name_intercepter.go
diff --git a/plugins/trace-activation/set_tag_intercepter.go b/plugins/trace-activation/trace/set_tag_intercepter.go
similarity index 100%
rename from plugins/trace-activation/set_tag_intercepter.go
rename to plugins/trace-activation/trace/set_tag_intercepter.go
diff --git a/plugins/trace-activation/stopspan_intercepter.go b/plugins/trace-activation/trace/stopspan_intercepter.go
similarity index 100%
rename from plugins/trace-activation/stopspan_intercepter.go
rename to plugins/trace-activation/trace/stopspan_intercepter.go
diff --git a/test/plugins/scenarios/plugin_exclusion/go.sum b/test/plugins/scenarios/plugin_exclusion/go.sum
new file mode 100644
index 0000000..d5ff894
--- /dev/null
+++ b/test/plugins/scenarios/plugin_exclusion/go.sum
@@ -0,0 +1,33 @@
+github.com/bytedance/sonic v1.8.8 h1:Kj4AYbZSeENfyXicsYppYKO0K2YWab+i2UTSY7Ukz9Q=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
+github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8=
+github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
+github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
+github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
+github.com/go-playground/validator/v10 v10.13.0 h1:cFRQdfaSMCOSfGCCLB20MHvuoHb/s5G8L5pu2ppK5AQ=
+github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
+github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
+github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
+github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
+github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
+github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
+github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
+github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
+golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
+golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
+golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
+golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
+golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
+google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/tools/go-agent/instrument/plugins/instrument.go b/tools/go-agent/instrument/plugins/instrument.go
index f9154fe..9f3ff9a 100644
--- a/tools/go-agent/instrument/plugins/instrument.go
+++ b/tools/go-agent/instrument/plugins/instrument.go
@@ -21,6 +21,7 @@ import (
"bytes"
"embed"
"fmt"
+ "go/build"
"go/parser"
"go/token"
"io/fs"
@@ -63,11 +64,14 @@ type Instrument struct {
extraFilesWrote bool
importAnalyzer *tools.ImportAnalyzer
+ workingDir string
}
func NewInstrument() *Instrument {
+ wd, _ := os.Getwd()
return &Instrument{
importAnalyzer: tools.CreateImportAnalyzer(),
+ workingDir: wd,
}
}
@@ -107,9 +111,8 @@ func (i *Instrument) CouldHandle(opts *api.CompileOptions) bool {
// check the version of the framework could handler
version, err := i.tryToFindThePluginVersion(opts, ins)
if err != nil {
- // Local package (e.g. replaced toolkit) does not have version.
- // So when the version is not detected, we should not skip it.
- logrus.Warnf("the plugin %s %s", ins.Name(), err)
+ logrus.Warnf("ignore the plugin %s, because %s", ins.Name(), err)
+ continue
}
if ins.VersionChecker(version) {
@@ -551,6 +554,11 @@ func (i *Instrument) tryToFindThePluginVersion(opts *api.CompileOptions, ins ins
continue
}
+ // support local import. example: arg=../../../../toolkit/trace/api.go
+ if build.IsLocalImport(arg) {
+ continue
+ }
+
// example: github.com/Shopify/sarama
basePkg := ins.BasePackage()