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

Splitting discovery to a separate repo #2911

Open
gouthamve opened this Issue Jul 6, 2017 · 24 comments

Comments

Projects
None yet
9 participants
@gouthamve
Copy link
Member

gouthamve commented Jul 6, 2017

I think we have the best service-discovery library for Go. @juliusv Once told me that one thing that puts Prometheus apart is its ability to detect targets. It would be amazing if other projects could also use this.

Those familiar with Prometheus have already started using it (Loki and Influxdb). But putting it in its own repo would increase the usage and IMO also attract new contributors who would be using it.

Current users I know of:

Potential users:

  • Traefik: Even these guys have bugs against their discovery
  • Fabio: The issue linked seems to reject new discovery mechanisms because to dev-complexity but k8s is obviously wanted.

*** other lbs, health-check systems and who knows?

/cc @fabxc @brian-brazil @TheTincho @cstyan (guessed it from the thread on -dev, sorry if wrong)

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jul 6, 2017

/cc @nathanielc and @pauldix from InfluxData might find this interesting as well.

@cstyan

This comment has been minimized.

Copy link
Contributor

cstyan commented Jul 6, 2017

I agree that it probably makes sense to split the generic service discovery code out into it's own library, but given the list of immediate needs in @brian-brazil email I think this is probably a nice to have at the moment.

It's still probably a good idea to discuss and document what would need to happen for this effort to go forward.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jul 6, 2017

@cstyan On the other hand, splitting it out into a first-class open-source citizen would increase the visibility and prestige of it as a project. It would also encourage others to use, adopt, and help maintain it. So IMO it'd probably be worth it.

@TheTincho

This comment has been minimized.

Copy link
Contributor

TheTincho commented Jul 7, 2017

I think this is a good idea, if there is already interest from other projects.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

I dumped my thoughts on IRC before seeing this thread. I cleaned it up and copied it below:

From a Go perspective, it doesn't matter at all whether discovery is a directory in prometheus/prometheus or its own repo. It already is its own library. Projects interested in using it draw no technical benefit from a changed import path.

This also came up for PromQL in the past – essentially it's proposing moving towards a model where all the cool stuff is its own repo (tsdb, discovery, promql) and just stichting it together in prometheus/prometheus and adding and API.

That's what k8s is moving towards.... but they literally have a bunch of people working on each of those things they are extracting. We don't.
We have a rather low number of active developers, thus we can be pretty liberal with changes in different packages to make something work in others – we don't have to worry much about breaking other pieces of the project. Being more diligent about only doing so when necessary for certain packages is something that can be done without splitting it into its own repo. In fact, we have hardly touched exported APIs of discovery and PromQL for a long time now.

Factoring stuff out into their own repos comes with a significant cost. We have seen that with common/model, common/route, common/log. Even prometheus/prometheus is notoriously out of sync with their HEAD. (I started all those btw and caused this pain to begin with, much with the same good intentions.)
prometheus/prometheus is effectively where stuff happens – Alertmanager ist kinda big as well, but much more spiky in its activity and they are totally different aside from the notion of labels.

In the end we've to think what does factoring discovery, promql, etc. out buy us? Some more visibility for sure. But practically it doesn't get any more usable as a standalone package than before. Improving prometheus-independent usability is a package internal concern and I think discovery is doing quite well there.

In prometheus/tsdb that reason was having tight (self-)control for no prometheus specific details to leak into TSDB (i.e. doing hacks in tsdb instead of refactoring the big picture to accommodate use cases.). Also, we have interest in doing infrequent and careful syncs into prometheus/prometheus as we will inevitably break TSDB in ways that may affect persisted data. Broken Prometheus releases that cannot be recovered from by deploying an updated binary must be avoided.

tl;dr I recommend only splitting it out if there is a human problem in the development cycle to solve – breaking out repos always makes development harder for an individual developer.

All those things are and will be subject to constant reconsideration as the project evolves – right now we have an imminent issue of maintainability to solve and a bunch of people seem to be signing up to volunteer on the mailing list thread. Practically, those won't all convert into long-term maintainers – but we should do our best to aim for this of course.
I believe making a such a big structural change is giving us a feeling of progress rather than actual one at this point.
A lot of concerns can be addressed simply by providing better docs/examples/readme for individual packages in the existing tree.

@tcolgate

This comment has been minimized.

Copy link
Contributor

tcolgate commented Jul 7, 2017

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

A proper Go vendoring tool won't vendor the whole prometheus/prometheus tree but just the packages you are using and its transitive dependencies. Glide, dep, govendor, and others all do this. Which one are you using?
If it's a proper one and you still pull in most packages, then it's an issue of dependency structure. This also has to be solved at the package level and won't magically disappear by moving it into its own repo.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jul 7, 2017

My thoughts are generally in line with Fabian.

I do believe that SD is something it'd be good to offer as distinct library to users at some point, independent of its use in the Prometheus monitoring system. I also believe the state of that subsystem and the current level of contributors for project generally doesn't allow us to offer up what would be another major component to users.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

I just checked, and we have very little deps on other Prometheus packages. But naturally on a lot of external ones. The latter can be fixed by moving to a composing pattern where discovery doesn't have an uber-constructor for all known intergrations.

$ go list -f '{{.Deps}}' | tr "[" " " | tr "]" " " | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
github.com/prometheus/prometheus/config
github.com/prometheus/prometheus/discovery/azure
github.com/prometheus/prometheus/discovery/consul
github.com/prometheus/prometheus/discovery/dns
github.com/prometheus/prometheus/discovery/ec2
github.com/prometheus/prometheus/discovery/file
github.com/prometheus/prometheus/discovery/gce
github.com/prometheus/prometheus/discovery/kubernetes
github.com/prometheus/prometheus/discovery/marathon
github.com/prometheus/prometheus/discovery/openstack
github.com/prometheus/prometheus/discovery/triton
github.com/prometheus/prometheus/discovery/zookeeper
github.com/prometheus/prometheus/util/httputil
github.com/prometheus/prometheus/util/strutil
github.com/prometheus/prometheus/util/treecache
github.com/prometheus/prometheus/vendor/github.com/Azure/azure-sdk-for-go/arm/compute
github.com/prometheus/prometheus/vendor/github.com/Azure/azure-sdk-for-go/arm/network
github.com/prometheus/prometheus/vendor/github.com/Azure/go-autorest/autorest
github.com/prometheus/prometheus/vendor/github.com/Azure/go-autorest/autorest/azure
github.com/prometheus/prometheus/vendor/github.com/Azure/go-autorest/autorest/date
github.com/prometheus/prometheus/vendor/github.com/Azure/go-autorest/autorest/to
github.com/prometheus/prometheus/vendor/github.com/Azure/go-autorest/autorest/validation
github.com/prometheus/prometheus/vendor/github.com/PuerkitoBio/purell
github.com/prometheus/prometheus/vendor/github.com/PuerkitoBio/urlesc
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/awserr
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/awsutil
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/client
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/client/metadata
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/corehandlers
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/credentials
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/defaults
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/request
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/session
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/aws/signer/v4
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/private/endpoints
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/private/protocol
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/private/protocol/query
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/private/protocol/rest
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/private/waiter
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/service/ec2
github.com/prometheus/prometheus/vendor/github.com/aws/aws-sdk-go/service/sts
github.com/prometheus/prometheus/vendor/github.com/beorn7/perks/quantile
github.com/prometheus/prometheus/vendor/github.com/davecgh/go-spew/spew
github.com/prometheus/prometheus/vendor/github.com/dgrijalva/jwt-go
github.com/prometheus/prometheus/vendor/github.com/docker/distribution/digest
github.com/prometheus/prometheus/vendor/github.com/docker/distribution/reference
github.com/prometheus/prometheus/vendor/github.com/emicklei/go-restful
github.com/prometheus/prometheus/vendor/github.com/emicklei/go-restful/log
github.com/prometheus/prometheus/vendor/github.com/emicklei/go-restful/swagger
github.com/prometheus/prometheus/vendor/github.com/ghodss/yaml
github.com/prometheus/prometheus/vendor/github.com/go-ini/ini
github.com/prometheus/prometheus/vendor/github.com/go-openapi/jsonpointer
github.com/prometheus/prometheus/vendor/github.com/go-openapi/jsonreference
github.com/prometheus/prometheus/vendor/github.com/go-openapi/spec
github.com/prometheus/prometheus/vendor/github.com/go-openapi/swag
github.com/prometheus/prometheus/vendor/github.com/gogo/protobuf/proto
github.com/prometheus/prometheus/vendor/github.com/gogo/protobuf/sortkeys
github.com/prometheus/prometheus/vendor/github.com/golang/glog
github.com/prometheus/prometheus/vendor/github.com/golang/protobuf/proto
github.com/prometheus/prometheus/vendor/github.com/google/gofuzz
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/openstack
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/images
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/openstack/utils
github.com/prometheus/prometheus/vendor/github.com/gophercloud/gophercloud/pagination
github.com/prometheus/prometheus/vendor/github.com/hashicorp/consul/api
github.com/prometheus/prometheus/vendor/github.com/hashicorp/go-cleanhttp
github.com/prometheus/prometheus/vendor/github.com/hashicorp/serf/coordinate
github.com/prometheus/prometheus/vendor/github.com/jmespath/go-jmespath
github.com/prometheus/prometheus/vendor/github.com/juju/ratelimit
github.com/prometheus/prometheus/vendor/github.com/mailru/easyjson/buffer
github.com/prometheus/prometheus/vendor/github.com/mailru/easyjson/jlexer
github.com/prometheus/prometheus/vendor/github.com/mailru/easyjson/jwriter
github.com/prometheus/prometheus/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil
github.com/prometheus/prometheus/vendor/github.com/miekg/dns
github.com/prometheus/prometheus/vendor/github.com/prometheus/client_golang/prometheus
github.com/prometheus/prometheus/vendor/github.com/prometheus/client_model/go
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/expfmt
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/log
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model
github.com/prometheus/prometheus/vendor/github.com/prometheus/procfs
github.com/prometheus/prometheus/vendor/github.com/samuel/go-zookeeper/zk
github.com/prometheus/prometheus/vendor/github.com/sirupsen/logrus
github.com/prometheus/prometheus/vendor/github.com/spf13/pflag
github.com/prometheus/prometheus/vendor/github.com/ugorji/go/codec
github.com/prometheus/prometheus/vendor/golang.org/x/net/context
github.com/prometheus/prometheus/vendor/golang.org/x/net/context/ctxhttp
github.com/prometheus/prometheus/vendor/golang.org/x/net/http2
github.com/prometheus/prometheus/vendor/golang.org/x/net/http2/hpack
github.com/prometheus/prometheus/vendor/golang.org/x/net/idna
github.com/prometheus/prometheus/vendor/golang.org/x/net/lex/httplex
github.com/prometheus/prometheus/vendor/golang.org/x/oauth2
github.com/prometheus/prometheus/vendor/golang.org/x/oauth2/google
github.com/prometheus/prometheus/vendor/golang.org/x/oauth2/internal
github.com/prometheus/prometheus/vendor/golang.org/x/oauth2/jws
github.com/prometheus/prometheus/vendor/golang.org/x/oauth2/jwt
github.com/prometheus/prometheus/vendor/golang.org/x/sys/unix
github.com/prometheus/prometheus/vendor/golang.org/x/text/cases
github.com/prometheus/prometheus/vendor/golang.org/x/text/internal/tag
github.com/prometheus/prometheus/vendor/golang.org/x/text/language
github.com/prometheus/prometheus/vendor/golang.org/x/text/runes
github.com/prometheus/prometheus/vendor/golang.org/x/text/secure/bidirule
github.com/prometheus/prometheus/vendor/golang.org/x/text/secure/precis
github.com/prometheus/prometheus/vendor/golang.org/x/text/transform
github.com/prometheus/prometheus/vendor/golang.org/x/text/unicode/bidi
github.com/prometheus/prometheus/vendor/golang.org/x/text/unicode/norm
github.com/prometheus/prometheus/vendor/golang.org/x/text/width
github.com/prometheus/prometheus/vendor/google.golang.org/api/compute/v1
github.com/prometheus/prometheus/vendor/google.golang.org/api/gensupport
github.com/prometheus/prometheus/vendor/google.golang.org/api/googleapi
github.com/prometheus/prometheus/vendor/google.golang.org/api/googleapi/internal/uritemplates
github.com/prometheus/prometheus/vendor/google.golang.org/cloud/compute/metadata
github.com/prometheus/prometheus/vendor/google.golang.org/cloud/internal
github.com/prometheus/prometheus/vendor/gopkg.in/fsnotify.v1
github.com/prometheus/prometheus/vendor/gopkg.in/inf.v0
github.com/prometheus/prometheus/vendor/gopkg.in/yaml.v2
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/api/errors
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/api/meta
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/api/resource
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/apimachinery
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/apimachinery/announced
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/apimachinery/registered
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/apis/meta/v1
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/conversion
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/conversion/queryparams
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/fields
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/labels
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/openapi
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/runtime
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/runtime/schema
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/runtime/serializer
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/runtime/serializer/recognizer
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/runtime/serializer/streaming
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/selection
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/types
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/diff
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/errors
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/framer
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/intstr
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/json
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/net
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/rand
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/runtime
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/sets
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/validation
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/validation/field
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/wait
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/util/yaml
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/version
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/pkg/watch
github.com/prometheus/prometheus/vendor/k8s.io/apimachinery/third_party/forked/golang/reflect
github.com/prometheus/prometheus/vendor/k8s.io/client-go/discovery
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/scheme
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2alpha1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/batch/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/core/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/storage/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/api
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/api/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/api/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/apps
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/apps/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/apps/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/authentication
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/authentication/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/authentication/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/authentication/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/authorization
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/authorization/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/authorization/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/authorization/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/autoscaling
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/autoscaling/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/autoscaling/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/autoscaling/v2alpha1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/batch
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/batch/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/batch/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/batch/v2alpha1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/certificates
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/certificates/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/certificates/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/extensions
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/extensions/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/extensions/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/policy
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/policy/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/policy/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/rbac
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/rbac/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/rbac/v1alpha1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/rbac/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/settings
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/settings/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/settings/v1alpha1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/storage
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/storage/install
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/storage/v1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/apis/storage/v1beta1
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/util
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/util/parsers
github.com/prometheus/prometheus/vendor/k8s.io/client-go/pkg/version
github.com/prometheus/prometheus/vendor/k8s.io/client-go/rest
github.com/prometheus/prometheus/vendor/k8s.io/client-go/rest/watch
github.com/prometheus/prometheus/vendor/k8s.io/client-go/tools/cache
github.com/prometheus/prometheus/vendor/k8s.io/client-go/tools/clientcmd/api
github.com/prometheus/prometheus/vendor/k8s.io/client-go/tools/metrics
github.com/prometheus/prometheus/vendor/k8s.io/client-go/transport
github.com/prometheus/prometheus/vendor/k8s.io/client-go/util/cert
github.com/prometheus/prometheus/vendor/k8s.io/client-go/util/clock
github.com/prometheus/prometheus/vendor/k8s.io/client-go/util/flowcontrol
github.com/prometheus/prometheus/vendor/k8s.io/client-go/util/integer
@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

