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

Module and directory naming convention #2

Open
garthk opened this issue May 10, 2020 · 5 comments
Open

Module and directory naming convention #2

garthk opened this issue May 10, 2020 · 5 comments

Comments

@garthk
Copy link
Contributor

garthk commented May 10, 2020

  • Opentelemetry or OpenTelemetry?
  • OpenTelemetrySomething or OpenTelemetry.Something? I was initially surprised at the former but I like how it avoids alias clashing with the Something
  • opentelemetry/something or open_telemetry/something or open_telemetry_something or opentelemetry_something?

Asking because I've already been inconsistent in my opentelemetry_honeycomb and this project is doing something else again. :)

@garthk
Copy link
Contributor Author

garthk commented May 17, 2020

@tsloughter?

@garthk
Copy link
Contributor Author

garthk commented Mar 7, 2021

I'm going to follow the convention of opentelemetry_api having OpenTelemetry.Span in lib/open_telemetry/span.ex. If that needs a PR, so be it. :)

@tsloughter
Copy link
Contributor

I did lib/open_telemetry/ since OpenTelemetry is how the project name is written, maybe was the wrong way to go.

Whether this is OpenTelemetry.Plug or OpenTelemetryPlug is partly an idiomatic Elixir question, right? But then also a question about the "namespacing"? I think its fine to use OpenTelemetry.Plug and we should be consistent so would suggest updating. But I should not be deciding what is idiomatic Elixir :)

Hell, for elixir integrations we could have a single app and do OpenTelemetryContrib.Plug, OpenTelemetryContrib.Honeycomb, etc?

I guess also OpenTelemetryContrib.Plug could be used without all of them being in the same application.

@garthk
Copy link
Contributor Author

garthk commented Mar 8, 2021

Yeah, I get a little uncomfortable with the last word in a module matching the last word in another module eg. Plug and OpenTelemetry.Plug, but that ship has sailed. Popular projects are rife with it.

Strikes me you could have a contrib directory in the main repo if everyone was happy with the CLA, else in a separate opentelemetry_contrib repo. Either way you'd have contrib/opentelemetry_plug/lib/open_telemetry/contrib/plug.ex defining a module OpenTelemetry.Contrib.Plug for the Plug integration.

At the top level, you could have one app try to drag them all in, but eventually you'd run into trouble when integrations for modules X and Y turned out to have different requirements for a shared dependency Z.

@garthk
Copy link
Contributor Author

garthk commented Mar 9, 2021

Oh, bit of a corner: if I'm not creating a directory under lib for lib/open_telemetry/plug.ex, I'm likely to stick with lib/opentelemetry_plug.ex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants