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

New Project Proposal: Mix task to bootstrap instrmentation of a project #99

Open
tsloughter opened this issue Aug 11, 2022 · 13 comments
Open
Labels
elixir enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tsloughter
Copy link
Member

A mix task that adds dependencies like opentelemetry_phoenix to a project's mix.exs file if it see's that phoenix is a dependency.

Opening both for discussion and in hopes someone would be interested in picking up this project to add to -contrib.

@tsloughter tsloughter added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed elixir labels Aug 11, 2022
@davydog187
Copy link
Contributor

I would highly recommend taking the approach that Marlus took for Surface's init and convert tools, which makes use of sourceror for making code modifications.

@davydog187
Copy link
Contributor

I have limited time, but I'm definitely interested in helping!

@tsloughter
Copy link
Member Author

Oh nice, thanks for the sourceror suggestion.

@davydog187
Copy link
Contributor

I've been chatting with Marlus and others on the use of Sourceror for applying patches. Relevant issue doorgan/sourceror#64

@akasprzok
Copy link

@davydog187 what's the status here? Sounds like something fun to contribute to, I'd be interested.

@davydog187
Copy link
Contributor

I'm waiting on some work to be done in Sourceror that should be landing soon, then I'm gonna get started. Would you be interested in pairing once it's ready?

@akasprzok
Copy link

100%

@RichardChukwu
Copy link

Hi @davydog187 any updates on this yet? Still in progress?

@davydog187
Copy link
Contributor

Hey, no I never got around to this, but it remains an excellent idea.

Since this issue originated, we now have the Igniter by @zachdaniel that would make this way more straightforward.

I would be down to find an hour or two next week and see how far I can get

@srikanthkyatham
Copy link

@davydog187

Perhaps it could be done like this

Some steps

  1. mix igniter.gen.task add.opentelemetry_phoenix
  2. Igniter.Util.Install.get_deps!() check phoenix
  3. Igniter.Util.Install.install("opentelemetry_phoenix")

@davydog187
Copy link
Contributor

@tsloughter
Copy link
Member Author

argh! I forgot that was this morning, meant to watch live.

@davydog187
Copy link
Contributor

I've done two live streams so far and I intend to keep going until we have something working.

What we have to date:

  1. Run mix ignite.install otel
  2. Adds opentelemetry, opentelemetry_api, and opentelemetry_exporter to your mix.ex file
  3. Adds config to config/runtime.exs
  4. Detects which bridge libraries to install from contrib based on your dependencies in mix.exs, adds them as a dependency
  5. For each bridge library, inject whatever setup code / boilerplate is needed

As for bridge libraries, I've started with Phoenix but I intend to support all that are in contrib

Let me know what you think @tsloughter. I have some open questions around how the naming should work for the mix task (igniter by default uses the hex package name which is not ideal)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elixir enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants