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

Any plans for tickster as a library? #239

Closed
jacksontj opened this issue Jun 15, 2019 · 8 comments
Closed

Any plans for tickster as a library? #239

jacksontj opened this issue Jun 15, 2019 · 8 comments
Assignees
Labels
2.0 release Feature/Fix will be available in 2.0 Release enhancement New feature or request refactor Optimize or modernize existing code

Comments

@jacksontj
Copy link
Contributor

I see in the new 1.x branch that the code is no longer in the root of the repo (yay!), but I do see that most of the code is under internal which means that trickster wouldn't be usable as a library anywhere-- are there any plans to allow/enable this type of usage?

@jranson jranson added the question question from issue initiator or assignee label Jun 15, 2019
@jranson
Copy link
Member

jranson commented Jun 19, 2019

That definitely sounds interesting! We've been intentionally placing things deemed worthy of import by other projects into pkg, with the criteria of being simple, useful, portable and unique; and keeping the currently-less-sharable stuff in internal. With 1.0, the intent is to make things as generic, yet customizable, as possible for the existing users and developers. So those exposed packages fit that theme. I would say when we get next merged into master, we can start working on getting more of the core trickster packages into pkg so long as they are refactored to be a little more generic and less intertwined with each other. And with that, help is definitely welcomed :)

@jranson
Copy link
Member

jranson commented Aug 16, 2019

@jacksontj there is some interest in giving this a look by a few other stakeholders from the Trickster community. @dmitsh and @alfred-landrum from Sysdig demonstrated to me a prom-specific working POC of an importable Trickster package; it looks like a really good starting point for this feature.

One of the things I am concerned about getting right is ensuring that we make make the package solution simple, easy-to-use and future proof. As we are planning to expose Trickster's HTTP Reverse Proxy/Cache abilities as an origin type itself (outside of time series accelerators) in 1.0, a single generic library may or may not be the best idea. So I think the options are, 1) come up with a single package that is designed well enough to flexibly support all origin types (including non-timeseries caching), or 2) expose origin-type-specific libraries (e.g., /pkg/trickster/prometheus, /pkg/trickster/hrpc) that would be scoped for the features for the specific origin type.

I see benefits to both approaches. Everyone who has inquired about this is developing a solution for Prometheus, so it's possible that Option 2 is more desirable. I invite everyone with an opinion to chime in on this issue so that we can make the right choices. Based on the consensus here, we can come up with the final design and get it shipped. Thanks to everyone for their interest and feedback!

@dmitsh
Copy link

dmitsh commented Aug 16, 2019

I've posted a PR #262 with our proposed approach. This PR incorporates @jranson idea of origin-type-specific libraries.

@jacksontj
Copy link
Contributor Author

My initial thinking is that approach #2 would be beneficial -- as each system has their own client types etc -- so it would be nice if they mirrored the upstreams. Then trickster the binary could use those same libraries itself (meaning the http -> library translation is done presumably in another library).

@jranson jranson self-assigned this Sep 6, 2019
@jranson jranson added 2.x release Feature will be available in a future version of 2.x but not slated for 2.0 enhancement New feature or request refactor Optimize or modernize existing code and removed question question from issue initiator or assignee labels Sep 7, 2019
@jranson
Copy link
Member

jranson commented Jan 18, 2020

@jacksontj @dmitsh @alfred-landrum we have finally merged next into master (I have rebased the POC PR to master). While most of the packages still reside under internal, the good news is that a major overhaul of the 1.0 codebase over the past few months means that every part of the application now uses the basic http handler components (*http.Request, http.ResponseWriter), and the specifics about the request (which cache, origin, etc) are passed with request using a context. This will make the end goal of importing a trickster library much easier to accomplish, as the exposed packages only need to set the context and then pass along the client Request and Response objects. I anticipate we can expose the packages for the library integration and have that ready to go in the next 4-6 weeks. I will follow up with you all under separate cover to coordinate when we are ready. Thanks for your patience!

@jranson jranson added 2.0 release Feature/Fix will be available in 2.0 Release and removed 2.x release Feature will be available in a future version of 2.x but not slated for 2.0 labels Feb 7, 2020
@jranson
Copy link
Member

jranson commented Mar 16, 2020

@jacksontj if you'd like to hit me up via email, we'd love to put some time on the calendar to talk about this issue and get it ready for release.

@jranson
Copy link
Member

jranson commented May 6, 2020

All, as of today, internal is no more in master, and all packages are relocated to pkg for importation. The pre-release v1.1.0-beta should be usable in go.mod. We've love some feedback on how we can better structure the package layout to be more accessible and portable.

We will still provide more streamlined packages in v1.2 that are specifically meant to facilitate using Trickster as a router handler. I will keep this issue open until that release is cut. It would be great if anyone who plans to use any of this functionality could get in touch to help us drive our roadmap. Thanks!

@jranson
Copy link
Member

jranson commented Apr 24, 2021

closing as implemented

@jranson jranson closed this as completed Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 release Feature/Fix will be available in 2.0 Release enhancement New feature or request refactor Optimize or modernize existing code
Projects
None yet
Development

No branches or pull requests

3 participants