Categorygithub.com/ONSdigital/dp-frontend-dataset-controller
repositorypackage
1.74.1
Repository: https://github.com/onsdigital/dp-frontend-dataset-controller.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

dp-frontend-dataset-controller

An HTTP service for the controlling of data and rendering templates relevant to a particular dataset.

Configuration

Environment variableDefaultDescription
API_ROUTER_URLhttp://localhost:23200/v1The URL of the dp-api-router
BIND_ADDR:20200The host and port to bind to.
CACHE_NAVIGATION_UPDATE_INTERVAL10sHow often the navigation cache is updated
DEBUGfalseEnable debug mode
DOWNLOAD_SERVICE_URLhttp://localhost:23600The URL of dp-download-service.
ENABLE_MULTIVARIATEfalseEnable 2021 multivariate datasets
ENABLE_NEW_NAV_BARfalseEnable new nav bar
ENABLE_PROFILERfalseFlag to enable go profiler
FEEDBACK_API_URLhttp://localhost:23200/v1/feedbackThe public dp-api-router address for feedback, not the internal one
GRACEFUL_SHUTDOWN_TIMEOUT5sThe graceful shutdown timeout in seconds
HEALTHCHECK_CRITICAL_TIMEOUT90sThe time taken for the health changes from warning state to critical due to subsystem check failures
HEALTHCHECK_INTERVAL30sThe time between calling healthcheck endpoints for check subsystems
OTEL_BATCH_TIMEOUT5sInterval between pushes to OT Collector
OTEL_EXPORTER_OTLP_ENDPOINThttp://localhost:4317URL for OpenTelemetry endpoint
OTEL_SERVICE_NAME"dp-frontend-dataset-controller"Service name to report to telemetry tools
OTEL_ENABLEDfalseFeature flag to enable OpenTelemetry
PATTERN_LIBRARY_ASSETS_PATH""Pattern library location
PPROF_TOKEN""The profiling token to access service profiling
SITE_DOMAINlocalhost
SUPPORTED_LANGUAGES[]string{"en", "cy"}Supported languages

Profiling

An optional /debug endpoint has been added, in order to profile this service via pprof go library. In order to use this endpoint, you will need to enable profiler flag and set a PPROF_TOKEN:

export ENABLE_PROFILER=true
export PPROF_TOKEN={generated uuid}

Then you can us the profiler as follows:

1- Start service, load test or if on environment wait for a number of requests to be made.

2- Send authenticated request and store response in a file (this can be best done in command line like so: curl <host>:<port>/debug/pprof/heap -H "Authorization: Bearer {generated uuid} > heap.out - see pprof documentation on other endpoints

3- View profile either using a web ui to navigate data (a) or using pprof on command line to navigate data (b) a) go tool pprof -http=:8080 heap.out b) go tool pprof heap.out, -o flag to see various options

Licence

Copyright © 2025, Office for National Statistics (https://www.ons.gov.uk)

Released under MIT license, see LICENSE for details.