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

Remove unused metrics #322

Merged
merged 3 commits into from
Feb 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 60 additions & 105 deletions controller/gen/proxy/telemetry/telemetry.pb.go

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

18 changes: 2 additions & 16 deletions controller/script/simulate-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ var (
http.StatusNetworkAuthenticationRequired,
}

streamSummary = &pb.StreamSummary{
BytesSent: 12345,
DurationMs: 10,
FramesSent: 4,
}
ports = []uint32{3333, 6262}

// latencyBucketBounds holds the maximum value (inclusive, in tenths of a
Expand Down Expand Up @@ -151,7 +146,7 @@ func randomGrpcEos(count uint32) (eos []*pb.EosScope) {
for code, streamCount := range grpcResponseCodes {
eos = append(eos, &pb.EosScope{
Ctx: &pb.EosCtx{End: &pb.EosCtx_GrpcStatusCode{GrpcStatusCode: code}},
Streams: streamSummaries(streamCount),
Streams: streamCount,
})
}
return
Expand All @@ -161,7 +156,7 @@ func randomH2Eos(count uint32) (eos []*pb.EosScope) {
for i := uint32(0); i < count; i++ {
eos = append(eos, &pb.EosScope{
Ctx: &pb.EosCtx{End: &pb.EosCtx_Other{Other: true}},
Streams: streamSummaries(i),
Streams: uint32(rand.Int31()),
})
}
return
Expand All @@ -175,13 +170,6 @@ func randomHttpResponseCode() uint32 {
return uint32(httpResponseCodes[rand.Intn(len(httpResponseCodes))])
}

func streamSummaries(count uint32) (summaries []*pb.StreamSummary) {
for i := uint32(0); i < count; i++ {
summaries = append(summaries, streamSummary)
}
return
}

func stringToIp(str string) *common.IPAddress {
octets := make([]uint8, 0)
for _, num := range strings.Split(str, ".") {
Expand Down Expand Up @@ -315,7 +303,6 @@ func main() {
Port: randomPort(),
},
Authority: "world.greeting:7778",
Method: &common.HttpMethod{Type: &common.HttpMethod_Registered_{Registered: common.HttpMethod_GET}},
},
Count: count,
Responses: []*pb.ResponseScope{
Expand All @@ -338,7 +325,6 @@ func main() {
Port: randomPort(),
},
Authority: "world.greeting:7778",
Method: &common.HttpMethod{Type: &common.HttpMethod_Registered_{Registered: common.HttpMethod_GET}},
},
Count: count,
Responses: []*pb.ResponseScope{
Expand Down
5 changes: 2 additions & 3 deletions controller/telemetry/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

var (
requestLabels = []string{"source_deployment", "target_deployment", "method"}
requestLabels = []string{"source_deployment", "target_deployment"}
requestsTotal = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "requests_total",
Expand Down Expand Up @@ -356,7 +356,7 @@ func (s *server) Report(ctx context.Context, req *write.ReportRequest) (*write.R
responseLabels[k] = v
}

responsesTotal.With(responseLabels).Add(float64(len(eosScope.Streams)))
responsesTotal.With(responseLabels).Add(float64(eosScope.Streams))
}
}

Expand Down Expand Up @@ -449,7 +449,6 @@ func (s *server) requestLabelsFor(requestScope *write.RequestScope) prometheus.L
return prometheus.Labels{
"source_deployment": sourceDeployment,
"target_deployment": targetDeployment,
"method": methodString(requestScope.Ctx.Method),
}
}

Expand Down
9 changes: 1 addition & 8 deletions proto/proxy/telemetry/telemetry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ message RequestCtx {
common.IPAddress source_ip = 1;
common.TcpAddress target_addr = 2;
string authority = 3;
common.HttpMethod method = 4;
}

message ResponseScope {
Expand All @@ -93,7 +92,7 @@ message ResponseCtx {

message EosScope {
EosCtx ctx = 1;
repeated StreamSummary streams = 2;
uint32 streams = 2;
}

message EosCtx {
Expand All @@ -104,10 +103,4 @@ message EosCtx {
}
}

message StreamSummary {
uint64 duration_ms = 1;
uint64 bytes_sent = 2;
uint32 frames_sent = 3;
}

message ReportResponse {}
Loading