I do believe that SD is something it'd be good to offer as distinct library to users at some point, independent of its use in the Prometheus monitoring system. I also believe the state of that subsystem and the current level of contributors for project generally doesn't allow us to offer up what would be another major component to users.

My argument was also that it already is a distinct library that can be used outside of Prometheus easily. And people doing so is proof of that. This is not the property a separate repo addresses.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jul 7, 2017

My argument was also that it already is a distinct library that can be used outside of Prometheus easily. And people doing so is proof of that. This is not the property a separate repo addresses.

It can be used, however we don't currently support that as it falls under our default rule that we reserve the right to break internals. If we plan to officially support using this beyond Prometheus internals, then moving to a different repo would be one clear way to signal that.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

FWIW, we don't have such a non-breakage policy for top-level repos either.
As mentioned, discovery hardly changed its API in a long time. And if we were to create a policy, which can be applied to packages and repos alike, we wouldn't want to make it one prohibiting breakage altogether either. We would rather pretty much proceed as we did so far. This strengthens my point that we are not actually solving any existing problems.

Ultimately, the Go world vendors and occasionally breaking packages to allow them to evolve is not much of an issue.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jul 7, 2017

@fabxc That's a good point. The trade-off here is visibility / prestige of this library as an independently useful project vs. the convenience for the specific use and development of it in Prometheus. We don't have to make this decision right now, but I still feel that if we want to become the standard Go library for SD (with all the benefits that gives the Prometheus project in turn), having it as a separate repository would help.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

