Skip to content

Control logging and metrics independently #16264

Description

@akash1810

The DISABLE_LOGGING_AND_METRICS environment variable is used in two places:

  1. Configuring Log4JS
    if (process.env.DISABLE_LOGGING_AND_METRICS === 'true') {
    configure(disableLog4js);
    } else {
    configure(enableLog4js);
    }
  2. Publishing application level CloudWatch Metrics
    if (process.env.DISABLE_LOGGING_AND_METRICS !== 'true') {
    setInterval(() => {
    recordBaselineCloudWatchMetrics();
    }, 10 * 1000);
    }

When run in a container (see #16234) it is more standard to log to stdout/stderr and then have a sidecar container process the logs. Therefore, Log4JS is not needed.

When running in a container, we still want to produce application metrics. Can we separate this environment variable in two to enable/disable logging and metrics independently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions