-
Notifications
You must be signed in to change notification settings - Fork 708
Add example deployments for prometheus / grafana #970
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
Changes from all commits
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,76 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: envoy-statsd | ||
| namespace: heptio-contour | ||
| data: | ||
| statsd.yaml: |2- | ||
| mappings: | ||
| - match: 'cluster\.(.+?)_(.+?)_(.+?)\.upstream_cx_connect_ms' | ||
| match_type: regex | ||
| name: "envoy_cluster_upstream_cx_connect_time" | ||
| timer_type: 'histogram' | ||
| labels: | ||
| cluster_name: "$1/$2/$3" | ||
| namespace: "$1" | ||
| service: "$2" | ||
| port: "$3" | ||
| - match: 'cluster\.(.+?)_(.+?)_(.+?)\.upstream_cx_length_ms' | ||
| match_type: regex | ||
| name: "envoy_cluster_upstream_cx_length" | ||
| timer_type: 'histogram' | ||
| labels: | ||
| cluster_name: "$1/$2/$3" | ||
| namespace: "$1" | ||
| service: "$2" | ||
| port: "$3" | ||
| - match: 'cluster\.(.+?)_(.+?)_(.+?)\.upstream_rq_time' | ||
| match_type: regex | ||
| name: "envoy_cluster_upstream_rq_time" | ||
| timer_type: 'histogram' | ||
| labels: | ||
| cluster_name: "$1/$2/$3" | ||
| namespace: "$1" | ||
| service: "$2" | ||
| port: "$3" | ||
| - match: 'cluster\.(.+?)_(.+?)_(.+?)\.internal.upstream_rq_time' | ||
| match_type: regex | ||
| name: "envoy_cluster_internal_upstream_rq_time" | ||
| timer_type: 'histogram' | ||
| labels: | ||
| cluster_name: "$1/$2/$3" | ||
| namespace: "$1" | ||
| service: "$2" | ||
| port: "$3" | ||
| - match: 'cluster\.(.+?)_(.+?)_(.+?)\.external.upstream_rq_time' | ||
| match_type: regex | ||
| name: "envoy_cluster_external_upstream_rq_time" | ||
| timer_type: 'histogram' | ||
| labels: | ||
| cluster_name: "$1/$2/$3" | ||
| namespace: "$1" | ||
| service: "$2" | ||
| port: "$3" | ||
| - match: 'cluster\.(.+?)_(.+?)_(.+?)\.canary.upstream_rq_time' | ||
| match_type: regex | ||
| name: "envoy_cluster_canary_upstream_rq_time" | ||
| timer_type: 'histogram' | ||
| labels: | ||
| cluster_name: "$1/$2/$3" | ||
| namespace: "$1" | ||
| service: "$2" | ||
| port: "$3" | ||
| - match: 'envoy.http.*.downstream_cx_length_ms' | ||
| name: "envoy_http_downstream_cx_length" | ||
| timer_type: 'histogram' | ||
| labels: | ||
| http_conn_manager_prefix: "$1" | ||
| - match: 'envoy.http.*.downstream_rq_time' | ||
| name: "envoy_http_downstream_rq_time" | ||
| timer_type: 'histogram' | ||
| labels: | ||
| http_conn_manager_prefix: "$1" | ||
| - match: '.' | ||
| match_type: 'regex' | ||
| action: 'drop' | ||
| name: 'dropped' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,8 @@ spec: | |
| annotations: | ||
| prometheus.io/scrape: "true" | ||
| prometheus.io/port: "8002" | ||
| prometheus.io/path: "/stats" | ||
| prometheus.io/format: "prometheus" | ||
| prometheus.io/statsdport: "9102" | ||
| prometheus.io/path: "/stats/prometheus" | ||
| labels: | ||
| app: envoy | ||
| spec: | ||
|
|
@@ -57,7 +57,20 @@ spec: | |
| lifecycle: | ||
| preStop: | ||
| exec: | ||
| command: ["wget", "-qO-", "http://localhost:9001/healthcheck/fail"] | ||
| command: ["wget", "-qO-", "http://localhost:9001/healthcheck/fail"] | ||
| - name: statsd-sink | ||
| image: prom/statsd-exporter:v0.6.0 | ||
| command: | ||
| - "/bin/statsd_exporter" | ||
|
Contributor
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. Just curious: envoy 1.10.0 has just been released (like 2 hours ago) and supports histograms in prometheus export now (envoyproxy/envoy#5601 you shared it on slack a few days ago, so I understand you are aware :-D) . Does the sidecar add more metrics if envoy 1.10 is used? I guess the answer is yes, as you shared that link on slack, but I really don't know and would like to understand if it doesn't bother you :). Also, I'm not sure when contour plans to upgrade to envoy 1.10, so even if the sidecar does not add more metrics, this of course can be totally relevant :-)
Member
Author
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. @rata yes Envoy v1.10 has Histograms enabled so we can remove the statsd forwarder bit. I'm not sure when we'll upgrade to v1.10, we typically wait a bit to let any issues shake out. I'd like to still merge this for v1.9.1 and then we'll update with a future PR once we move to envoy v1.10
Contributor
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. Thanks a lot for the info! :) |
||
| args: | ||
| - "-statsd.mapping-config=/etc/statsd/statsd.yaml" | ||
| ports: | ||
| - containerPort: 9102 | ||
| protocol: TCP | ||
| name: metrics | ||
| volumeMounts: | ||
| - name: statsd | ||
| mountPath: /etc/statsd | ||
| dnsPolicy: ClusterFirstWithHostNet | ||
| hostNetwork: true | ||
| initContainers: | ||
|
|
@@ -68,6 +81,7 @@ spec: | |
| - $(CONTOUR_SERVICE_HOST) | ||
| - --xds-port | ||
| - $(CONTOUR_SERVICE_PORT) | ||
| - --statsd-enabled | ||
| command: | ||
| - contour | ||
| image: gcr.io/heptio-images/contour:master | ||
|
|
@@ -80,4 +94,7 @@ spec: | |
| volumes: | ||
| - name: contour-config | ||
| emptyDir: {} | ||
| - name: statsd | ||
| configMap: | ||
| name: envoy-statsd | ||
| restartPolicy: Always | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: contour-monitoring | ||
| labels: | ||
| app: contour-monitoring |
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.
Am I missing something or this will scrape only envoy metrics? stastd, I think, will gather only envoy and so will port
8002. Right?I think metrics for the contour container (on endpoint
/metricsand port8000) are not gathered by this. Am I missing something? Hopefully I am :)I will try to create a cluster and see if those are missing or not, it's too late here now to try this :-(
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.
@rata Contour metrics are scraped on the Contour deployment. This example is applied to the split model where Contour & Envoy are not colocated in the same pod.
Uh oh!
There was an error while loading. Please reload this page.
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.
Ohh, I see. Silly me, it was not obvious just looking quickly at the diff. Thanks! :)