-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Move components under new directory structure #6337
Comments
I wouldn't take the otel-go example as a north star or even as very meaningful. It was changed following a mistakenly-published Moving modules around in otel-go has also caused a number of problems as systems that depend on no-longer-extant modules and packages lead to confusing error messages. We still don't have a resolution to this issue. I would suggest that we change as little as possible, even if the grammar is occasionally annoying. |
That is not the only reason, I believe the suggestion started from this issue golang/go#30590. |
I went through other language libraries to see what they did. There seems to be no alignment on this front. The situation is as follows:
Another question (maybe you discussed on the SIG meeting) is what to do with contrib. I think internal consistency between contrib and core is more important than consistency with OTel Go. |
@mx-psi i agree consistency across core/contrib is important. The suggestion to move things to a plural directory would have an impact on contrib as well, the same work would need to be done there. I opened a PR #6343 to test using the |
More people saw that in the component I mentioned. So not sure what is your setup, I saw also that if you don't have latest golang compiler (>1.19) you don't see it. |
So digging into this a bit further, I'm convinced that the errors are showing up because of the
This is the error under go 1.13:
I was able to reproduce the same warnings by copying over a snippet of the Makefile over from
If you look at the message from the warning, it makes sense that |
So you think it is not a problem with that pattern. That is good to know. |
That's my interpretation. I do think this uncovers a bug in If you look at the original commit, it was meant to find only the files for the current module:
But with submodules inside the same directory, it's getting more than what it's intended. |
I have mixed feelings about the usage of plural vs. singular. Looking at the final package, I'd prefer it to use the singular mode ( In trying to find more authoritative opinions on this, I found this blog post from @rakyll: https://rakyll.org/style-packages/ . It could expand a bit on the reasoning, and it's somewhat old, but I don't think it's outdated. I also found a couple of other opinions pointing in the same direction, but I'm not sure how reputable those sources are, so I'll leave them out. If I were to pick one, I would stay with the singular mode: it's the least friction right now and what seems to be common practice in the Go world. |
The link you put is mostly about the final part of the package, the one that is usually used in code like |
@jpkrohling funny enough that golang official packages have couple of plurals like "strings" and "bytes" :))) |
Yeah, that was mentioned in a few of the blog posts I read as well, with the reasoning that the singular versions are reserved keywords. |
Closing this issue as components have already been moved. See #6343 |
The discussion around this was started at the SIG meeting on Oct 12, and can be partially found in this PR. Part of the work to publish components as separate go modules gives us an opportunity to decide on a path that makes most sense for these components.
Currently packages are imported as components of the
collector
package. During the discussion it was proposed that components be moved to a plural directory. For example, the OTLP exporter would be moved from:go.opentelemetry.io/collector/exporter/otlpexporter
to
go.opentelemetry.io/collector/exporters/otlpexporter
This provides a hint to users that there are additional exporters, and follows the example set by otel-go
The proposal is that all components (receivers, processors, exporters, extensions) follow this pattern. For consistency, the same pattern would be applied to the components in the contrib repository.
The text was updated successfully, but these errors were encountered: