Skip to content

Commit

Permalink
fix comments by PR review in code of federated targets functionality (t…
Browse files Browse the repository at this point in the history
…hanos-io#3350)

Signed-off-by: Alexander Tunik <2braven@gmail.com>
  • Loading branch information
2nick committed Oct 22, 2020
1 parent f384750 commit 86adf14
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
Empty file modified .bingo/go.mod
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion pkg/query/storeset.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type RuleSpec interface {
}

type TargetSpec interface {
// Addr returns RulesAPI Address for the rules spec. It is used as its ID.
// Addr returns TargetsAPI Address for the targets spec. It is used as its ID.
Addr() string
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/targets/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/thanos-io/thanos/pkg/targets/targetspb"
)

// Prometheus implements targetspb.Rules gRPC that allows to fetch targets from Prometheus HTTP api/v1/targets endpoint.
// Prometheus implements targetspb.Targets gRPC that allows to fetch targets from Prometheus HTTP api/v1/targets endpoint.
type Prometheus struct {
base *url.URL
client *promclient.Client
Expand Down
4 changes: 2 additions & 2 deletions pkg/targets/targetspb/rpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions pkg/targets/targetspb/rpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ option (gogoproto.goproto_unkeyed_all) = false;
option (gogoproto.goproto_unrecognized_all) = false;
option (gogoproto.goproto_sizecache_all) = false;

/// Targets represents API that is responsible for gathering rules and their statuses.
/// Targets represents API that is responsible for gathering targets and their states.
service Targets {
/// Targets has info for all targets.
/// Returned rules are expected to include external labels.
/// Returned targets are expected to include external labels.
rpc Targets (TargetsRequest) returns (stream TargetsResponse);
}

Expand All @@ -43,8 +43,7 @@ message TargetsRequest {

message TargetsResponse {
oneof result {
/// group for rule groups. It is up to server implementation to decide how many of those to put here within single frame.
// RuleGroup group = 1;
/// structure with targets. It is up to server implementation to decide how many of those to put here within single frame.
TargetDiscovery targets = 1;

/// warning is considered an information piece in place of series for warning purposes.
Expand Down
1 change: 0 additions & 1 deletion test/e2e/targets_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ func targetAndAssert(t *testing.T, ctx context.Context, addr string, state strin

fmt.Println("targetAndAssert: Waiting for results for targets state", state)

//var result *targetspb.TargetDiscovery
testutil.Ok(t, runutil.Retry(time.Second, ctx.Done(), func() error {
res, err := promclient.NewDefaultClient().TargetsInGRPC(ctx, urlParse(t, "http://"+addr), state)
if err != nil {
Expand Down

0 comments on commit 86adf14

Please sign in to comment.