mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
🐛 Fixed 500 errors when viewing posts in development mode
closes https://linear.app/tryghost/issue/ONC-115 - OpenTelemetry was throwing errors when viewing posts - disabled the instrumentation in development mode so it requires explicit config to enable
This commit is contained in:
parent
a837cf0247
commit
5b2eaec982
1 changed files with 3 additions and 2 deletions
|
@ -1,9 +1,10 @@
|
||||||
async function initOpenTelemetry({config}) {
|
async function initOpenTelemetry({config}) {
|
||||||
// Always enable in development environment
|
// Always enable in development environment
|
||||||
// In production, only enable if explicitly enabled via config `opentelemetry:enabled`
|
// In production, only enable if explicitly enabled via config `opentelemetry:enabled`
|
||||||
const isDevelopment = process.env.NODE_ENV === 'development';
|
// TODO: Instrumentation currently breaks viewing posts - disabled until we can fix
|
||||||
|
// const isDevelopment = process.env.NODE_ENV === 'development';
|
||||||
const isConfigured = config.get('opentelemetry:enabled');
|
const isConfigured = config.get('opentelemetry:enabled');
|
||||||
const enabled = isDevelopment || isConfigured;
|
const enabled = isConfigured; // || isDevelopment;
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue