Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go generate fails with mdatagen error #33603

Closed
jlg-io opened this issue Jun 17, 2024 · 3 comments
Closed

go generate fails with mdatagen error #33603

jlg-io opened this issue Jun 17, 2024 · 3 comments
Labels
question Further information is requested

Comments

@jlg-io
Copy link
Contributor

jlg-io commented Jun 17, 2024

Component(s)

receiver/vcenter

What happened?

Description

Trying to add a new metric for an existing receiver (vcenterreceiver) following CONTRIBUTING.md and got the following error :

doc.go:4: running "mdatagen": exec: "mdatagen": executable file not found in $PATH

Steps to Reproduce

  • Run cd receiver/redisreceiver
  • Run go generate ./...

Expected Result

It should update documentation and the generated_* files

Actual Result

doc.go:4: running "mdatagen": exec: "mdatagen": executable file not found in $PATH

Additional tests

I also tried to run make generate from the root directory, it fails with a similar error:

running go generate ./... in ./cmd/telemetrygen
config.go:5: running "mdatagen": exec: "mdatagen": executable file not found in $PATH
make[1]: *** [Makefile:158: for-all] Error 1
make[1]: Leaving directory '/<MY_DEV_DIR>/opentelemetry-collector-contrib'
make: *** [Makefile:287: generate] Error 2

Collector version

v0.102-2.0

Environment information

Environment

OS: Ubuntu 20.04 in WSL2 (Windows 11)

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

This open issue may be related: open-telemetry/opentelemetry-collector#9281

@jlg-io jlg-io added bug Something isn't working needs triage New item requiring triage labels Jun 17, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

Hello @jlg-io, it looks like you need to add GOBIN to your shell's PATH. mdatagen is installed to your GOBIN directory when you run make generate.

GOBIN documentation

@crobert-1 crobert-1 added question Further information is requested and removed bug Something isn't working receiver/vcenter needs triage New item requiring triage labels Jun 18, 2024
@jlg-io
Copy link
Contributor Author

jlg-io commented Jun 18, 2024

Thanks @crobert-1, my GOBIN env was empty... Here what I've added to $HOME/.zshrc (I use zsh, would be different if you bash), in case it can help someone else:

export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOPATH
export PATH=$PATH:$GOBIN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants