loqate-verify-helmcharts

Observability

Verify’s QueryCoordinator and SpatialAPI produce three kinds of telemetry:

Signal How it’s exposed Configured with
Metrics Prometheus format on /metrics prometheusOperator (optional)
Traces OpenTelemetry: OTLP, Jaeger or stdout tracing (and the older jaeger)
Logs JSON lines on stdout Nothing to configure

Metrics

Collecting metrics

Both services serve metrics on their HTTP port at /metrics: port 8900 on QueryCoordinator and port 3000 on SpatialAPI.

If you run the Prometheus Operator, each chart can create a PodMonitor for you:

prometheusOperator:
  enabled: true
  podMonitorSelector:
    release: prometheus     # labels your Prometheus selects PodMonitors by
  podMonitorInterval: 30s

Other collectors can scrape the same endpoint. Use podAnnotations for annotation-based discovery.

Some backends, such as Amazon Managed Prometheus, add _total to counter names. For example, ngv_qc_attempt_count appears as ngv_qc_attempt_count_total.

QueryCoordinator metrics

Metric Type Labels What it measures
ngv_qc_address_count counter country, error Addresses processed (not requests)
ngv_qc_attempt_count counter country, dataset, premium, pii, success Calls from QueryCoordinator to SpatialAPI, including retries
ngv_qc_workers_used gauge none Fraction of QueryCoordinator worker threads in use, from 0 to 1 (0.75 means 75%)
ngv_qc_clustersize gauge none Members this pod can see in the memberlist cluster
ngv_qc_healthscore gauge none Memberlist health of this pod. Lower is better; 0 is healthy
request_counter counter code, method, url HTTP requests received
request_duration_sec histogram code, method, url HTTP request duration, in seconds

SpatialAPI metrics

Metric Type Labels What it measures
ngv_sa_workers_used gauge country, premium, pii Fraction of worker threads in use, from 0 to 1 (0.75 means 75%)
ngv_sa_queue_used gauge country, premium, pii Fraction of the request queue in use, from 0 to 1
ngv_clustersize gauge none Members this pod can see in the memberlist cluster
ngv_healthscore gauge none Memberlist health of this pod. Lower is better; 0 is healthy
request_counter counter code, country_code, method, url HTTP requests received
request_duration_sec histogram code, country_code, method, url HTTP request duration, in seconds

Reading the metrics

Tracing

Both services can send OpenTelemetry traces to an OTLP endpoint (for example an OpenTelemetry Collector), to Jaeger, or print them to stdout. Spans carry service.name QueryCoordinator or SpatialAPI, and requests can be followed from QueryCoordinator into SpatialAPI.

The tracing settings need chart spatial-api 0.14.0 and querycoordinator 0.10.0 or later, and images spatial-api 0.1.117461 and querycoordinator 0.1.117898 or later. Set the same tracing values on both charts.

Quick start: OTLP

To send traces over OTLP/HTTP:

tracing:
  exporter: otlp-http
  collectorEndpoint: http://otel-collector.observability:4318/v1/traces
  environment: production

The URL must include the path, normally /v1/traces. Without it, traces are sent to / and rejected.

To use OTLP/gRPC instead:

tracing:
  exporter: otlp-grpc
  collectorEndpoint: otel-collector.observability:4317
  collectorInsecure: true     # only if the endpoint doesn't use TLS

Tracing settings

Value Allowed values What it does
tracing.exporter otlp-http, otlp-grpc, jaeger, stdout Where spans are sent. Unset means jaeger
tracing.collectorEndpoint URL or host:port OTLP endpoint (required for otlp-*), or a Jaeger HTTP collector URL when exporter is jaeger or unset
tracing.collectorInsecure true, false true turns off TLS. OTLP only
tracing.samplerType always, never, ratio Which traces are recorded
tracing.samplerRatio above 0, up to 1 Fraction of traces recorded. Required when samplerType is ratio
tracing.environment any text Added to every span as deployment.environment

All of these are empty by default. Invalid values, or otlp-* without an endpoint, fail at helm install / helm upgrade with a message naming the setting.

Endpoints

Sampling

Default behaviour and the jaeger settings

Until the tracing settings were added, tracing was configured with the jaeger block. Those settings still work, and you don’t have to change them.

The defaults print every span to stdout. The default jaeger.disabled: true doesn’t turn tracing off: it sends spans to the pod logs as indented JSON, including spans for every health check. On a test install, about 98% of the log lines were spans. To stop most of it, set tracing.samplerType: never (see Sampling), or send traces somewhere with the settings above.

The tracing settings take precedence:

To move from the jaeger settings:

Today (jaeger.*) What it does Use instead (tracing.*)
disabled: true (default) Prints spans to stdout samplerType: never to stop them, or exporter: stdout to keep them
disabled: false with agentHost / agentPort Sends spans to a Jaeger agent over UDP Still works. Jaeger v2 has no UDP agent, so move to OTLP (Jaeger v2 accepts OTLP on ports 4317 and 4318)
endpoint Nothing. The services don’t read it collectorEndpoint
user / password Nothing. The services don’t read them No equivalent
samplerType: const with samplerParam: "1" / "0" Records every trace / none samplerType: always / never
samplerType: probabilistic with samplerParam: "0.1" Records one trace in ten samplerType: ratio with samplerRatio: 0.1

Logging

Both services write logs to stdout as JSON, one object per line:

{"level":"info","ts":1796028573.3045926,"caller":"reqproc/reqproc.go:263","msg":"ProcessSingleRequest","service":"QueryCoordinator","trace_id":"ec43aa0b81f55b36f3e8986cf34eb6c6","country_code":"GB","dataset":"GB","premium":false,"pii":false}

Request content in the logs. QueryCoordinator logs each request’s input addresses and results at info level (msg Request and Responses), including the request’s lqtKey. If your logs must not hold address data or keys, filter these lines when you collect the logs.

By default the logs also contain trace spans; see Default behaviour and the jaeger settings.