Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-14612

MeterLogManager throws NPE when metrics are disabled

    XMLWordPrintable

Details

    • Bug Report
    • Resolution: Unresolved
    • L3 - Default
    • None
    • 7.17.0
    • None

    Description

      Environment (Required on creation):

      all distributions

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

      If the application starts with Metrics disabled, the MeterLogManager throws an NPE when migrating a process via batch operation.

      Steps to reproduce (Required on creation):

      With Metrics disabled via "metricEnabled", migrate a process via batch operation.

      Observed Behavior (Required on creation):

      A Null Pointer Exception is thrown in the MeterLogManager.

      Expected behavior (Required on creation):

      No NPE thrown

      Root Cause (Required on prioritization):

      • With "isMetricEnabled" flag disabled, the DbMetricsReporter is not initialized.
          protected void initMetrics() {
            if (isMetricsEnabled) {
        
              if (metricsRegistry == null) {
                metricsRegistry = new MetricsRegistry();
              }
        
              initDefaultMetrics(metricsRegistry);
        
              if (dbMetricsReporter == null) {
                dbMetricsReporter = new DbMetricsReporter(metricsRegistry, commandExecutorTxRequired);
              }
            }
          }
        
      • The MeterLogManager accesses the DbMetricsReporter regardless of the configuration flag
          protected boolean isEndTimeAfterLastReportInterval(MetricsQueryImpl query) {
            long reportingIntervalInSeconds = Context.getProcessEngineConfiguration()
              .getDbMetricsReporter()
              .getReportingIntervalInSeconds();
        
            return (query.getEndDate() == null
                || query.getEndDateMilliseconds()>= ClockUtil.getCurrentTime().getTime() - (1000 * reportingIntervalInSeconds));
          }
        

      Solution Ideas (Optional):

      The MeterLogManager honors the "isMetricEnabled" flag in the configuration and acts accordingly when disabled.

      Hints (optional):

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              Unassigned Unassigned
              alessandro.cavalli Alessandro Cavalli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Salesforce