We don't have to make this decision right now, but I still feel that if we want to become the standard Go library for SD (with all the benefits that gives the Prometheus project in turn), having it as a separate repository would help.

What would those benefits be precisely? And how exactly does the additional /prometheus/ in the import path prevent them?

I'm sure @peterbourgon has relevant insight on all of this.

@peterbourgon

This comment has been minimized.

Copy link
Contributor

peterbourgon commented Jul 7, 2017

Experience has burned this hard lesson into me: the ongoing costs to keep multiple repos in sync cannot be understated. IMO such an action requires quite concrete technical or process justification, speculation about how it would be nice for some secondary use cases is wildly insufficient.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jul 7, 2017

@fabxc The benefits of it becoming the standard Go SD library? I would expect that it would attract more maintainers and contributions, leading to stabilization, testing, and eventually more mechanisms. It would also reflect well on the Prometheus project in general.

@tcolgate

This comment has been minimized.

Copy link
Contributor

tcolgate commented Jul 7, 2017

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

The benefits of it becoming the standard Go SD library

That seems like a very high-set goal that ultimately depends on credible projects adopting it. Influx seems like one of those projects and it apparently was not a blocker.

It's purely a visibility thing (imposed by the GitHub UI) and it seems like this can be significantly improved via other means. Such as giving the package a README, documenting usage examples and projects using it, linking to it from other places...

