From 3ed10946959764b42b37fa1504d13e1cf5422986 Mon Sep 17 00:00:00 2001 From: dprotaso Date: Mon, 12 Jul 2021 16:43:31 -0400 Subject: [PATCH 1/2] drop stackdriver exporter support --- cmd/queue/main.go | 18 ++++---- config/core/configmaps/observability.yaml | 17 +------ config/core/configmaps/tracing.yaml | 7 +-- pkg/metrics/config_test.go | 8 ++-- .../revision/resources/deploy_test.go | 3 -- pkg/reconciler/revision/resources/queue.go | 3 -- .../revision/resources/queue_test.go | 45 +++++++++---------- 7 files changed, 37 insertions(+), 64 deletions(-) diff --git a/cmd/queue/main.go b/cmd/queue/main.go index 93519ad7df99..108d948b35a9 100644 --- a/cmd/queue/main.go +++ b/cmd/queue/main.go @@ -98,11 +98,10 @@ type config struct { MetricsCollectorAddress string `split_words:"true"` // optional // Tracing configuration - TracingConfigDebug bool `split_words:"true"` // optional - TracingConfigBackend tracingconfig.BackendType `split_words:"true"` // optional - TracingConfigSampleRate float64 `split_words:"true"` // optional - TracingConfigZipkinEndpoint string `split_words:"true"` // optional - TracingConfigStackdriverProjectID string `split_words:"true"` // optional + TracingConfigDebug bool `split_words:"true"` // optional + TracingConfigBackend tracingconfig.BackendType `split_words:"true"` // optional + TracingConfigSampleRate float64 `split_words:"true"` // optional + TracingConfigZipkinEndpoint string `split_words:"true"` // optional } func init() { @@ -328,11 +327,10 @@ func buildTransport(env config, logger *zap.SugaredLogger, maxConns int) http.Ro oct := tracing.NewOpenCensusTracer(tracing.WithExporterFull(env.ServingPod, env.ServingPodIP, logger)) oct.ApplyConfig(&tracingconfig.Config{ - Backend: env.TracingConfigBackend, - Debug: env.TracingConfigDebug, - ZipkinEndpoint: env.TracingConfigZipkinEndpoint, - StackdriverProjectID: env.TracingConfigStackdriverProjectID, - SampleRate: env.TracingConfigSampleRate, + Backend: env.TracingConfigBackend, + Debug: env.TracingConfigDebug, + ZipkinEndpoint: env.TracingConfigZipkinEndpoint, + SampleRate: env.TracingConfigSampleRate, }) return &ochttp.Transport{ diff --git a/config/core/configmaps/observability.yaml b/config/core/configmaps/observability.yaml index 9568ec28416e..8f374856a0ef 100644 --- a/config/core/configmaps/observability.yaml +++ b/config/core/configmaps/observability.yaml @@ -90,27 +90,14 @@ data: logging.enable-probe-request-log: "false" # metrics.backend-destination field specifies the system metrics destination. - # It supports either prometheus (the default) or stackdriver. - # Note: Using stackdriver will incur additional charges + # It supports either prometheus (the default) or opencensus. metrics.backend-destination: prometheus # metrics.request-metrics-backend-destination specifies the request metrics # destination. It enables queue proxy to send request metrics. - # Currently supported values: prometheus (the default), stackdriver. + # Currently supported values: prometheus (the default), opencensus. metrics.request-metrics-backend-destination: prometheus - # metrics.stackdriver-project-id field specifies the stackdriver project ID. This - # field is optional. When running on GCE, application default credentials will be - # used if this field is not provided. - metrics.stackdriver-project-id: "" - - # metrics.allow-stackdriver-custom-metrics indicates whether it is allowed to send metrics to - # Stackdriver using "global" resource type and custom metric type if the - # metrics are not supported by "knative_revision" resource type. Setting this - # flag to "true" could cause extra Stackdriver charge. - # If metrics.backend-destination is not Stackdriver, this is ignored. - metrics.allow-stackdriver-custom-metrics: "false" - # profiling.enable 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. When # enabled, the Knative Serving pods expose the profiling data on an alternate HTTP port 8008. diff --git a/config/core/configmaps/tracing.yaml b/config/core/configmaps/tracing.yaml index e788ca090849..9b8ade83f4fb 100644 --- a/config/core/configmaps/tracing.yaml +++ b/config/core/configmaps/tracing.yaml @@ -38,18 +38,13 @@ data: # this example block and unindented to be in the data block # to actually change the configuration. # - # This may be "zipkin" or "stackdriver", the default is "none" + # This may be "zipkin" or "none" (default) backend: "none" # URL to zipkin collector where traces are sent. # This must be specified when backend is "zipkin" zipkin-endpoint: "http://zipkin.istio-system.svc.cluster.local:9411/api/v2/spans" - # The GCP project into which stackdriver metrics will be written - # when backend is "stackdriver". If unspecified, the project-id - # is read from GCP metadata when running on GCP. - stackdriver-project-id: "my-project" - # Enable zipkin debug mode. This allows all spans to be sent to the server # bypassing sampling. debug: "false" diff --git a/pkg/metrics/config_test.go b/pkg/metrics/config_test.go index 981cde966d95..bcffc812ba80 100644 --- a/pkg/metrics/config_test.go +++ b/pkg/metrics/config_test.go @@ -70,7 +70,7 @@ func TestObservabilityConfiguration(t *testing.T) { EnableVarLogCollection: true, LoggingURLTemplate: "https://logging.io", RequestLogTemplate: `{"requestMethod": "{{.Request.Method}}"}`, - RequestMetricsBackend: "stackdriver", + RequestMetricsBackend: "opencensus", }, config: &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ @@ -84,7 +84,7 @@ func TestObservabilityConfiguration(t *testing.T) { metrics.ReqLogTemplateKey: `{"requestMethod": "{{.Request.Method}}"}`, "logging.revision-url-template": "https://logging.io", "logging.write-request-logs": "true", - "metrics.request-metrics-backend-destination": "stackdriver", + "metrics.request-metrics-backend-destination": "opencensus", }, }, }, { @@ -94,7 +94,7 @@ func TestObservabilityConfiguration(t *testing.T) { EnableVarLogCollection: true, LoggingURLTemplate: "https://logging.io", RequestLogTemplate: metrics.DefaultRequestLogTemplate, - RequestMetricsBackend: "stackdriver", + RequestMetricsBackend: "opencensus", }, config: &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ @@ -107,7 +107,7 @@ func TestObservabilityConfiguration(t *testing.T) { "logging.enable-var-log-collection": "true", "logging.revision-url-template": "https://logging.io", "logging.write-request-logs": "true", - "metrics.request-metrics-backend-destination": "stackdriver", + "metrics.request-metrics-backend-destination": "opencensus", }, }, }, { diff --git a/pkg/reconciler/revision/resources/deploy_test.go b/pkg/reconciler/revision/resources/deploy_test.go index bff74a8e4bad..45100c6a40cf 100644 --- a/pkg/reconciler/revision/resources/deploy_test.go +++ b/pkg/reconciler/revision/resources/deploy_test.go @@ -152,9 +152,6 @@ var ( }, { Name: "TRACING_CONFIG_ZIPKIN_ENDPOINT", Value: "", - }, { - Name: "TRACING_CONFIG_STACKDRIVER_PROJECT_ID", - Value: "", }, { Name: "TRACING_CONFIG_DEBUG", Value: "false", diff --git a/pkg/reconciler/revision/resources/queue.go b/pkg/reconciler/revision/resources/queue.go index e248e9a8e69e..581373fca96a 100644 --- a/pkg/reconciler/revision/resources/queue.go +++ b/pkg/reconciler/revision/resources/queue.go @@ -334,9 +334,6 @@ func makeQueueContainer(rev *v1.Revision, cfg *config.Config) (*corev1.Container }, { Name: "TRACING_CONFIG_ZIPKIN_ENDPOINT", Value: cfg.Tracing.ZipkinEndpoint, - }, { - Name: "TRACING_CONFIG_STACKDRIVER_PROJECT_ID", - Value: cfg.Tracing.StackdriverProjectID, }, { Name: "TRACING_CONFIG_DEBUG", Value: strconv.FormatBool(cfg.Tracing.Debug), diff --git a/pkg/reconciler/revision/resources/queue_test.go b/pkg/reconciler/revision/resources/queue_test.go index 3253a37c690d..8aabec3e0ec6 100644 --- a/pkg/reconciler/revision/resources/queue_test.go +++ b/pkg/reconciler/revision/resources/queue_test.go @@ -879,29 +879,28 @@ func TestTCPProbeGeneration(t *testing.T) { } var defaultEnv = map[string]string{ - "CONTAINER_CONCURRENCY": "0", - "ENABLE_PROFILING": "false", - "METRICS_DOMAIN": metrics.Domain(), - "METRICS_COLLECTOR_ADDRESS": "", - "QUEUE_SERVING_PORT": "8012", - "REVISION_TIMEOUT_SECONDS": "45", - "SERVING_CONFIGURATION": "", - "SERVING_ENABLE_PROBE_REQUEST_LOG": "false", - "SERVING_ENABLE_REQUEST_LOG": "false", - "SERVING_LOGGING_CONFIG": "", - "SERVING_LOGGING_LEVEL": "", - "SERVING_NAMESPACE": "foo", - "SERVING_REQUEST_LOG_TEMPLATE": "", - "SERVING_REQUEST_METRICS_BACKEND": "", - "SERVING_REVISION": "bar", - "SERVING_SERVICE": "", - "SYSTEM_NAMESPACE": system.Namespace(), - "TRACING_CONFIG_BACKEND": "", - "TRACING_CONFIG_DEBUG": "false", - "TRACING_CONFIG_SAMPLE_RATE": "0", - "TRACING_CONFIG_STACKDRIVER_PROJECT_ID": "", - "TRACING_CONFIG_ZIPKIN_ENDPOINT": "", - "USER_PORT": strconv.Itoa(v1.DefaultUserPort), + "CONTAINER_CONCURRENCY": "0", + "ENABLE_PROFILING": "false", + "METRICS_DOMAIN": metrics.Domain(), + "METRICS_COLLECTOR_ADDRESS": "", + "QUEUE_SERVING_PORT": "8012", + "REVISION_TIMEOUT_SECONDS": "45", + "SERVING_CONFIGURATION": "", + "SERVING_ENABLE_PROBE_REQUEST_LOG": "false", + "SERVING_ENABLE_REQUEST_LOG": "false", + "SERVING_LOGGING_CONFIG": "", + "SERVING_LOGGING_LEVEL": "", + "SERVING_NAMESPACE": "foo", + "SERVING_REQUEST_LOG_TEMPLATE": "", + "SERVING_REQUEST_METRICS_BACKEND": "", + "SERVING_REVISION": "bar", + "SERVING_SERVICE": "", + "SYSTEM_NAMESPACE": system.Namespace(), + "TRACING_CONFIG_BACKEND": "", + "TRACING_CONFIG_DEBUG": "false", + "TRACING_CONFIG_SAMPLE_RATE": "0", + "TRACING_CONFIG_ZIPKIN_ENDPOINT": "", + "USER_PORT": strconv.Itoa(v1.DefaultUserPort), } func probeJSON(container *corev1.Container) string { From 640c5592d6fd79c943129dbe7d0b3fe212a167df Mon Sep 17 00:00:00 2001 From: dprotaso Date: Mon, 12 Jul 2021 16:58:08 -0400 Subject: [PATCH 2/2] update checksums --- config/core/configmaps/observability.yaml | 2 +- config/core/configmaps/tracing.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/core/configmaps/observability.yaml b/config/core/configmaps/observability.yaml index 8f374856a0ef..1c7739de5e54 100644 --- a/config/core/configmaps/observability.yaml +++ b/config/core/configmaps/observability.yaml @@ -20,7 +20,7 @@ metadata: labels: serving.knative.dev/release: devel annotations: - knative.dev/example-checksum: "97c1d10b" + knative.dev/example-checksum: "fed4756e" data: _example: | ################################ diff --git a/config/core/configmaps/tracing.yaml b/config/core/configmaps/tracing.yaml index 9b8ade83f4fb..21254268761b 100644 --- a/config/core/configmaps/tracing.yaml +++ b/config/core/configmaps/tracing.yaml @@ -20,7 +20,7 @@ metadata: labels: serving.knative.dev/release: devel annotations: - knative.dev/example-checksum: "4002b4c2" + knative.dev/example-checksum: "26614636" data: _example: | ################################