contour
contour copied to clipboard
Support scrape Contour/Envoy metrics by Prometheus Operator
Please describe the problem you have
// TODO [danehans]: Remove the prometheus annotations when Contour is updated to
// show how the Prometheus Operator is used to scrape Contour/Envoy metrics.
PodAnnotations: map[string]string{
"prometheus.io/scrape": "true",
"prometheus.io/port": "8002",
"prometheus.io/path": "/stats/prometheus",
},
// TODO [danehans]: Remove the prometheus annotations when Contour is updated to
// show how the Prometheus Operator is used to scrape Contour/Envoy metrics.
Annotations: map[string]string{
"prometheus.io/scrape": "true",
"prometheus.io/port": fmt.Sprintf("%d", metricsPort),
},
I'd like to implement this as follows:
- add a flag to ContourDeployment:
type ContourDeploymentSpec struct { // +optional EnableMetrics bool
json:"enableMetrics,omitempty"}
- if
EnableMetricsequals tofalse, do nothing - otherwise, expose ports for services: contour/8000 & envoy/8002
kubectl applyCR\ServiceMontiorby themself (optional)- that's all
@skriss @sunjayBhatia any advise?