As a developer, I only care about whether the package does not pull an entire project as transitive dependencies, which is an orthogonal issue.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jul 7, 2017

That seems like a very high-set goal

I think it's pretty realistic, given that there's not much competition, and given that there'll be more and more interest in SD in the future, as infrastructure becomes more dynamic. The only worry here would be that others would start building their own implementations if they get the impression that ours is not meant to be used outside of Prometheus, or not sufficiently standalone / stable.

As a developer, I only care about whether the package does not pull an entire project as transitive dependencies

Not really, when you look for a library to use, you also care about subtle psychological aspects like it being its own repo or not, and all that subtly implies.

Again, I think given the doubts, we should shelve this for now, but I think the idea still has merit to potentially explore further at a later point.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

Not really, when you look for a library to use, you also care about subtle psychological aspects like it being its own repo or not, and all that subtly implies.

Fair, this is one factor, which we have not yet confirmed to be limiting to our goal. Yesterday I still thought we were just looking for more maintainers – so those ambitions come a bit surprisingly right now.

not meant to be used outside of Prometheus, or not sufficiently standalone / stable.

All those can be addressed in a more proactive and effective manner than eliminating a potential subconscious indicator for them.
General usage can be documented and encouraged, standalone-ness and stability are package-level concerns addressed through code – and straight out telling people its a generally stable package.

I see all your arguments but as Peter said, this transition does not just have a one-time cost but maintainers will pay the price again and again forever. And we have to consider whether the single reason of (not) sending a subconscious signal is worth it – especially if we haven't determined whether this is actually true.
My guess is that lack of docs is a much more severe adoption inhibitor.

By the way, some day CNCF may come around and start their official SD project, which we might notably steer or not. Then all of this is may become obsolete again.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jul 7, 2017

Yeah, I see your points of course. Let's agree to close this for now and see first how it goes with new maintainers, then possibly reconsider at a later point? Maybe if we get more opinions from existing or prospective external users, or the field is developing in some relevant way.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

To be clear, I'm not arguing this strongly for the sake of this single package. But because promql/ will be the natural next choice. The further in we get the lower the bar for extraction will become. And suddenly we are doing 2-5 sync-merges a day, encounter unexpected breakage because contracts are broken. Then we may get into automated tooling to trigger testing across repos.

The rabbit hole doesn't really end and it will need at least half an FTE to maintain everything brought on by this structure.

@nathanielc

This comment has been minimized.

Copy link

nathanielc commented Jul 10, 2017

Adding my thoughts here from Influx since we already pulled in discovery as a dependency. There was no need for discovery to be its own repo, but it wasn't clear when we started the work if it would actually be possible to use the package externally.

Having an independent repo is not particularly important but improving the visibility of the package as consumable externally is a good goal. Here are some points already made in this thread but I'll reiterate the ones that are important to us.

  • A README in the package explaining how it can be used externally with some examples would have significantly reduce the initial exploratory work, but was obviously not necessary.
  • Making some external API changes to the discovery package would make it easier to consume. One change already mentioned is possibly "moving to a composing pattern where discovery doesn't have an uber-constructor for all known integrations".
  • Making the discovery package standalone so that it doesn't require as many other transitive deps from the prometheus/prometheus repo when not necessary would help.

Slightly unrelated but I thought I would add here for completeness, we (influxdata/kapacitor) are currently also making use of the retrival package as well, but plan to replace the targetmanager with our own implementation as we have different needs. @goller did most of the work on the integration and can clarify any of the details if needed.

TL;DR A separate repo is not important, communicating that the package can be used externally is valuable.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 10, 2017

Thanks for the insight from an external users' perspective @nathanielc
It would indeed be interesting what the different needs for the Targetmanager are. We could possibly collaborate to at least make different parts more reusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.