Skip to content

Commit ad16f53

Browse files
committed
proto: Regenerated proto and pin deps for proto.
Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
1 parent 04bfb94 commit ad16f53

File tree

11 files changed

+1197
-276
lines changed

11 files changed

+1197
-276
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ format: $(GOIMPORTS)
116116

117117
# proto generates golang files from Thanos proto files.
118118
.PHONY: proto
119-
proto:
120-
@go get -u github.com/gogo/protobuf/protoc-gen-gogofast
119+
proto: deps
120+
@go install ./vendor/github.com/gogo/protobuf/protoc-gen-gogofast
121121
@./scripts/genproto.sh
122122

123123
.PHONY: promu

docs/service_discovery.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ Currently places that uses Thanos SD:
88
* `Thanos Rule` needs to know about `QueryAPI` servers in order to evaluate recording and alerting rules.
99
* (Only static option with DNS discovery): `Thanos Rule` needs to know about `Alertmanagers` HA replicas in order to send alerts.
1010

11-
Currently there are several ways to configure this and they are described below.
11+
Currently there are several ways to configure this and they are described below in details:
12+
13+
* Static Flags
14+
* File SD
15+
* DNS SD
1216

1317
## Static Flags
1418

1519
The simplest way to tell a component about a peer is to use a static flag.
1620

1721
### Thanos Query
22+
1823
The repeatable flag `--store=<store>` can be used to specify a `StoreAPI` that `Thanos Query` should use.
1924

2025
### Thanos Rule

