-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
otlptranslator: fix up import paths #13759
Conversation
This is intentional actually, as the files are |
I don't think that it is intentional, there is shell script that adjusts the import paths for this bit of code https://github.com/prometheus/prometheus/blob/main/storage/remote/otlptranslator/update-copy.sh among other things. For the record just go test/build running in GOPATH mode not liking it. |
Maybe I understood it backwards, but the
/.prometheus as well now)
I'll cc @gouthamve to get a confirmation that the script and the README need to be adapted. |
I suspect that update-copy.sh should also fix the import paths in the prometheus/ directory. |
Yup! I agreee with @machine424 and @aknuds1 , we probably need to update the script to update all the import paths and dont leave any files behind, maybe those files were introduced later and hence the issue. The reason why we do this with the import paths is that the code from the otel contrib repo still is the source of truth. We cant just import it because there is a cycilical dependency so what we do is try to keep prometheus updated with it. This is not the best scenario but until prometheus becomes the source of truth for that code its what we've got. @jcajka maybe you'd like to update the script to sed all the imports properly instead? |
I believe that this is the case that the package should be used just under one import path(the canonical one) per the https://go.dev/doc/go1.4#canonicalimports. |
Signed-off-by: Jakub Čajka <jcajka@redhat.com>
Done. Tested by running the script, creates no changes to the tree for me locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for your contributions @jcajka! |
Thank you all for quick review and feedback |
Fix up inline import paths. These get ignored most of the time by the Go module based tooling, but GOPATH based tooling expects it to match the real import path.