Change /healthz to /healthcheck and remove unused docker compose templates (#54171)
This commit is contained in:
@@ -53,5 +53,5 @@ spec:
|
||||
httpGet:
|
||||
# WARNING: This should be updated to a meaningful endpoint for your application which will return a 200 once the app is fully started.
|
||||
# See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes
|
||||
path: /healthz
|
||||
path: /healthcheck
|
||||
port: http
|
||||
|
||||
@@ -9,7 +9,7 @@ const router = express.Router()
|
||||
* instance remains in the pool to handle requests
|
||||
* For example: if we have a failing database connection we may return a 500 status here.
|
||||
*/
|
||||
router.get('/', function healthz(req, res) {
|
||||
router.get('/', function healthcheck(req, res) {
|
||||
noCacheControl(res)
|
||||
|
||||
res.sendStatus(200)
|
||||
@@ -27,7 +27,7 @@ import findPage from './find-page.js'
|
||||
import blockRobots from './block-robots'
|
||||
import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets'
|
||||
import api from './api'
|
||||
import healthz from './healthz'
|
||||
import healthcheck from './healthcheck'
|
||||
import manifestJson from './manifest-json'
|
||||
import buildInfo from './build-info'
|
||||
import reqHeaders from './req-headers'
|
||||
@@ -66,16 +66,14 @@ import shielding from '@/shielding/middleware'
|
||||
import tracking from '@/tracking/middleware'
|
||||
import { MAX_REQUEST_TIMEOUT } from '@/frame/lib/constants.js'
|
||||
|
||||
const { DEPLOYMENT_ENV, NODE_ENV } = process.env
|
||||
const { NODE_ENV } = process.env
|
||||
const isTest = NODE_ENV === 'test' || process.env.GITHUB_ACTIONS === 'true'
|
||||
|
||||
// By default, logging each request (with morgan), is on. And by default
|
||||
// it's off if you're in a production environment or running automated tests.
|
||||
// But if you set the env var, that takes precedence.
|
||||
const ENABLE_DEV_LOGGING = Boolean(
|
||||
process.env.ENABLE_DEV_LOGGING
|
||||
? JSON.parse(process.env.ENABLE_DEV_LOGGING)
|
||||
: !(DEPLOYMENT_ENV === 'azure' || isTest),
|
||||
process.env.ENABLE_DEV_LOGGING ? JSON.parse(process.env.ENABLE_DEV_LOGGING) : !isTest,
|
||||
)
|
||||
|
||||
const ENABLE_FASTLY_TESTING = JSON.parse(process.env.ENABLE_FASTLY_TESTING || 'false')
|
||||
@@ -120,7 +118,7 @@ export default function (app: Express) {
|
||||
// Put this early to make it as fast as possible because it's used,
|
||||
// and used very often, by the Azure load balancer to check the
|
||||
// health of each node.
|
||||
app.use('/healthz', healthz)
|
||||
app.use('/healthcheck', healthcheck)
|
||||
|
||||
// Must appear before static assets and all other requests
|
||||
// otherwise we won't be able to benefit from that functionality
|
||||
|
||||
@@ -87,7 +87,7 @@ export default function handleRedirects(req: ExtendedRequest, res: Response, nex
|
||||
// the language prefix.
|
||||
// We can't always force on the language prefix because some URLs
|
||||
// aren't pages. They're other middleware endpoints such as
|
||||
// `/healthz` which should never redirect.
|
||||
// `/healthcheck` which should never redirect.
|
||||
// But for example, a `/authentication/connecting-to-github-with-ssh`
|
||||
// needs to become `/en/authentication/connecting-to-github-with-ssh`
|
||||
const possibleRedirectTo = `/en${req.path}`
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
ghdocs-prod:
|
||||
image: '#{IMAGE}#'
|
||||
ports:
|
||||
- '4000:4000'
|
||||
environment:
|
||||
NODE_ENV: ${NODE_ENV}
|
||||
NODE_OPTIONS: ${NODE_OPTIONS}
|
||||
DD_API_KEY: ${DD_API_KEY}
|
||||
COOKIE_SECRET: ${COOKIE_SECRET}
|
||||
HYDRO_ENDPOINT: ${HYDRO_ENDPOINT}
|
||||
HYDRO_SECRET: ${HYDRO_SECRET}
|
||||
HAYSTACK_URL: ${HAYSTACK_URL}
|
||||
HEROKU_APP_NAME: ${HEROKU_APP_NAME}
|
||||
DEPLOYMENT_ENV: ${DEPLOYMENT_ENV}
|
||||
HEROKU_PRODUCTION_APP: true
|
||||
PORT: 4000
|
||||
DD_AGENT_HOST: datadog-agent
|
||||
depends_on:
|
||||
- datadog-agent
|
||||
restart: always
|
||||
|
||||
datadog-agent:
|
||||
image: 'ghdocsprod.azurecr.io/datadog/dogstatsd:latest'
|
||||
ports:
|
||||
- '8125:8125'
|
||||
environment:
|
||||
DD_API_KEY: ${DD_API_KEY}
|
||||
DD_AGENT_HOST: datadog-agent
|
||||
DD_HISTOGRAM_PERCENTILES: 0.99 0.95 0.50
|
||||
DD_HOSTNAME_TRUST_UTS_NAMESPACE: true
|
||||
@@ -1,33 +0,0 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
ghdocs-staging:
|
||||
image: '#{IMAGE}#'
|
||||
ports:
|
||||
- '4000:4000'
|
||||
environment:
|
||||
NODE_ENV: ${NODE_ENV}
|
||||
NODE_OPTIONS: ${NODE_OPTIONS}
|
||||
DD_API_KEY: ${DD_API_KEY}
|
||||
COOKIE_SECRET: ${COOKIE_SECRET}
|
||||
HYDRO_ENDPOINT: ${HYDRO_ENDPOINT}
|
||||
HYDRO_SECRET: ${HYDRO_SECRET}
|
||||
HAYSTACK_URL: ${HAYSTACK_URL}
|
||||
HEROKU_APP_NAME: ${HEROKU_APP_NAME}
|
||||
ENABLED_LANGUAGES: ${ENABLED_LANGUAGES}
|
||||
DEPLOYMENT_ENV: ${DEPLOYMENT_ENV}
|
||||
HEROKU_PRODUCTION_APP: true
|
||||
PORT: 4000
|
||||
DD_AGENT_HOST: datadog-agent
|
||||
depends_on:
|
||||
- datadog-agent
|
||||
restart: always
|
||||
|
||||
datadog-agent:
|
||||
image: datadog/dogstatsd:7.32.4
|
||||
ports:
|
||||
- '8125:8125'
|
||||
environment:
|
||||
DD_API_KEY: ${DD_API_KEY}
|
||||
DD_AGENT_HOST: datadog-agent
|
||||
DD_HISTOGRAM_PERCENTILES: 0.99 0.95 0.50
|
||||
@@ -6,7 +6,7 @@ const DELAY_SECONDS = 15
|
||||
|
||||
/*
|
||||
* Promise resolves once url is healthy or fails if timeout has passed
|
||||
* @param {string} url - health url, e.g. docs.com/healthz
|
||||
* @param {string} url - health url, e.g. docs.com/healthcheck
|
||||
*/
|
||||
export async function waitUntilUrlIsHealthy(url: string) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user