-
Notifications
You must be signed in to change notification settings - Fork 267
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
Metrics Service Support #220
Changes from 17 commits
f0e2359
ac39c33
2380719
0edcce8
3875eab
c4fef88
5123296
5f5eabb
92c0331
beae9e5
a868271
f15c7da
7804dc6
bf2238c
e473c29
e3bfd40
1519e6b
9040f93
d753f43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.api.v2; | ||
import "api/base.proto"; | ||
|
||
import "google/api/annotations.proto"; | ||
import "metrics.proto"; | ||
|
||
// Service for streaming metrics to server that consumes the metrics data. It uses Prometheus metric data model as a standard to represent metrics information. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: please line break around 100 cols There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do |
||
service MetricsService { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make sense to explicitly call out PrometheusMetricsService ? After all the format is for Prometheus. If not this, atleast have a type field or something in streammessage that says what type of metric is coming out of Envoy. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we discussed it in the PR #210 that we do not want to call this PrometheusMetricsService. We picked Promotheus model because it is more comprehensive representation of metrics model. We tried to look at OpenMetrics but since it is far off and any way is heavily inspired from Promotheus model. So we decided to go with this model for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You will also need to provide a config struct with at least cluster in it. See access log API. |
||
// Envoy will connect and send StreamMetricsMessage messages forever. It does not expect any | ||
// response to be sent as nothing would be done in the case of failure. | ||
rpc StreamMetrics(stream StreamMetricsMessage) returns (StreamMetricsResponse) { | ||
} | ||
} | ||
|
||
message StreamMetricsResponse {} | ||
|
||
message StreamMetricsMessage { | ||
// The node sending the metric messages over the stream. | ||
Node node = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you take a look at my access log API and copy what we did there with Identifier? We only need to send node once. |
||
repeated io.prometheus.client.MetricFamily envoy_metrics = 2; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
GOOGLEAPIS_SHA = "5c6df0cd18c6a429eab739fb711c27f6e1393366" # May 14, 2017 | ||
PROMETHEUS_SHA = "6f3806018612930941127f2a7c6c453ba2c527d2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: might be worth annotating with date. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do |
||
|
||
def api_dependencies(): | ||
native.new_http_archive( | ||
|
@@ -44,3 +45,31 @@ py_proto_library( | |
) | ||
""", | ||
) | ||
|
||
native.new_http_archive( | ||
name = "promotheus_metrics_model", | ||
strip_prefix = "client_model-" + PROMETHEUS_SHA, | ||
url = "https://github.com/prometheus/client_model/archive/" + PROMETHEUS_SHA + ".tar.gz", | ||
build_file_content = """ | ||
|
||
filegroup( | ||
name = "client_model_protos_src", | ||
srcs = [ | ||
"metrics.proto", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
proto_library( | ||
name = "client_model_protos_lib", | ||
srcs = [":client_model_protos_src"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_proto_library( | ||
name = "client_model_protos", | ||
deps = [":client_model_protos_lib"], | ||
visibility = ["//visibility:public"], | ||
) | ||
""", | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ api_cc_test( | |
"//api:eds", | ||
"//api:hds", | ||
"//api:lds", | ||
"//api:metrics", | ||
"//api:rds", | ||
"//api:rls", | ||
], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: blank line after package.