Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-2912

Do not send billable usage messages if remitted value is zero

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • swatch-billable-usage
    • 5
    • True
    • Hide

      None

      Show
      None
    • False

      The billable usage remittances are only created when the remitted value is higher than zero: https://github.com/RedHatInsights/rhsm-subscriptions/blob/a06ba8f5352580d99a893701d42d672544867475/swatch-billable-usage/src/main/java/com/redhat/swatch/billable/usage/services/BillableUsageService.java#L117

      However, when the remitted value is equal or lesser than zero, the message is still sent to the topic causing the consumers to unnecessary handle it. See the following traces:

      2024-09-09 23:10:17,699 INFO  [org.can.sub.bil.usa.BillableUsageAggregate] (platform.rhsm-subscriptions.swatch-billable-usage-aggregator-2122ca6f-eca9-4a24-97a5-7604e463c429-StreamThread-1) Adding billableUsage: org.candlepin.subscriptions.billable.usage.BillableUsage@2e2656fd[uuid=<null>,orgId=18405575,tallyId=fd92145f-a838-445a-9804-c71079bb57bd,billingProvider=aws,billingAccountId=746963417480,snapshotDate=2024-09-09T23:10:17.582808576Z,productId=rhel-for-x86-els-payg-addon,sla=Premium,usage=Production,status=<null>,errorCode=<null>,billedOn=<null>,metricId=VCPUS,value=0.0,billingFactor=1.0,vendorProductCode=<null>,hardwareMeasurementType=PHYSICAL,currentTotal=29525.428571428572] to aggregate with aggregateId: 703aeb72-a114-434b-910b-0ed812020dae, totalValue:0.0, remittanceUuids:[] and windowTimestamp: 2024-09-09T23:00Z
      

      Splunk link here.

      Acceptance Criteria

      • Do not send billable usage messages with value equal or lesser than 0

              Unassigned Unassigned
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: