Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imprv: OpenTelemetry settings #8811

Open
wants to merge 1 commit into
base: feat/opentelemetry
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/app/src/server/crowi/opentelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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';
}
}
Expand Down
14 changes: 10 additions & 4 deletions apps/app/src/server/service/config-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down