-
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
Make collector flag functions public to allow collector builders to use them #5130
Conversation
f1a8df9
to
4f8ffe5
Compare
Codecov Report
@@ Coverage Diff @@
## main #5130 +/- ##
==========================================
- Coverage 89.96% 89.91% -0.06%
==========================================
Files 183 183
Lines 11104 11106 +2
==========================================
- Hits 9990 9986 -4
- Misses 889 894 +5
- Partials 225 226 +1
Continue to review full report at Codecov.
|
…ccess them directly
4f8ffe5
to
9e4d0c7
Compare
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.
I have a philosophical question: Who is the user of the "Flags" API? Do we want to support the use-case where users are writing their own "main" func, or we support only the use-case where they use the builder?
I see the builder as one user that writes its own main func. Users may use the builder once and adapt the generated source code for their needs. |
This change is needed for collector distributions relying on custom config provider |
@neelayu we have an issue to allow custom providers and did 80% of that work already.. Next reason :) |
So the builder should/can generate that file as well? We should not offer that in our "distributed" modules. |
@bogdandrutu Are you talking about this PR #4936? |
People can use the builder to create their own distributions. The recommendation is to just use a manifest file and let the builder generate the sources and compile a binary, but I do see how people would be interested in just generating a bootstrap code and adapt it from there. This is why we have the option "--skip-compilation". In fact, we have something similar for the contrib repository: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/cmd/otelcontribcol |
@jpkrohling correct... but do we want to support the use-case where they manually write all the files? |
We do not want to support the conflict resolution between the generated sources and the customizations, but we want to support the source code generation, especially if users find it easier to check the manifests vs. the main.go file. As a developer of a downstream distribution, I would probably isolate my changes outside of the generated files, perhaps just adding a line or two to call my custom func defined elsewhere. Otherwise, I wouldn't see the point in generating the main func. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
This is the set of public changes required for #4977. After that, we need to wait for a release before making changes in that PR.
Part of #4967