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

Expose data from rule component #92

Merged
merged 6 commits into from
Nov 28, 2017
Merged

Expose data from rule component #92

merged 6 commits into from
Nov 28, 2017

Conversation

fabxc
Copy link
Collaborator

@fabxc fabxc commented Nov 27, 2017

@Bplotka

I'm writing an e2e test for the rule<>query interaction now but this code here is good for review already.

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just some questions (:

met := grpc_prometheus.NewServerMetrics()
met.EnableHandlingTimeHistogram(
grpc_prometheus.WithHistogramBuckets([]float64{
0.001, 0.01, 0.05, 0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 6.4,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we ensure that all of these are the same across all thanos Grpc clients/servers i.e fetch it from common var

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want that though? Right now they are the same but they are also just guesses at this point.
We might find out different components have different performance characteristics and different buckets could make sense.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm

"gopkg.in/alecthomas/kingpin.v2"
)

// registerRule registers a rule command.
func registerRule(m map[string]setupFunc, app *kingpin.Application, name string) {
cmd := app.Command(name, "query node exposing PromQL enabled Query API with data retrieved from multiple store nodes")

lsetStr := cmd.Flag("labels", "labels applying to all generated metrics").
PlaceHolder("<labels>").String()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not sticking to the slicing providing by kingpin (Strings()). Seems not-consistent here to allow for , delimiter suddenly and everywhere else not (e.g known-hosts)

--label="a=1" --label="b=1"
will give use [a=1, b=2] array

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid point :)

@@ -249,7 +249,7 @@ func encodeChunk(ss []prompb.Sample, mint int64) (storepb.Chunk_Encoding, []byte

// translateAndExtendLabels transforms a metrics into a protobuf label set. It additionally
// attaches the given labels to it, overwriting existing ones on colllision.
func translateAndExtendLabels(m []prompb.Label, extend labels.Labels) []storepb.Label {
func (p *PrometheusProxy) translateAndExtendLabels(m []prompb.Label, extend labels.Labels) []storepb.Label {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this and above? no need for that if these function are not using anything from this struct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, can see now, these methods needs to be different for TSDB Store and you want to stick to the same naming.. Lgtm

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, it's just about namespacing them.

return status.Error(codes.InvalidArgument, err.Error())
}

// TODO(fabxc): an improvement over this trivial approach would be to directly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/an/An

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: Why we need that improvement? What is the bottleneck here? (: Sorry.. it is not so straightforward.. We use chunks provided by TSDB right? We just encode it to match our gRPC proto

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we would need to transform to storepb.Chunk anyway. But the .Data field is just an opaque byte slice and we could just take those bytes as they exist in TSDB since the chunk XOR encoding is the same.

Instead we decode chunks in TSDB and create a new chunk. That's just wasted work really.
But it's easier for now and I don't know how performance relevant it would be anyway.

@@ -232,7 +232,7 @@ func extLabelsMatches(extLabels labels.Labels, ms []storepb.LabelMatcher) (bool,

// encodeChunk translates the sample pairs into a chunk. It takes a minimum timestamp
// and drops all samples before that one.
func encodeChunk(ss []prompb.Sample, mint int64) (storepb.Chunk_Encoding, []byte, error) {
func (p *PrometheusProxy) encodeChunk(ss []prompb.Sample, mint int64) (storepb.Chunk_Encoding, []byte, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually PrometheusProxy could be now PrometheusStore to be consistent with other namings, right? (:

// Series returns all series for a requested time range and label matcher. The returned data may
// exceed the requested time bounds.
//
// Prometheus's range query API is not suitable to give us all datapoints. We use the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover copypasta?

@fabxc
Copy link
Collaborator Author

fabxc commented Nov 28, 2017

PTAL

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@fabxc fabxc merged commit f7af1bb into master Nov 28, 2017
@bwplotka bwplotka deleted the rulestore branch December 11, 2018 13:26
fpetkovski added a commit to fpetkovski/thanos that referenced this pull request Mar 13, 2023
Disable vertical compaction for downsampled blocks
saswatamcode pushed a commit to saswatamcode/thanos that referenced this pull request May 10, 2024
Signed-off-by: Subbarao Meduri <smeduri@redhat.com>
saswatamcode pushed a commit to saswatamcode/thanos that referenced this pull request May 10, 2024
* Revert "upgrade golang/x/net to 0.17.0 (thanos-io#92)"

This reverts commit 1a7d05c.
Signed-off-by: Subbarao Meduri <smeduri@redhat.com>

* Revert "Revert "[release-2.9] Upgrade to thanos 0.32.3 (thanos-io#84)""

This reverts commit c2dccb9.
Signed-off-by: Subbarao Meduri <smeduri@redhat.com>

* Revert "Revert "upgrade golang/x/net to 0.17.0 (thanos-io#85)""

This reverts commit 8214b23.
Signed-off-by: Subbarao Meduri <smeduri@redhat.com>

* Revert "Revert "update busybox version (thanos-io#91)""

This reverts commit 485c4f7.
Signed-off-by: Subbarao Meduri <smeduri@redhat.com>
GiedriusS added a commit that referenced this pull request May 20, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants