Skip to content

Commit

Permalink
upgrade to latest dependencies (#737)
Browse files Browse the repository at this point in the history
bumping knative.dev/pkg b769fef...696cac8:
  > 696cac8 Expose queue proxy request metrics reporting period (# 2362)
  > bd3cf51 Printf log message with the right type when showing port (# 2709)
  > 4c84b1b Update actions (# 2707)
  > 3290ddf Update community files (# 2706)
  > 53fc6ab Update actions (# 2705)
bumping knative.dev/hack 1eebfb3...3b8ef01:
  > 3b8ef01 Update community files (# 279)
bumping knative.dev/hack/schema 1eebfb3...3b8ef01:
  > 3b8ef01 Update community files (# 279)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation committed Mar 30, 2023
1 parent 046bf8f commit bc96f0e
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 23 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
k8s.io/client-go v0.25.4
k8s.io/code-generator v0.25.4
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1
knative.dev/hack v0.0.0-20230309131425-1eebfb3184f8
knative.dev/hack/schema v0.0.0-20230309131425-1eebfb3184f8
knative.dev/pkg v0.0.0-20230310210124-b769fef17fa3
knative.dev/hack v0.0.0-20230317131237-3b8ef01d7c4f
knative.dev/hack/schema v0.0.0-20230317131237-3b8ef01d7c4f
knative.dev/pkg v0.0.0-20230329200100-696cac83c169
)

require (
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -812,12 +812,12 @@ k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkI
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/hack v0.0.0-20230309131425-1eebfb3184f8 h1:M0zzU+k1NnMzvEd4+koxNSYZslgwc6UppR+42+sDC3A=
knative.dev/hack v0.0.0-20230309131425-1eebfb3184f8/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/hack/schema v0.0.0-20230309131425-1eebfb3184f8 h1:GjQt9kMeVS1s8JGqBoKHfxuP3AZ50PSRXkdecifRdO4=
knative.dev/hack/schema v0.0.0-20230309131425-1eebfb3184f8/go.mod h1:GeIb+PLd5mllawcpHEGF5J5fYTQrvgEO5liao8lUKUs=
knative.dev/pkg v0.0.0-20230310210124-b769fef17fa3 h1:3tVo+DtOeAr/3OBEoOi9GYQephqkJYVQsbfrQo6jDmw=
knative.dev/pkg v0.0.0-20230310210124-b769fef17fa3/go.mod h1:S+KfTInuwEkZSTwvWqrWZV/TEw6ps51GUGaSC1Fnbe0=
knative.dev/hack v0.0.0-20230317131237-3b8ef01d7c4f h1:rDAppvqjU9jqa3D/eZJ/MuplGyPXqfFUEwG506obNVQ=
knative.dev/hack v0.0.0-20230317131237-3b8ef01d7c4f/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/hack/schema v0.0.0-20230317131237-3b8ef01d7c4f h1:2WICDg2SSsRK9LXEN0ltO896+HzL1sTn6L8Y/ntWhKQ=
knative.dev/hack/schema v0.0.0-20230317131237-3b8ef01d7c4f/go.mod h1:GeIb+PLd5mllawcpHEGF5J5fYTQrvgEO5liao8lUKUs=
knative.dev/pkg v0.0.0-20230329200100-696cac83c169 h1:kMn1q/pvNf88HsfOfC2Xbx3D38JSueKu2vfQTDrO6O4=
knative.dev/pkg v0.0.0-20230329200100-696cac83c169/go.mod h1:S+KfTInuwEkZSTwvWqrWZV/TEw6ps51GUGaSC1Fnbe0=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/injection/health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func ServeHealthProbes(ctx context.Context, port int) error {
}()

// start the web server on port and accept requests
logger.Infof("Probes server listening on port %s", port)
logger.Infof("Probes server listening on port %d", port)
if err := server.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
return err
}
Expand Down
22 changes: 12 additions & 10 deletions vendor/knative.dev/pkg/metrics/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,21 @@ const (
DomainEnv = "METRICS_DOMAIN"

// The following keys are used to configure metrics reporting.
// See https://github.com/knative/serving/blob/main/config/config-observability.yaml
// See https://github.com/knative/serving/blob/main/config/core/configmaps/observability.yaml
// for details.
collectorAddressKey = "metrics.opencensus-address"
collectorSecureKey = "metrics.opencensus-require-tls"
reportingPeriodKey = "metrics.reporting-period-seconds"

defaultBackendEnvName = "DEFAULT_METRICS_BACKEND"
defaultPrometheusPort = 9090
maxPrometheusPort = 65535
minPrometheusPort = 1024
defaultPrometheusHost = "0.0.0.0"
prometheusPortEnvName = "METRICS_PROMETHEUS_PORT"
prometheusHostEnvName = "METRICS_PROMETHEUS_HOST"
defaultBackendEnvName = "DEFAULT_METRICS_BACKEND"
defaultPrometheusPort = 9090
defaultPrometheusReportingPeriod = 5
defaultOpenCensusReportingPeriod = 60
maxPrometheusPort = 65535
minPrometheusPort = 1024
defaultPrometheusHost = "0.0.0.0"
prometheusPortEnvName = "METRICS_PROMETHEUS_PORT"
prometheusHostEnvName = "METRICS_PROMETHEUS_HOST"
)

var (
Expand Down Expand Up @@ -206,9 +208,9 @@ func createMetricsConfig(_ context.Context, ops ExporterOptions) (*metricsConfig
} else {
switch mc.backendDestination {
case openCensus:
mc.reportingPeriod = time.Minute
mc.reportingPeriod = defaultOpenCensusReportingPeriod * time.Second
case prometheus:
mc.reportingPeriod = 5 * time.Second
mc.reportingPeriod = defaultPrometheusReportingPeriod * time.Second
}
}
return &mc, nil
Expand Down
35 changes: 35 additions & 0 deletions vendor/knative.dev/pkg/metrics/config_observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ type ObservabilityConfig struct {
// OpenCensus. "None" disables all backends.
RequestMetricsBackend string

// RequestMetricsReportingPeriodSeconds specifies the request metrics reporting period in sec at queue proxy, eg 1.
// If a zero or negative value is passed the default reporting period is used (10 secs).
RequestMetricsReportingPeriodSeconds int

// EnableProfiling indicates whether it is allowed to retrieve runtime profiling data from
// the pods via an HTTP server in the format expected by the pprof visualization tool.
EnableProfiling bool
Expand Down Expand Up @@ -114,13 +118,20 @@ func NewObservabilityConfigFromConfigMap(configMap *corev1.ConfigMap) (*Observab
return oc, nil
}

defaultRequestMetricsReportingPeriod, err := getDefaultRequestMetricsReportingPeriod(configMap.Data)
if err != nil {
return nil, err
}
oc.RequestMetricsReportingPeriodSeconds = defaultRequestMetricsReportingPeriod

if err := cm.Parse(configMap.Data,
cm.AsBool("logging.enable-var-log-collection", &oc.EnableVarLogCollection),
cm.AsString("logging.revision-url-template", &oc.LoggingURLTemplate),
cm.AsString(ReqLogTemplateKey, &oc.RequestLogTemplate),
cm.AsBool(EnableReqLogKey, &oc.EnableRequestLog),
cm.AsBool(EnableProbeReqLogKey, &oc.EnableProbeRequestLog),
cm.AsString("metrics.request-metrics-backend-destination", &oc.RequestMetricsBackend),
cm.AsInt("metrics.request-metrics-reporting-period-seconds", &oc.RequestMetricsReportingPeriodSeconds),
cm.AsBool("profiling.enable", &oc.EnableProfiling),
cm.AsString("metrics.opencensus-address", &oc.MetricsCollectorAddress),
); err != nil {
Expand Down Expand Up @@ -163,3 +174,27 @@ func ConfigMapName() string {
}
return "config-observability"
}

// Use the same as `metrics.reporting-period-seconds` for the default
// of `metrics.request-metrics-reporting-period-seconds`
func getDefaultRequestMetricsReportingPeriod(data map[string]string) (int, error) {
// Default backend is prometheus
period := defaultPrometheusReportingPeriod
if repStr := data[reportingPeriodKey]; repStr != "" {
repInt, err := strconv.Atoi(repStr)
if err != nil {
return -1, fmt.Errorf("invalid %s value %q", reportingPeriodKey, repStr)
}
period = repInt
} else {
if raw, ok := data["metrics.request-metrics-backend-destination"]; ok {
switch metricsBackend(raw) {
case prometheus:
period = defaultPrometheusReportingPeriod
case openCensus:
period = defaultOpenCensusReportingPeriod
}
}
}
return period, nil
}
6 changes: 3 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -814,16 +814,16 @@ k8s.io/utils/net
k8s.io/utils/pointer
k8s.io/utils/strings/slices
k8s.io/utils/trace
# knative.dev/hack v0.0.0-20230309131425-1eebfb3184f8
# knative.dev/hack v0.0.0-20230317131237-3b8ef01d7c4f
## explicit; go 1.18
knative.dev/hack
# knative.dev/hack/schema v0.0.0-20230309131425-1eebfb3184f8
# knative.dev/hack/schema v0.0.0-20230317131237-3b8ef01d7c4f
## explicit; go 1.18
knative.dev/hack/schema/commands
knative.dev/hack/schema/docs
knative.dev/hack/schema/registry
knative.dev/hack/schema/schema
# knative.dev/pkg v0.0.0-20230310210124-b769fef17fa3
# knative.dev/pkg v0.0.0-20230329200100-696cac83c169
## explicit; go 1.18
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down

0 comments on commit bc96f0e

Please sign in to comment.