diff --git a/apps/app/src/server/crowi/opentelemetry.ts b/apps/app/src/server/crowi/opentelemetry.ts index db57140fec6..db67a9455cf 100644 --- a/apps/app/src/server/crowi/opentelemetry.ts +++ b/apps/app/src/server/crowi/opentelemetry.ts @@ -31,7 +31,7 @@ export class OpenTelemetry { return { resource: new Resource({ [SEMRESATTRS_SERVICE_NAME]: this.name, - [SEMRESATTRS_SERVICE_INSTANCE_ID]: configManager.getConfig('crowi', 'instrumentation:serviceInstanceId'), + [SEMRESATTRS_SERVICE_INSTANCE_ID]: configManager.getConfig('crowi', 'otel:serviceInstanceId'), [SEMRESATTRS_SERVICE_VERSION]: this.version, }), traceExporter: new OTLPTraceExporter(), @@ -54,9 +54,9 @@ export class OpenTelemetry { * Since otel library sees it. */ private overwriteSdkDisabled(): void { - const instrumentationEnabled = configManager.getConfig('crowi', 'instrumentation:enabled'); - if (instrumentationEnabled != null && instrumentationEnabled === false) { - logger.warn("OTEL_SDK_DISABLED is set 'true' since GROWI's 'instrumentation:enabled' config is false."); + const instrumentationEnabled = configManager.getConfig('crowi', 'otel:enabled'); + if (instrumentationEnabled === false) { + logger.warn("OTEL_SDK_DISABLED will be set 'true' since GROWI's 'otel:enabled' config is false."); process.env.OTEL_SDK_DISABLED = 'true'; } } diff --git a/apps/app/src/server/service/config-loader.ts b/apps/app/src/server/service/config-loader.ts index 209fcc7cd46..11876d278c5 100644 --- a/apps/app/src/server/service/config-loader.ts +++ b/apps/app/src/server/service/config-loader.ts @@ -723,17 +723,23 @@ const ENV_VAR_NAME_TO_CONFIG_INFO = { type: ValueType.NUMBER, default: 172800, // 2 days }, - OPENTELEMETRY_INSTRUMENTATION_ENABLED: { + OPENTELEMETRY_ENABLED: { ns: 'crowi', - key: 'instrumentation:enabled', + key: 'otel:enabled', type: ValueType.BOOLEAN, - default: null, + default: true, + }, + OPENTELEMETRY_IS_APP_SITE_URL_HASHED: { + ns: 'crowi', + key: 'otel:isAppSiteUrlHashed', + type: ValueType.BOOLEAN, + default: false, }, // TODO: fix after the decision of the instrumentation data specification // https://redmine.weseek.co.jp/issues/144351 OPENTELEMETRY_SERVICE_INSTANCE_ID: { ns: 'crowi', - key: 'instrumentation:serviceInstanceId', + key: 'otel:serviceInstanceId', type: ValueType.STRING, default: null, },