Closed Alleysira closed 2 months ago
https://github.com/googleapis/go-genproto/issues/1015 You can check if your google.golang.org/genproto
version is too old. You can upgrade the version of google.golang.org/genproto
to the latest
module mingin
go 1.21.4
require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0
go.opentelemetry.io/otel v1.29.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0
go.opentelemetry.io/otel/sdk v1.29.0
google.golang.org/grpc v1.65.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1
google.golang.org/protobuf v1.34.2
)
require (
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/uuid v1.6.0 // indirect
go.opentelemetry.io/otel/metric v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
I've made a demo to reproduce your problem, I upgrade the google.golang.org/genproto
version to v0.0.0-20240823204242-4ba0660f739c
and the problem is solved.
Thanks for your quick reply, @123liuziming it works after I added a replace in go-ethereum/go.mod
replace google.golang.org/genproto => google.golang.org/genproto v0.0.0-20240822170219-fc7c04adadcd
BTW, I have another usage question: how can I get the code coverage of the instrumented binary when executing with some inputs using otelbuild? Is there any tutorial or recommended codes? Thanks in advance!
Thanks for your quick reply, @123liuziming it works after I added a replace in
go-ethereum/go.mod
replace google.golang.org/genproto => google.golang.org/genproto v0.0.0-20240822170219-fc7c04adadcd
BTW, I have another usage question: how can I get the code coverage of the instrumented binary when executing with some inputs using otelbuild? Is there any tutorial or recommended codes? Thanks in advance!
What does the code coverage
mean? You mean test coverage like jacoco?
Yes. My original purpose is to calculate the touched lines of the test binary when executing inputs using this framework.
Yes. My original purpose is to calculate the touched lines of the test binary when executing inputs using this framework.
The project is not intended to collect line coverage because we only support to insert code before and after function. We don't need to track every line of code because tracking every line is too costly to maintain the project.
The project is not intended to collect line coverage because we only support to insert code before and after function. We don't need to track every line of code because tracking every line is too costly to maintain the project.
Got it, thanks for your time and patience!
Hello, @123liuziming. Sorry for the trouble. I came to an error that everytime I use go build
to compile, it seems that instrument always happens and [instrument] log will be output even if I'm not using otelbuild
(It's weird, I have already deleted the compiled otelbuild
). For example:
alleysira@LAPTOP-M4HO8L6S:~/workspace$ go build -o sealevm
# runtime
[instrument] 2024/08/26 20:33:42 Apply file rule runtime_linker.go by APPEND mode
[instrument] 2024/08/26 20:33:42 Apply struct rule @runtime@ {g}
[instrument] 2024/08/26 20:33:42 Apply struct rule @runtime@ {g}
[instrument] 2024/08/26 20:33:42 Apply func rule @runtime@@newproc1 {defer func(){ retVal0.ot_trace_context = contextPropagate(callergp.ot_trace_context); retVal0.ot_baggage_container = contextPropagate(callergp.ot_baggage_container); }() }
[instrument] 2024/08/26 20:33:43 CompileCmd: runtime took 1.326787933s (runtime)
# database/sql
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {DB}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {DB}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {DB}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Conn}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Conn}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Conn}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Tx}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Tx}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Tx}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Stmt}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Stmt}
[instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Stmt}
[instrument] 2024/08/26 20:33:45 Apply func rule @database/sql@@(*Conn).PingContext {beforeConnPingContextInstrumentation afterConnPingContextInstrumentation}
[instrument] 2024/08/26 20:33:45 Apply func rule @database/sql@@(*Stmt).QueryContext {beforeStmtQueryContextInstrumentation afterStmtQueryContextInstrumentation}
[instrument] 2024/08/26 20:33:45 Apply func rule @database/sql@@(*Tx).ExecContext {beforeTxExecContextInstrumentation afterTxExecContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@Open {beforeOpenInstrumentation afterOpenInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).PingContext {beforePingContextInstrumentation afterPingContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Conn).PrepareContext {beforeConnPrepareContextInstrumentation afterConnPrepareContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).PrepareContext {beforePrepareContextInstrumentation afterPrepareContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Conn).QueryContext {beforeConnQueryContextInstrumentation afterConnQueryContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).QueryContext {beforeTxQueryContextInstrumentation afterTxQueryContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).Rollback {beforeTxRollbackInstrumentation afterTxRollbackInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).StmtContext {beforeTxStmtContextInstrumentation afterTxStmtContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Conn).BeginTx {beforeConnTxInstrumentation afterConnTxInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Stmt).ExecContext {beforeStmtExecContextInstrumentation afterStmtExecContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).Conn {beforeConnInstrumentation afterConnInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Conn).ExecContext {beforeConnExecContextInstrumentation afterConnExecContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).ExecContext {beforeExecContextInstrumentation afterExecContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).PrepareContext {beforeTxPrepareContextInstrumentation afterTxPrepareContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).QueryContext {beforeQueryContextInstrumentation afterQueryContextInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).BeginTx {beforeTxInstrumentation afterTxInstrumentation}
[instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).Commit {beforeTxCommitInstrumentation afterTxCommitInstrumentation}
[instrument] 2024/08/26 20:33:47 CompileCmd: database/sql took 1.734668779s (sql)
Just want to know how to get rid of this? Thanks!
Hello, @123liuziming. Sorry for the trouble. I came to an error that everytime I use
go build
to compile, it seems that instrument always happens and [instrument] log will be output even if I'm not usingotelbuild
(It's weird, I have already deleted the compiledotelbuild
). For example:alleysira@LAPTOP-M4HO8L6S:~/workspace$ go build -o sealevm # runtime [instrument] 2024/08/26 20:33:42 Apply file rule runtime_linker.go by APPEND mode [instrument] 2024/08/26 20:33:42 Apply struct rule @runtime@ {g} [instrument] 2024/08/26 20:33:42 Apply struct rule @runtime@ {g} [instrument] 2024/08/26 20:33:42 Apply func rule @runtime@@newproc1 {defer func(){ retVal0.ot_trace_context = contextPropagate(callergp.ot_trace_context); retVal0.ot_baggage_container = contextPropagate(callergp.ot_baggage_container); }() } [instrument] 2024/08/26 20:33:43 CompileCmd: runtime took 1.326787933s (runtime) # database/sql [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {DB} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {DB} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {DB} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Conn} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Conn} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Conn} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Tx} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Tx} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Tx} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Stmt} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Stmt} [instrument] 2024/08/26 20:33:45 Apply struct rule @database/sql@ {Stmt} [instrument] 2024/08/26 20:33:45 Apply func rule @database/sql@@(*Conn).PingContext {beforeConnPingContextInstrumentation afterConnPingContextInstrumentation} [instrument] 2024/08/26 20:33:45 Apply func rule @database/sql@@(*Stmt).QueryContext {beforeStmtQueryContextInstrumentation afterStmtQueryContextInstrumentation} [instrument] 2024/08/26 20:33:45 Apply func rule @database/sql@@(*Tx).ExecContext {beforeTxExecContextInstrumentation afterTxExecContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@Open {beforeOpenInstrumentation afterOpenInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).PingContext {beforePingContextInstrumentation afterPingContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Conn).PrepareContext {beforeConnPrepareContextInstrumentation afterConnPrepareContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).PrepareContext {beforePrepareContextInstrumentation afterPrepareContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Conn).QueryContext {beforeConnQueryContextInstrumentation afterConnQueryContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).QueryContext {beforeTxQueryContextInstrumentation afterTxQueryContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).Rollback {beforeTxRollbackInstrumentation afterTxRollbackInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).StmtContext {beforeTxStmtContextInstrumentation afterTxStmtContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Conn).BeginTx {beforeConnTxInstrumentation afterConnTxInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Stmt).ExecContext {beforeStmtExecContextInstrumentation afterStmtExecContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).Conn {beforeConnInstrumentation afterConnInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Conn).ExecContext {beforeConnExecContextInstrumentation afterConnExecContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).ExecContext {beforeExecContextInstrumentation afterExecContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).PrepareContext {beforeTxPrepareContextInstrumentation afterTxPrepareContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).QueryContext {beforeQueryContextInstrumentation afterQueryContextInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*DB).BeginTx {beforeTxInstrumentation afterTxInstrumentation} [instrument] 2024/08/26 20:33:46 Apply func rule @database/sql@@(*Tx).Commit {beforeTxCommitInstrumentation afterTxCommitInstrumentation} [instrument] 2024/08/26 20:33:47 CompileCmd: database/sql took 1.734668779s (sql)
Just want to know how to get rid of this? Thanks!
use go clean --cache
to get rid of this. cc @y1yang0
use
go clean --cache
to get rid of this. cc @y1yang0
Thanks for your quick reply! This works for me. I think a tip in the doc would be nice.
Update: this bug should be addressed in PR#78
@123liuziming Please help review it, thanks.
Describe the bug
otelbuild can't build go binary with error
otelbuild to build binary
Steps to reproduce
make build
.git clone https://github.com/ethereum/go-ethereum
andcd go-ethereum
cmd/evm
Expected behavior
Compile successfully.
Actual behavior
The error is too long, I will upload a txt file instead. error.txt
opentelemetry-go-auto-instrumentation version
1.0.0_7d11331
Environment
Go: go1.22.3 linux/amd64 OS: Ubuntu 20.04 in wsl
Additional context
No response