Skip to content
Closed
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
12 changes: 2 additions & 10 deletions cmd/broker/filter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ import (
)

const (
defaultMetricsPort = 9092
component = "mt_broker_filter"
component = "mt_broker_filter"
)

type envConfig struct {
Expand Down Expand Up @@ -91,14 +90,7 @@ func main() {
// Watch the logging config map and dynamically update logging levels.
configMapWatcher := configmap.NewInformedWatcher(kubeClient, system.Namespace())
// Watch the observability config map and dynamically update metrics exporter.
updateFunc, err := metrics.UpdateExporterFromConfigMapWithOpts(ctx, metrics.ExporterOptions{
Component: component,
PrometheusPort: defaultMetricsPort,
}, sl)
if err != nil {
logger.Fatal("Failed to create metrics exporter update function", zap.Error(err))
}
configMapWatcher.Watch(metrics.ConfigMapName(), updateFunc)
configMapWatcher.Watch(metrics.ConfigMapName(), metrics.ConfigMapWatcher(ctx, component, nil, sl))
// TODO change the component name to broker once Stackdriver metrics are approved.
// Watch the observability config map and dynamically update request logs.
configMapWatcher.Watch(logging.ConfigMapName(), logging.UpdateLevelFromConfigMap(sl, atomicLevel, component))
Expand Down
10 changes: 1 addition & 9 deletions cmd/broker/ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const (
// based on what serving is doing. See https://github.com/knative/serving/blob/main/pkg/network/transports.go.
defaultMaxIdleConnections = 1000
defaultMaxIdleConnectionsPerHost = 1000
defaultMetricsPort = 9092
component = "mt_broker_ingress"
)

Expand Down Expand Up @@ -106,14 +105,7 @@ func main() {
// Watch the logging config map and dynamically update logging levels.
configMapWatcher := configmap.NewInformedWatcher(kubeclient.Get(ctx), system.Namespace())
// Watch the observability config map and dynamically update metrics exporter.
updateFunc, err := metrics.UpdateExporterFromConfigMapWithOpts(ctx, metrics.ExporterOptions{
Component: component,
PrometheusPort: defaultMetricsPort,
}, sl)
if err != nil {
logger.Fatal("Failed to create metrics exporter update function", zap.Error(err))
}
configMapWatcher.Watch(metrics.ConfigMapName(), updateFunc)
configMapWatcher.Watch(metrics.ConfigMapName(), metrics.ConfigMapWatcher(ctx, component, nil, sl))
// TODO change the component name to broker once Stackdriver metrics are approved.
// Watch the observability config map and dynamically update request logs.
configMapWatcher.Watch(logging.ConfigMapName(), logging.UpdateLevelFromConfigMap(sl, atomicLevel, component))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- containerPort: 8080
name: http
protocol: TCP
- containerPort: 9092
- containerPort: 9090
name: metrics
protocol: TCP
terminationMessagePath: /dev/termination-log
Expand Down Expand Up @@ -104,8 +104,8 @@ spec:
protocol: TCP
targetPort: 8080
- name: http-metrics
port: 9092
port: 9090
protocol: TCP
targetPort: 9092
targetPort: 9090
selector:
eventing.knative.dev/brokerRole: filter
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- containerPort: 8080
name: http
protocol: TCP
- containerPort: 9092
- containerPort: 9090
name: metrics
protocol: TCP
terminationMessagePath: /dev/termination-log
Expand Down Expand Up @@ -104,8 +104,8 @@ spec:
protocol: TCP
targetPort: 8080
- name: http-metrics
port: 9092
port: 9090
protocol: TCP
targetPort: 9092
targetPort: 9090
selector:
eventing.knative.dev/brokerRole: ingress