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

discussion: reduce number of packages in the sdk #119

Open
LukeWinikates opened this issue Oct 27, 2022 · 1 comment
Open

discussion: reduce number of packages in the sdk #119

LukeWinikates opened this issue Oct 27, 2022 · 1 comment
Milestone

Comments

@LukeWinikates
Copy link
Contributor

I think this sdk should have a single public package, and that package should be named wavefront.

I've noticed that telegraf imports only the senders package from this repo, and aliases it to wavefront

import (
    ...
	wavefront "github.com/wavefronthq/wavefront-sdk-go/senders"
)

that means they create a new sender by invoking wavefront.NewSender, which I think looks better than senders.NewSender

I think we could consider moving the exported members from senders, histogram, and event into a wavefront directory/package, and move most of their unexported members into internal.

This would be a big change, but I do think it would make the API of the SDK easier to learn and so I'd like to consider changing this before v1

@LukeWinikates
Copy link
Contributor Author

Looking at #143 , I have a couple of new thoughts on this:

  • wavefrontSender has a large implementation. I think we could move that type into an internal subpackage
  • the histogram, event, etc. packages are each very small, and having these types in separate packages means that you have to add multiple imports just to send a histogram or a span. I think that it'd be more convenient if those types moved into the senders package.

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