From f853b9858b6bbfee3e417f9317a4714d3491d9c8 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 21 Feb 2023 12:22:09 +0100 Subject: [PATCH 1/7] Redesign telemetry support in Helm chart This commit removes the old jaegerTracing section from the values.yaml file. Indeed, OpenTracing support has been replaced in 0.46.0 with OpenTelemetry support, and properties like quarkus.jaeger.service.name are not honored anymore. Instead, this commit creates a new tracing section that maps to OpenTelemetry configuration properties. This commit also introduces some doc changes: - In helm/nessie/README.md to explain how to test Nessie with OpenTelemetry enabled, and with custom Docker images; - In site/docs/try/configuration.md to create a new Traces chapter with a few troubleshooting tips. --- helm/nessie/README.md | 90 +++++++++++++++++-- helm/nessie/README.md.gotmpl | 77 ++++++++++++++++ helm/nessie/ci/inmemory-values.yaml | 2 +- helm/nessie/templates/_helpers.tpl | 11 +++ helm/nessie/templates/deployment.yaml | 39 ++++---- helm/nessie/values.yaml | 33 ++++--- .../src/main/resources/application.properties | 8 ++ site/docs/try/configuration.md | 30 +++++++ 8 files changed, 249 insertions(+), 41 deletions(-) diff --git a/helm/nessie/README.md b/helm/nessie/README.md index a45c308609e..9f64801b1de 100644 --- a/helm/nessie/README.md +++ b/helm/nessie/README.md @@ -73,12 +73,6 @@ $ helm uninstall --namespace nessie-ns nessie | ingress.enabled | bool | `false` | Specifies whether an ingress should be created. | | ingress.hosts | list | `[{"host":"chart-example.local","paths":[]}]` | A list of host paths used to configure the ingress. | | ingress.tls | list | `[]` | A list of TLS certificates; each entry has a list of hosts in the certificate, along with the secret name used to terminate TLS traffic on port 443. | -| jaegerTracing.enabled | bool | `false` | Specifies whether jaeger tracing for the nessie server should be enabled. | -| jaegerTracing.endpoint | string | `""` | The traces endpoint, in case the client should connect directly to the Collector, e.g. http://jaeger-collector:14268/api/traces | -| jaegerTracing.publishMetrics | bool | `true` | Whether metrics are published if tracing is enabled. | -| jaegerTracing.samplerParam | int | `1` | The request sampling probability. 1=Sample all requests. Set samplerParam to somewhere between 0 and 1, e.g. 0.50, if you do not wish to sample all requests. | -| jaegerTracing.samplerType | string | `"ratelimiting"` | The sampler type (const, probabilistic, ratelimiting or remote). | -| jaegerTracing.serviceName | string | `"nessie"` | The Jaeger service name. | | logLevel | string | `"INFO"` | The default logging level for the nessie server. | | mongodb.connectionString | string | `"mongodb://localhost:27017"` | The MongoDB connection string. | | mongodb.name | string | `"nessie"` | The MongoDB database name. | @@ -92,7 +86,7 @@ $ helm uninstall --namespace nessie-ns nessie | postgres.secret.name | string | `"postgres-creds"` | The secret name to pull Postgres credentials from. | | postgres.secret.password | string | `"postgres_password"` | The secret key storing the Postgres password. | | postgres.secret.username | string | `"postgres_username"` | The secret key storing the Postgres username. | -| replicaCount | int | `1` | The number of replicas to deploy (horizontal scaling). Beware that replicas are stateless; don't set this number > 1 when using ROCKS version store type. | +| replicaCount | int | `1` | The number of replicas to deploy (horizontal scaling). Beware that replicas are stateless; don't set this number > 1 when using INMEMORY or ROCKS version store types. | | resources | object | `{}` | Configures the resources requests and limits for nessie pods. We usually recommend not to specify default resources and to leave this as a conscious choice for the user. This also increases chances charts run on environments with little resources, such as Minikube. If you do want to specify resources, uncomment the following lines, adjust them as necessary, and remove the curly braces after 'resources:'. | | rocksdb.selectorLabels | object | `{}` | Labels to add to the persistent volume claim spec selector; a persistent volume with matching labels must exist. Leave empty if using dynamic provisioning. | | rocksdb.storageClassName | string | `"standard"` | The storage class name of the persistent volume claim to create. | @@ -108,6 +102,11 @@ $ helm uninstall --namespace nessie-ns nessie | serviceMonitor.interval | string | `""` | The scrape interval; leave empty to let Prometheus decide. Must be a valid duration, e.g. 1d, 1h30m, 5m, 10s. | | serviceMonitor.labels | object | `{}` | Labels for the created ServiceMonitor so that Prometheus operator can properly pick it up. | | tolerations | list | `[]` | A list of tolerations to apply to nessie pods. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/. | +| tracing.attributes | object | `{}` | Resource attributes to identify the nessie service among other tracing sources. See https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service. If left empty, the following attribute will be automatically added: service.name=nessie. | +| tracing.enabled | bool | `false` | Specifies whether tracing for the nessie server should be enabled. | +| tracing.endpoint | string | `"http://otlp-collector:4317"` | The collector endpoint URL to connect to (required). The endpoint URL must have either the http:// or the https:// scheme. The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). | +| tracing.ratio | int | `1` | The sampler ratio to use. Required when tracing.sampler=ratio, ignored otherwise. A value of 1 means: sample all requests. Set this to anything between 0 and 1, e.g. 0.50, if you do not wish to sample all requests. | +| tracing.sampler | string | `"on"` | The sampler to use for tracing. Valid values are: off (never sample); on (always sample); ratio (sample requests with the sampling ratio specified below). Defaults to on. | | versionStoreAdvancedConfig | object | `{}` | Advanced version store configuration. The key-value pairs specified here will be passed to the Nessie server as environment variables. See https://projectnessie.org/try/configuration/#version-store-advanced-settings for available properties. Naming convention: to set the property nessie.version.store.advanced.repository-id, use the key: NESSIE_VERSION_STORE_ADVANCED_REPOSITORY_ID. | | versionStoreType | string | `"INMEMORY"` | Which type of version store to use: INMEMORY, ROCKS, DYNAMO, MONGO, TRANSACTIONAL. | @@ -189,6 +188,83 @@ This is broadly following the example from https://kubernetes.io/docs/tasks/acce * Use the IP from the above output and add it to `/etc/hosts` via `echo "192.168.49.2 chart-example.local" | sudo tee /etc/hosts` * Verify that `curl chart-example.local` works +### OpenTelemetry Collector with Minikube + +* Start Minikube cluster: `minikube start` +* Create K8s Namespace: `kubectl create namespace nessie-ns` +* Install cert-manager: + +```bash +kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.yaml +``` + +* Install Jaeger Operator: + +```bash +kubectl create namespace observability +kubectl apply -f https://github.com/jaegertracing/jaeger-operator/releases/download/v1.42.0/jaeger-operator.yaml -n observability +``` + +If the above command fails with "failed to call webhook [...] connection refused", then cert-manager +was not yet ready. Wait a few seconds and try again. + +* Create a Jaeger instance in Nessie's namespace: + +```bash +kubectl apply -n nessie-ns -f - < 1 when using ROCKS version store type. +# Beware that replicas are stateless; don't set this number > 1 when using INMEMORY or ROCKS version store types. replicaCount: 1 image: @@ -97,19 +97,26 @@ authorization: # allowViewingBranch: op=='VIEW_REFERENCE' && role.startsWith('test_user') && ref.startsWith('allowedBranch') # allowCommits: op=='COMMIT_CHANGE_AGAINST_REFERENCE' && role.startsWith('test_user') && ref.startsWith('allowedBranch') -jaegerTracing: - # -- Specifies whether jaeger tracing for the nessie server should be enabled. +tracing: + # -- Specifies whether tracing for the nessie server should be enabled. enabled: false - # -- The traces endpoint, in case the client should connect directly to the Collector, e.g. http://jaeger-collector:14268/api/traces - endpoint: "" - # -- The Jaeger service name. - serviceName: nessie - # -- Whether metrics are published if tracing is enabled. - publishMetrics: true - # -- The sampler type (const, probabilistic, ratelimiting or remote). - samplerType: ratelimiting - # -- The request sampling probability. 1=Sample all requests. Set samplerParam to somewhere between 0 and 1, e.g. 0.50, if you do not wish to sample all requests. - samplerParam: 1 + # -- The collector endpoint URL to connect to (required). + # The endpoint URL must have either the http:// or the https:// scheme. + # The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). + endpoint: "http://otlp-collector:4317" + # -- The sampler to use for tracing. Valid values are: off (never sample); on (always sample); + # ratio (sample requests with the sampling ratio specified below). Defaults to on. + sampler: on + # -- The sampler ratio to use. Required when tracing.sampler=ratio, ignored otherwise. + # A value of 1 means: sample all requests. Set this to anything between 0 and 1, e.g. 0.50, + # if you do not wish to sample all requests. + ratio: 1 + # -- Resource attributes to identify the nessie service among other tracing sources. + # See https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service. + # If left empty, the following attribute will be automatically added: service.name=nessie. + attributes: + {} + # service.name: nessie serviceMonitor: # -- Specifies whether a ServiceMonitor for Prometheus operator should be created. diff --git a/servers/quarkus-server/src/main/resources/application.properties b/servers/quarkus-server/src/main/resources/application.properties index 47d9cd6263b..ff92ee173b8 100644 --- a/servers/quarkus-server/src/main/resources/application.properties +++ b/servers/quarkus-server/src/main/resources/application.properties @@ -168,8 +168,12 @@ quarkus.micrometer.enabled=true quarkus.micrometer.export.prometheus.enabled=true quarkus.micrometer.binder.jvm=true +# Trace collection settings quarkus.opentelemetry.enabled=true quarkus.opentelemetry.tracer.enabled=true +# The trace collector endpoint URL to connect to. +# Required, except in dev mode where it is set to http://localhost:4317 automatically. +# quarkus.opentelemetry.tracer.exporter.otlp=http://otlp-collector:4317 # Overrides ## dev overrides - dev is used when running Nessie in dev mode `mvn quarkus:dev` @@ -217,3 +221,7 @@ quarkus.micrometer.binder.http-server.match-patterns=\ # endless 'Retried waiting for GCLocker too often allocating * words' messages instead of a # "proper OutOfMemoryException" happen. %test.quarkus.micrometer.binder.jvm=false + + +quarkus.log.category."io.smallrye.config".level=DEBUG +quarkus.console.color=false diff --git a/site/docs/try/configuration.md b/site/docs/try/configuration.md index 748e2242244..4e63c697ae4 100644 --- a/site/docs/try/configuration.md +++ b/site/docs/try/configuration.md @@ -128,6 +128,36 @@ The following configurations are advanced configurations to configure how Nessie Metrics are published using prometheus and can be collected via standard methods. See: [Prometheus](https://prometheus.io). +### Traces + +Since Nessie 0.46.0, traces are published using OpenTelemetry. See [Using +OpenTelemetry](https://quarkus.io/guides/opentelemetry) in the Quarkus documentation. + +In order for the server to publish its traces, the +`quarkus.opentelemetry.tracer.exporter.otlp.endpoint` property _must_ be set. Its value must be a +valid collector endpoint URL, with either `http://` or `https://` scheme. The collector must talk +the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 3417), e.g. +"http://otlp-collector:4317". + +#### Troubleshooting traces + +If the server is unable to publish traces, check first for a log warning message like the following: + +``` +WARN [io.qua.ope.run.exp.otl.LateBoundBatchSpanProcessor] (vert.x-eventloop-thread-5) No BatchSpanProcessor delegate specified, no action taken. +``` + +This means that the `quarkus.opentelemetry.tracer.exporter.otlp.endpoint` property is not set. Set +it to a valid OTLP connector URL and try again. + +If you see a log error message like the following: + +``` +SEVERE [io.ope.exp.int.grp.OkHttpGrpcExporter] (OkHttp http://localhost:4317/...) Failed to export spans. The request could not be executed. Full error message: Failed to connect to localhost/0:0:0:0:0:0:0:1:4317 +``` + +This means that the server is unable to connect to the collector. Check that the collector is +running and that the URL is correct. ### Swagger UI The Swagger UI allows for testing the REST API and reading the API docs. It is available From 758995e8533352bb4cc813cefb9d88dfd8617512 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 21 Feb 2023 18:29:37 +0100 Subject: [PATCH 2/7] Remove spurious change --- .../quarkus-server/src/main/resources/application.properties | 4 ---- 1 file changed, 4 deletions(-) diff --git a/servers/quarkus-server/src/main/resources/application.properties b/servers/quarkus-server/src/main/resources/application.properties index ff92ee173b8..c1d8663d583 100644 --- a/servers/quarkus-server/src/main/resources/application.properties +++ b/servers/quarkus-server/src/main/resources/application.properties @@ -221,7 +221,3 @@ quarkus.micrometer.binder.http-server.match-patterns=\ # endless 'Retried waiting for GCLocker too often allocating * words' messages instead of a # "proper OutOfMemoryException" happen. %test.quarkus.micrometer.binder.jvm=false - - -quarkus.log.category."io.smallrye.config".level=DEBUG -quarkus.console.color=false From e534e83472cf4547d119482cd78f639277c13d80 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 21 Feb 2023 18:29:46 +0100 Subject: [PATCH 3/7] Add link to Quarkus docs --- helm/nessie/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/helm/nessie/values.yaml b/helm/nessie/values.yaml index 8e279d01b2f..4b8954b4d12 100644 --- a/helm/nessie/values.yaml +++ b/helm/nessie/values.yaml @@ -103,6 +103,7 @@ tracing: # -- The collector endpoint URL to connect to (required). # The endpoint URL must have either the http:// or the https:// scheme. # The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). + # See https://quarkus.io/guides/opentelemetry for more information. endpoint: "http://otlp-collector:4317" # -- The sampler to use for tracing. Valid values are: off (never sample); on (always sample); # ratio (sample requests with the sampling ratio specified below). Defaults to on. From 3171cab31f68bb0be1720cd14f6a96c409350a11 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 21 Feb 2023 18:33:08 +0100 Subject: [PATCH 4/7] Add step to build the project before building the Docker image --- helm/nessie/README.md | 13 ++++++++++--- helm/nessie/README.md.gotmpl | 11 +++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/helm/nessie/README.md b/helm/nessie/README.md index 9f64801b1de..c20ceae4c11 100644 --- a/helm/nessie/README.md +++ b/helm/nessie/README.md @@ -104,7 +104,7 @@ $ helm uninstall --namespace nessie-ns nessie | tolerations | list | `[]` | A list of tolerations to apply to nessie pods. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/. | | tracing.attributes | object | `{}` | Resource attributes to identify the nessie service among other tracing sources. See https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service. If left empty, the following attribute will be automatically added: service.name=nessie. | | tracing.enabled | bool | `false` | Specifies whether tracing for the nessie server should be enabled. | -| tracing.endpoint | string | `"http://otlp-collector:4317"` | The collector endpoint URL to connect to (required). The endpoint URL must have either the http:// or the https:// scheme. The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). | +| tracing.endpoint | string | `"http://otlp-collector:4317"` | The collector endpoint URL to connect to (required). The endpoint URL must have either the http:// or the https:// scheme. The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). See https://quarkus.io/guides/opentelemetry for more information. | | tracing.ratio | int | `1` | The sampler ratio to use. Required when tracing.sampler=ratio, ignored otherwise. A value of 1 means: sample all requests. Set this to anything between 0 and 1, e.g. 0.50, if you do not wish to sample all requests. | | tracing.sampler | string | `"on"` | The sampler to use for tracing. Valid values are: off (never sample); on (always sample); ratio (sample requests with the sampling ratio specified below). Defaults to on. | | versionStoreAdvancedConfig | object | `{}` | Advanced version store configuration. The key-value pairs specified here will be passed to the Nessie server as environment variables. See https://projectnessie.org/try/configuration/#version-store-advanced-settings for available properties. Naming convention: to set the property nessie.version.store.advanced.repository-id, use the key: NESSIE_VERSION_STORE_ADVANCED_REPOSITORY_ID. | @@ -249,8 +249,15 @@ killall -9 kubectl ### Custom Docker images for Nessie with Minikube -You can modify Nessie's code and deploy it to Minikube. Once you've made your changes, build the -Docker image and deploy it as follows: +You can modify Nessie's code and deploy it to Minikube. + +Once you've satisfied with your changes, build the project with: + +```bash +./gradlew :nessie-quarkus:quarkusBuild +``` + +Then build the Docker image and deploy it as follows: ```bash eval $(minikube docker-env) diff --git a/helm/nessie/README.md.gotmpl b/helm/nessie/README.md.gotmpl index a1637d1ccc3..f8ede20e9b7 100644 --- a/helm/nessie/README.md.gotmpl +++ b/helm/nessie/README.md.gotmpl @@ -190,8 +190,15 @@ killall -9 kubectl ### Custom Docker images for Nessie with Minikube -You can modify Nessie's code and deploy it to Minikube. Once you've made your changes, build the -Docker image and deploy it as follows: +You can modify Nessie's code and deploy it to Minikube. + +Once you've satisfied with your changes, build the project with: + +```bash +./gradlew :nessie-quarkus:quarkusBuild +``` + +Then build the Docker image and deploy it as follows: ```bash eval $(minikube docker-env) From 9f6efa522675432963fdbec6ced877a67868c8b7 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 21 Feb 2023 18:39:51 +0100 Subject: [PATCH 5/7] Use true/false instead of on/off --- helm/nessie/README.md | 2 +- helm/nessie/values.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/nessie/README.md b/helm/nessie/README.md index c20ceae4c11..42d58154291 100644 --- a/helm/nessie/README.md +++ b/helm/nessie/README.md @@ -106,7 +106,7 @@ $ helm uninstall --namespace nessie-ns nessie | tracing.enabled | bool | `false` | Specifies whether tracing for the nessie server should be enabled. | | tracing.endpoint | string | `"http://otlp-collector:4317"` | The collector endpoint URL to connect to (required). The endpoint URL must have either the http:// or the https:// scheme. The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). See https://quarkus.io/guides/opentelemetry for more information. | | tracing.ratio | int | `1` | The sampler ratio to use. Required when tracing.sampler=ratio, ignored otherwise. A value of 1 means: sample all requests. Set this to anything between 0 and 1, e.g. 0.50, if you do not wish to sample all requests. | -| tracing.sampler | string | `"on"` | The sampler to use for tracing. Valid values are: off (never sample); on (always sample); ratio (sample requests with the sampling ratio specified below). Defaults to on. | +| tracing.sampler | bool | `true` | The sampler to use for tracing. Valid values are: false (never sample); true (always sample); or the string "ratio" – in which case the actual ratio to use must be specified below. Defaults to true. | | versionStoreAdvancedConfig | object | `{}` | Advanced version store configuration. The key-value pairs specified here will be passed to the Nessie server as environment variables. See https://projectnessie.org/try/configuration/#version-store-advanced-settings for available properties. Naming convention: to set the property nessie.version.store.advanced.repository-id, use the key: NESSIE_VERSION_STORE_ADVANCED_REPOSITORY_ID. | | versionStoreType | string | `"INMEMORY"` | Which type of version store to use: INMEMORY, ROCKS, DYNAMO, MONGO, TRANSACTIONAL. | diff --git a/helm/nessie/values.yaml b/helm/nessie/values.yaml index 4b8954b4d12..afc076738e8 100644 --- a/helm/nessie/values.yaml +++ b/helm/nessie/values.yaml @@ -105,9 +105,9 @@ tracing: # The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). # See https://quarkus.io/guides/opentelemetry for more information. endpoint: "http://otlp-collector:4317" - # -- The sampler to use for tracing. Valid values are: off (never sample); on (always sample); - # ratio (sample requests with the sampling ratio specified below). Defaults to on. - sampler: on + # -- The sampler to use for tracing. Valid values are: false (never sample); true (always sample); + # or the string "ratio" – in which case the actual ratio to use must be specified below. Defaults to true. + sampler: true # -- The sampler ratio to use. Required when tracing.sampler=ratio, ignored otherwise. # A value of 1 means: sample all requests. Set this to anything between 0 and 1, e.g. 0.50, # if you do not wish to sample all requests. From 62887cfaecfc8bc07aec984c251c4ef09fe4bc5e Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Tue, 21 Feb 2023 19:21:56 +0100 Subject: [PATCH 6/7] Simplify tracing.sample --- helm/nessie/README.md | 3 +-- helm/nessie/templates/deployment.yaml | 16 +++++++++++----- helm/nessie/values.yaml | 10 +++------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/helm/nessie/README.md b/helm/nessie/README.md index 42d58154291..0130bf26ab6 100644 --- a/helm/nessie/README.md +++ b/helm/nessie/README.md @@ -105,8 +105,7 @@ $ helm uninstall --namespace nessie-ns nessie | tracing.attributes | object | `{}` | Resource attributes to identify the nessie service among other tracing sources. See https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service. If left empty, the following attribute will be automatically added: service.name=nessie. | | tracing.enabled | bool | `false` | Specifies whether tracing for the nessie server should be enabled. | | tracing.endpoint | string | `"http://otlp-collector:4317"` | The collector endpoint URL to connect to (required). The endpoint URL must have either the http:// or the https:// scheme. The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). See https://quarkus.io/guides/opentelemetry for more information. | -| tracing.ratio | int | `1` | The sampler ratio to use. Required when tracing.sampler=ratio, ignored otherwise. A value of 1 means: sample all requests. Set this to anything between 0 and 1, e.g. 0.50, if you do not wish to sample all requests. | -| tracing.sampler | bool | `true` | The sampler to use for tracing. Valid values are: false (never sample); true (always sample); or the string "ratio" – in which case the actual ratio to use must be specified below. Defaults to true. | +| tracing.sample | string | `"all"` | Which requests should be sampled. Valid values are: "all", "none", or a ratio between 0.0 and 1.0 (inclusive). E.g. 0.5 means that 50% of the requests will be sampled. | | versionStoreAdvancedConfig | object | `{}` | Advanced version store configuration. The key-value pairs specified here will be passed to the Nessie server as environment variables. See https://projectnessie.org/try/configuration/#version-store-advanced-settings for available properties. Naming convention: to set the property nessie.version.store.advanced.repository-id, use the key: NESSIE_VERSION_STORE_ADVANCED_REPOSITORY_ID. | | versionStoreType | string | `"INMEMORY"` | Which type of version store to use: INMEMORY, ROCKS, DYNAMO, MONGO, TRANSACTIONAL. | diff --git a/helm/nessie/templates/deployment.yaml b/helm/nessie/templates/deployment.yaml index b956d88fcee..28218373f56 100644 --- a/helm/nessie/templates/deployment.yaml +++ b/helm/nessie/templates/deployment.yaml @@ -153,13 +153,19 @@ spec: {{- else }} value: "service.name={{ include "nessie.name" . }}" {{- end }} - {{- if .Values.tracing.sampler }} + {{- if .Values.tracing.sample }} + {{ if eq .Values.tracing.sample "all" }} - name: QUARKUS_OPENTELEMETRY_TRACER_SAMPLER - value: {{ .Values.tracing.sampler | toString | replace "true" "on" | replace "false" "off" | quote }} - {{- end }} - {{- if .Values.tracing.ratio }} + value: "on" + {{- else if eq .Values.tracing.sample "none" }} + - name: QUARKUS_OPENTELEMETRY_TRACER_SAMPLER + value: "off" + {{- else }} + - name: QUARKUS_OPENTELEMETRY_TRACER_SAMPLER + value: "ratio" - name: QUARKUS_OPENTELEMETRY_TRACER_SAMPLER_RATIO - value: {{ .Values.tracing.ratio | quote }} + value: {{ .Values.tracing.sample | quote }} + {{- end }} {{- end }} {{- end }} diff --git a/helm/nessie/values.yaml b/helm/nessie/values.yaml index afc076738e8..8056dc668ca 100644 --- a/helm/nessie/values.yaml +++ b/helm/nessie/values.yaml @@ -105,13 +105,9 @@ tracing: # The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). # See https://quarkus.io/guides/opentelemetry for more information. endpoint: "http://otlp-collector:4317" - # -- The sampler to use for tracing. Valid values are: false (never sample); true (always sample); - # or the string "ratio" – in which case the actual ratio to use must be specified below. Defaults to true. - sampler: true - # -- The sampler ratio to use. Required when tracing.sampler=ratio, ignored otherwise. - # A value of 1 means: sample all requests. Set this to anything between 0 and 1, e.g. 0.50, - # if you do not wish to sample all requests. - ratio: 1 + # -- Which requests should be sampled. Valid values are: "all", "none", or a ratio between 0.0 and + # 1.0 (inclusive). E.g. 0.5 means that 50% of the requests will be sampled. + sample: all # -- Resource attributes to identify the nessie service among other tracing sources. # See https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service. # If left empty, the following attribute will be automatically added: service.name=nessie. From a584a59136ab55d56ab283774afebcac10202273 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Wed, 22 Feb 2023 09:54:27 +0100 Subject: [PATCH 7/7] Use quarkus.application.name if service.name not provided --- helm/nessie/README.md | 2 +- helm/nessie/templates/deployment.yaml | 4 +--- helm/nessie/values.yaml | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/helm/nessie/README.md b/helm/nessie/README.md index 0130bf26ab6..73f9626093b 100644 --- a/helm/nessie/README.md +++ b/helm/nessie/README.md @@ -102,7 +102,7 @@ $ helm uninstall --namespace nessie-ns nessie | serviceMonitor.interval | string | `""` | The scrape interval; leave empty to let Prometheus decide. Must be a valid duration, e.g. 1d, 1h30m, 5m, 10s. | | serviceMonitor.labels | object | `{}` | Labels for the created ServiceMonitor so that Prometheus operator can properly pick it up. | | tolerations | list | `[]` | A list of tolerations to apply to nessie pods. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/. | -| tracing.attributes | object | `{}` | Resource attributes to identify the nessie service among other tracing sources. See https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service. If left empty, the following attribute will be automatically added: service.name=nessie. | +| tracing.attributes | object | `{}` | Resource attributes to identify the nessie service among other tracing sources. See https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service. If left empty, traces will be attached to a service named "Nessie"; to change this, provide a service.name attribute here. | | tracing.enabled | bool | `false` | Specifies whether tracing for the nessie server should be enabled. | | tracing.endpoint | string | `"http://otlp-collector:4317"` | The collector endpoint URL to connect to (required). The endpoint URL must have either the http:// or the https:// scheme. The collector must talk the OpenTelemetry protocol (OTLP) and the port must be its gRPC port (by default 4317). See https://quarkus.io/guides/opentelemetry for more information. | | tracing.sample | string | `"all"` | Which requests should be sampled. Valid values are: "all", "none", or a ratio between 0.0 and 1.0 (inclusive). E.g. 0.5 means that 50% of the requests will be sampled. | diff --git a/helm/nessie/templates/deployment.yaml b/helm/nessie/templates/deployment.yaml index 28218373f56..235760f8c13 100644 --- a/helm/nessie/templates/deployment.yaml +++ b/helm/nessie/templates/deployment.yaml @@ -147,11 +147,9 @@ spec: value: "true" - name: QUARKUS_OPENTELEMETRY_TRACER_EXPORTER_OTLP_ENDPOINT value: {{ .Values.tracing.endpoint | quote }} - - name: QUARKUS_OPENTELEMETRY_TRACER_RESOURCE_ATTRIBUTES {{- if .Values.tracing.attributes }} + - name: QUARKUS_OPENTELEMETRY_TRACER_RESOURCE_ATTRIBUTES value: "{{- include "nessie.dictToString" .Values.tracing.attributes }}" - {{- else }} - value: "service.name={{ include "nessie.name" . }}" {{- end }} {{- if .Values.tracing.sample }} {{ if eq .Values.tracing.sample "all" }} diff --git a/helm/nessie/values.yaml b/helm/nessie/values.yaml index 8056dc668ca..c0dd5b2a2c2 100644 --- a/helm/nessie/values.yaml +++ b/helm/nessie/values.yaml @@ -110,10 +110,10 @@ tracing: sample: all # -- Resource attributes to identify the nessie service among other tracing sources. # See https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/#service. - # If left empty, the following attribute will be automatically added: service.name=nessie. + # If left empty, traces will be attached to a service named "Nessie"; to change this, provide a service.name attribute here. attributes: {} - # service.name: nessie + # service.name: my-nessie serviceMonitor: # -- Specifies whether a ServiceMonitor for Prometheus operator should be created.