pkg/query/iter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package query
33
import (
44
"math"
55
"sort"
6-
"unsafe"
76

87
"github.com/improbable-eng/thanos/pkg/compact/downsample"
98
"github.com/improbable-eng/thanos/pkg/store/storepb"
@@ -98,8 +97,9 @@ func newChunkSeries(lset []storepb.Label, chunks []storepb.AggrChunk, mint, maxt
9897
sort.Slice(chunks, func(i, j int) bool {
9998
return chunks[i].MinTime < chunks[j].MinTime
10099
})
100+
101101
return &chunkSeries{
102-
lset: *(*labels.Labels)(unsafe.Pointer(&lset)), // YOLO!
102+
lset: storepb.LabelsToPromLabels(lset),
103103
chunks: chunks,
104104
mint: mint,
105105
maxt: maxt,

pkg/query/querier_test.go

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -79,51 +79,51 @@ func TestSortReplicaLabel(t *testing.T) {
7979

8080
set := []storepb.Series{
8181
{Labels: []storepb.Label{
82-
{"a", "1"},
83-
{"b", "replica-1"},
84-
{"c", "3"},
82+
{Name: "a", Value: "1"},
83+
{Name: "b", Value: "replica-1"},
84+
{Name: "c", Value: "3"},
8585
}},
8686
{Labels: []storepb.Label{
87-
{"a", "1"},
88-
{"b", "replica-1"},
89-
{"c", "3"},
90-
{"d", "4"},
87+
{Name: "a", Value: "1"},
88+
{Name: "b", Value: "replica-1"},
89+
{Name: "c", Value: "3"},
90+
{Name: "d", Value: "4"},
9191
}},
9292
{Labels: []storepb.Label{
93-
{"a", "1"},
94-
{"b", "replica-1"},
95-
{"c", "4"},
93+
{Name: "a", Value: "1"},
94+
{Name: "b", Value: "replica-1"},
95+
{Name: "c", Value: "4"},
9696
}},
9797
{Labels: []storepb.Label{
98-
{"a", "1"},
99-
{"b", "replica-2"},
100-
{"c", "3"},
98+
{Name: "a", Value: "1"},
99+
{Name: "b", Value: "replica-2"},
100+
{Name: "c", Value: "3"},
101101
}},
102102
}
103103

104104
sortDedupLabels(set, "b")
105105

106106
exp := []storepb.Series{
107107
{Labels: []storepb.Label{
108-
{"a", "1"},
109-
{"c", "3"},
110-
{"b", "replica-1"},
108+
{Name: "a", Value: "1"},
109+
{Name: "c", Value: "3"},
110+
{Name: "b", Value: "replica-1"},
111111
}},
112112
{Labels: []storepb.Label{
113-
{"a", "1"},
114-
{"c", "3"},
115-
{"b", "replica-2"},
113+
{Name: "a", Value: "1"},
114+
{Name: "c", Value: "3"},
115+
{Name: "b", Value: "replica-2"},
116116
}},
117117
{Labels: []storepb.Label{
118-
{"a", "1"},
119-
{"c", "3"},
120-
{"d", "4"},
121-
{"b", "replica-1"},
118+
{Name: "a", Value: "1"},
119+
{Name: "c", Value: "3"},
120+
{Name: "d", Value: "4"},
121+
{Name: "b", Value: "replica-1"},
122122
}},
123123
{Labels: []storepb.Label{
124-
{"a", "1"},
125-
{"c", "4"},
126-
{"b", "replica-1"},
124+
{Name: "a", Value: "1"},
125+
{Name: "c", Value: "4"},
126+
{Name: "b", Value: "replica-1"},
127127
}},
128128
}
129129
testutil.Equals(t, exp, set)
@@ -146,28 +146,28 @@ func TestDedupSeriesSet(t *testing.T) {
146146
vals []sample
147147
}{
148148
{
149-
lset: []storepb.Label{{"a", "1"}, {"c", "3"}, {"replica", "replica-1"}},
149+
lset: []storepb.Label{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}, {Name: "replica", Value: "replica-1"}},
150150
vals: []sample{{10000, 1}, {20000, 2}},
151151
}, {
152-
lset: []storepb.Label{{"a", "1"}, {"c", "3"}, {"replica", "replica-2"}},
152+
lset: []storepb.Label{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}, {Name: "replica", Value: "replica-2"}},
153153
vals: []sample{{60000, 3}, {70000, 4}},
154154
}, {
155-
lset: []storepb.Label{{"a", "1"}, {"c", "3"}, {"replica", "replica-3"}},
155+
lset: []storepb.Label{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}, {Name: "replica", Value: "replica-3"}},
156156
vals: []sample{{200000, 5}, {210000, 6}},
157157
}, {
158-
lset: []storepb.Label{{"a", "1"}, {"c", "3"}, {"d", "4"}},
158+
lset: []storepb.Label{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}, {Name: "d", Value: "4"}},
159159
vals: []sample{{10000, 1}, {20000, 2}},
160160
}, {
161-
lset: []storepb.Label{{"a", "1"}, {"c", "3"}},
161+
lset: []storepb.Label{{Name: "a", Value: "1"}, {Name: "c", Value: "3"}},
162162
vals: []sample{{10000, 1}, {20000, 2}},
163163
}, {
164-
lset: []storepb.Label{{"a", "1"}, {"c", "4"}, {"replica", "replica-1"}},
164+
lset: []storepb.Label{{Name: "a", Value: "1"}, {Name: "c", Value: "4"}, {Name: "replica", Value: "replica-1"}},
165165
vals: []sample{{10000, 1}, {20000, 2}},
166166
}, {
167-
lset: []storepb.Label{{"a", "2"}, {"c", "3"}, {"replica", "replica-3"}},
167+
lset: []storepb.Label{{Name: "a", Value: "2"}, {Name: "c", Value: "3"}, {Name: "replica", Value: "replica-3"}},
168168
vals: []sample{{10000, 1}, {20000, 2}},
169169
}, {
170-
lset: []storepb.Label{{"a", "2"}, {"c", "3"}, {"replica", "replica-3"}},
170+
lset: []storepb.Label{{Name: "a", Value: "2"}, {Name: "c", Value: "3"}, {Name: "replica", Value: "replica-3"}},
171171
vals: []sample{{60000, 3}, {70000, 4}},
172172
},
173173
}

0 commit comments

Comments
 (0)