Skip to content

Commit

Permalink
build: add diag log (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlnf authored Jan 26, 2025
1 parent 9d919e2 commit 88b81ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/instrumentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const pkg = require('../package.json')
require('dotenv').config()

const instrumentationEnabled =
process.env.GRAFANA_INSTRUMENTATION_ENABLED !== 'false' // default to true
const diagnosticsEnabled = process.env.GRAFANA_DIAGNOSTICS_ENABLED === 'true' // default to false
process.env.GRAFANA_INSTRUMENTATION_ENABLED !== false // default to true
const diagnosticsEnabled = process.env.GRAFANA_DIAGNOSTICS_ENABLED === true // default to false
const endpoint = process.env.GRAFANA_OTLP_ENDPOINT
const instanceId = process.env.GRAFANA_INSTANCE_ID
const apiKey = process.env.GRAFANA_API_KEY
Expand Down Expand Up @@ -77,6 +77,7 @@ const sdk = new NodeSDK({
sdk.start()

if (diagnosticsEnabled) {
console.log('Grafana OTLP diagnostics enabled.')
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.VERBOSE)
}

Expand Down

0 comments on commit 88b81ab

Please sign in to comment.