fix(revisions): instrumenting opentelemetry on non production
This commit is contained in:
parent
cb23506c1f
commit
0c89d8bd2d
3 changed files with 11 additions and 2 deletions
|
@ -46,8 +46,10 @@ void container.load().then((container) => {
|
|||
|
||||
const serverInstance = server.build()
|
||||
|
||||
const openTelemetrySDK = container.get<NodeSDK>(TYPES.Revisions_OpenTelemetrySDK)
|
||||
openTelemetrySDK.start()
|
||||
if (!container.get<boolean>(TYPES.Revisions_IS_CONFIGURED_FOR_HOME_SERVER_OR_SELF_HOSTING)) {
|
||||
const openTelemetrySDK = container.get<NodeSDK>(TYPES.Revisions_OpenTelemetrySDK)
|
||||
openTelemetrySDK.start()
|
||||
}
|
||||
|
||||
serverInstance.listen(env.get('PORT'))
|
||||
|
||||
|
|
|
@ -112,6 +112,10 @@ export class ContainerConfigLoader {
|
|||
defaultScope: 'Singleton',
|
||||
})
|
||||
|
||||
container
|
||||
.bind<boolean>(TYPES.Revisions_IS_CONFIGURED_FOR_HOME_SERVER_OR_SELF_HOSTING)
|
||||
.toConstantValue(isConfiguredForHomeServerOrSelfHosting)
|
||||
|
||||
if (!isConfiguredForInMemoryCache) {
|
||||
const redisUrl = env.get('REDIS_URL')
|
||||
const isRedisInClusterMode = redisUrl.indexOf(',') > 0
|
||||
|
|
|
@ -40,6 +40,9 @@ const TYPES = {
|
|||
Revisions_SNS_AWS_REGION: Symbol.for('Revisions_SNS_AWS_REGION'),
|
||||
Revisions_NEW_RELIC_ENABLED: Symbol.for('Revisions_NEW_RELIC_ENABLED'),
|
||||
Revisions_VERSION: Symbol.for('Revisions_VERSION'),
|
||||
Revisions_IS_CONFIGURED_FOR_HOME_SERVER_OR_SELF_HOSTING: Symbol.for(
|
||||
'Revisions_IS_CONFIGURED_FOR_HOME_SERVER_OR_SELF_HOSTING',
|
||||
),
|
||||
// use cases
|
||||
Revisions_GetRevisionsMetada: Symbol.for('Revisions_GetRevisionsMetada'),
|
||||
Revisions_GetRevision: Symbol.for('Revisions_GetRevision'),
|
||||
|
|
Loading…
Reference in a new issue