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

Build info flag #4671

Closed
fld-opensource opened this issue Jan 12, 2022 · 15 comments · Fixed by #6322
Closed

Build info flag #4671

fld-opensource opened this issue Jan 12, 2022 · 15 comments · Fixed by #6322
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@fld-opensource
Copy link
Contributor

When using the stock collector, a custom build, it would nice to have something like a --build-info, it would output pretty version of the manifest (yaml config) used for the build. I would then be easy to see what receivers, exporters, processor etc ... we have built in.

@jpkrohling
Copy link
Member

@esnible, this is similar to the PR you sent recently. Do you think this would have helped you debug problems with missing components?

@jpkrohling jpkrohling added the enhancement New feature or request label Jan 12, 2022
@esnible
Copy link
Contributor

esnible commented Jan 12, 2022

@jpkrohling Yes, I believe it would be valuable to be able to find out what components are compiled in.
Doing this as a flag is OK. I'd rather ALWAYS see this information. Often I have the collector running on a pod I can't exec into, and I don't know what it offers. There isn't much of a downside towards always logging or printing this information.

It might also be good to include commit/version in the info output, perhaps using the technique of https://belief-driven-design.com/build-time-variables-in-go-51439b26ef9/ , for both opentelementry-collector and -contrib.

@jpkrohling
Copy link
Member

We do have the commit/version already as part of the bootstrap logs and I agree it should definitely be part of the build info command.

@jpkrohling jpkrohling added the good first issue Good for newcomers label Jan 14, 2022
@cuichenli
Copy link

i would like to work on this if it is ok.

@jpkrohling
Copy link
Member

@bogdandrutu, @tigrannajaryan, is this something that would be accepted?

@bogdandrutu
Copy link
Member

Happy to support this, but we need to look into:

  1. Avoid having multiple ways of printing same thing, right now we already have "--version" flag.
  2. Define what format to use (yaml, json, free text)?

@tigrannajaryan
Copy link
Member

Related to #5438

@Chinwendu20
Copy link
Contributor

Hi @cuichenli, are you still working on this? I will like to take this up

@cuichenli
Copy link

Hi @Chinwendu20 , no, I am not working on this.

@Chinwendu20
Copy link
Contributor

Okay thanks, I would work on this. I just want to clarify that by a stock collector you mean, a custom built collector distribution. @fld-opensource

@tigrannajaryan
Copy link
Member

Define what format to use (yaml, json, free text)?

I would definitely prefer this to be in a machine-readable format. Something like yaml is probably best since we can make it both reasonably human-readable and can also use for programmatic use-cases like this.

@Chinwendu20
Copy link
Contributor

Hello @jpkrohling please could you point me to the bootstrap logs that you speak of? Does it mean that after the distribution is creation, there is a place the YAML config for generating it is stored?

We do have the commit/version already as part of the bootstrap logs and I agree it should definitely be part of the build info command.

@Chinwendu20
Copy link
Contributor

Is this a correct visual representation of what the build-info flag should ouput?

image

@jpkrohling
Copy link
Member

If you can generate a builder manifest like that, it would be great, but I don't think it's easily doable. It would already be useful to print out the list of components available, plus the version of the distribution. To get the version of the distribution, take a look at the output printed in the logs when starting the collector: there's already the build version there. When you find where this is printed, you'll find where the version information is stored.

@Chinwendu20
Copy link
Contributor

Thanks for this @jpkrohling on it now

Chinwendu20 added a commit to Chinwendu20/opentelemetry-collector that referenced this issue Oct 15, 2022
Chinwendu20 added a commit to Chinwendu20/opentelemetry-collector that referenced this issue Oct 15, 2022
Chinwendu20 added a commit to Chinwendu20/opentelemetry-collector that referenced this issue Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants