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

Fix flaky test test_verify_multi_cloud_provider_usage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • None
    • None
    • CI/Infrastructure
    • None

      Test:

      application = <iqe.base.application.Application object at 0x7f7f13d9b0b0>
      product_id = 'rhel-for-x86-els-payg-addon'
      
          @pytest.mark.ephemeral_only
          @pytest.mark.ephemeral
          @pytest.mark.parametrize("product_id", config_parser.get_swatch_rhel_payg_products())
          def test_verify_multi_cloud_provider_usage(application, product_id):
              """Verify RHEL usage when using multiple cloud providers
              metadata:
                  assignee: liwalker
                  negative: false
                  importance: critical
                  requirements: payg_tally
                  test_steps:
                      1. Create an AWS subscription
                      2. Create metering events for AWS subscription
                      3. Hourly sync for aws mock event
                      4. Create an Azure subscription
                      5. Create metering events for Azure subscription
                      6. Hourly sync for azure mock event
                      7. Tally
                      8. Verify Billable Usage/Remittance
                  expected_results:
                      1. Usages should be recorded as separate entries
              """
              billing_providers = ["aws", "azure"]
              metric = config_parser.get_swatch_metric_id_from_tag_metrics(product_id=product_id)[0]
              value = random.randint(1, 20)
              hours_value = random.randint(1, 5)
              azureResourceId = "test" + fauxfactory.gen_alpha(3).lower()
              azurePlanId = "test" + fauxfactory.gen_alpha(4).lower()
              azureOfferId = "test" + fauxfactory.gen_alpha(5).lower()
              azureCustomerId = "test" + fauxfactory.gen_alpha(6).lower()
              awsCustomerId = str(uuid.uuid4())
              billing_details = {
                  "aws": "test" + fauxfactory.gen_alpha(3).lower(),
                  "azure": f"{azureResourceId};{azurePlanId};{azureOfferId};{azureCustomerId}",
              }
          
              application.rhsm_subscriptions.reset_account()
          
              # Create AWS and Azure Subscriptions
              for billing_provider in billing_providers:
                  application.rhsm_subscriptions.create_mock_subscription(
                      product_id=product_id,
                      billing_provider=billing_provider,
                      billing_account_id=billing_details[billing_provider],
                      customer_id=awsCustomerId,
                      start_day=(datetime.date.today() - datetime.timedelta(days=10)).strftime("%Y-%m-%d"),
                  )
          
                  data = {
                      metric.lower(): value,
                      "billing_provider": billing_provider,
                      "billing_account_id": billing_details[billing_provider],
                      "hours": hours_value,
                      "event_source": random.choice(["rhelemeter", "cost-management"]),
                  }
                  logging.info(f"Creating payg host with data: {data} ")
          
                  host_instance = application.rhsm_subscriptions.create_metering_event(
                      product_id=product_id, **data
                  )
                  application.rhsm_subscriptions.sync_tally_hourly(
                      product_id=product_id, perform_metering=False, wait=True, wait_for_remittance=False
                  )
          
                  host = application.rhsm_subscriptions.search_system_table(
                      product_id=product_id, display_name_contains=host_instance
                  )
                  assert host, f"{billing_details[billing_provider]} Host not found in system table"
                  assert host["instance_id"] == host_instance
                  assert host["billing_account_id"] == billing_details[f"{billing_provider}"]
                  assert host["billing_provider"] == billing_provider
          
              for billing_provider in billing_providers:
                  remittance = application.rhsm_subscriptions.get_account_remittance(
                      product_id=product_id,
                      metricId=metric,
                      billingProvider=billing_provider,
                      billingAccountId=billing_details[billing_provider],
                  )[0]
                  assert remittance["productId"] == product_id, "Product id is not matching"
                  assert remittance["orgId"] == str(application.user.identity.org_id), "OrgId not matching"
                  assert remittance["billingProvider"] == billing_provider, "Billing provider not matching"
                  assert remittance["billingAccountId"] == billing_details[billing_provider], (
                      "Billing account id not matching"
                  )
                  assert remittance["remittedValue"] == (value * hours_value), "remittance is not correct"
          
                  # Check AWS usage using moto
                  aws_usages = application.rhsm_subscriptions.verify_aws_usage(
                      billing_provider=billing_provider
                  )
                  if aws_usages:
                      for aws_usage in aws_usages:
      >                   assert (value * hours_value) == aws_usage.get("Quantity"), (
                              "Metric Value not a match"
                          )
      E                   AssertionError: Metric Value not a match
      E                   assert (13 * 3) == 26
      E                    +  where 26 = <built-in method get of dict object at 0x7f7eec26ad00>('Quantity')
      E                    +    where <built-in method get of dict object at 0x7f7eec26ad00> = {'CustomerIdentifier': 'bb72b5fe-74f9-4b02-97cf-bdcc3105d178', 'Dimension': 'vcpu_hourly', 'Quantity': 26, 'Timestamp': 1744704000.0}.get
      
      /iqe_venv/lib/python3.12/site-packages/iqe_rhsm_subscriptions/tests/integration/swatch_tally/test_tally_rhel_payg.py:421: AssertionError
      

      Output:

      --------------------------------- Captured Log ---------------------------------
      2025-04-15 08:25:49 INFO Using random seed value for random generation: 9883
      2025-04-15 08:25:49 INFO Flushing usage messages off from billable usage kafka topic
      2025-04-15 08:25:49 INFO PUT request response url: http://swatch-billable-usage-service:8000/api/swatch-billable-usage/internal/rpc/topics/flush, status_code: 200
      2025-04-15 08:25:49 INFO Trace log using : 00-00000000000000000000000000000000-0000000000000000-00  
      2025-04-15 08:25:51 INFO DELETE request response url: http://swatch-tally-service:8000/api/rhsm-subscriptions/v1/internal/rpc/tally/18939574, status_code: 200
      2025-04-15 08:25:51 INFO Trace log using : 00-83cbcc0a2d3cc311be4f261bc2591931-3f0d3853bedd728d-00  
      2025-04-15 08:25:51 INFO Reset moto b'{"status": "ok"}'
      2025-04-15 08:25:51 INFO SKUs for rhel-for-x86-els-payg-addon : ['RH02985HR']
      2025-04-15 08:25:51 INFO PUT request response url: http://swatch-contracts-service:8000/api/swatch-contracts/internal/rpc/offerings/sync/RH02985HR, status_code: 200
      2025-04-15 08:25:51 INFO Trace log using : 00-fdccf8e73e701230bb750b0e1ac63898-a5aa15b868af03cd-01  
      2025-04-15 08:25:51 INFO Offering RH02985HR synced.
      2025-04-15 08:25:51 INFO POST request response url: http://swatch-contracts-service:8000/api/swatch-contracts/internal/subscriptions?reconcileCapacity=true, status_code: 200
      2025-04-15 08:25:51 INFO Trace log using : 00-7e565a244ad2fce7b1a24fa4ad943ba6-62d01c78be62b63b-01  
      2025-04-15 08:25:51 INFO Creating payg host with data: {'vcpus': 13, 'billing_provider': 'aws', 'billing_account_id': 'testdwk', 'hours': 3, 'event_source': 'cost-management'} 
      2025-04-15 08:25:51 INFO Producing metering events for rhel-for-x86-els-payg-addon: [
          {
              "event_source": "cost-management",
              "event_type": "vCPUs",
              "org_id": "18939574",
              "instance_id": "automation-rhel-for-x86-els-payg-addon-heu",
              "timestamp": "2025-04-15T05:00:00Z",
              "expiration": "2025-04-15T06:00:00Z",
              "display_name": "automation__cluster_automation-rhel-for-x86-els-payg-addon-heu",
              "measurements": [
                  {
                      "value": 13,
                      "metric_id": "vCPUs"
                  }
              ],
              "sla": "Premium",
              "service_type": "RHEL System",
              "product_ids": [
                  "204"
              ],
              "usage": "Production",
              "cloud_provider": "AWS",
              "hardware_type": "Cloud",
              "billing_provider": "aws",
              "billing_account_id": "testdwk"
          },
          {
              "event_source": "cost-management",
              "event_type": "vCPUs",
              "org_id": "18939574",
              "instance_id": "automation-rhel-for-x86-els-payg-addon-heu",
              "timestamp": "2025-04-15T06:00:00Z",
              "expiration": "2025-04-15T07:00:00Z",
              "display_name": "automation__cluster_automation-rhel-for-x86-els-payg-addon-heu",
              "measurements": [
                  {
                      "value": 13,
                      "metric_id": "vCPUs"
                  }
              ],
              "sla": "Premium",
              "service_type": "RHEL System",
              "product_ids": [
                  "204"
              ],
              "usage": "Production",
              "cloud_provider": "AWS",
              "hardware_type": "Cloud",
              "billing_provider": "aws",
              "billing_account_id": "testdwk"
          },
          {
              "event_source": "cost-management",
              "event_type": "vCPUs",
              "org_id": "18939574",
              "instance_id": "automation-rhel-for-x86-els-payg-addon-heu",
              "timestamp": "2025-04-15T07:00:00Z",
              "expiration": "2025-04-15T08:00:00Z",
              "display_name": "automation__cluster_automation-rhel-for-x86-els-payg-addon-heu",
              "measurements": [
                  {
                      "value": 13,
                      "metric_id": "vCPUs"
                  }
              ],
              "sla": "Premium",
              "service_type": "RHEL System",
              "product_ids": [
                  "204"
              ],
              "usage": "Production",
              "cloud_provider": "AWS",
              "hardware_type": "Cloud",
              "billing_provider": "aws",
              "billing_account_id": "testdwk"
          }
      ]
      2025-04-15 08:25:51 INFO Sending the following kafka message to platform.rhsm-subscriptions.service-instance-ingress:
       {'event_source': 'cost-management', 'event_type': 'vCPUs', 'org_id': '18939574', 'instance_id': 'automation-rhel-for-x86-els-payg-addon-heu', 'timestamp': '2025-04-15T05:00:00Z', 'expiration': '2025-04-15T06:00:00Z', 'display_name': 'automation__cluster_automation-rhel-for-x86-els-payg-addon-heu', 'measurements': [{'value': 13, 'metric_id': 'vCPUs'}], 'sla': 'Premium', 'service_type': 'RHEL System', 'product_ids': ['204'], 'usage': 'Production', 'cloud_provider': 'AWS', 'hardware_type': 'Cloud', 'billing_provider': 'aws', 'billing_account_id': 'testdwk'}
      2025-04-15 08:25:51 INFO POST request response url: http://kafka-bridge-bridge-service:8080/topics/platform.rhsm-subscriptions.service-instance-ingress, status_code: 200
      2025-04-15 08:25:51 INFO Trace log using : None
      2025-04-15 08:25:51 INFO Sending the following kafka message to platform.rhsm-subscriptions.service-instance-ingress:
       {'event_source': 'cost-management', 'event_type': 'vCPUs', 'org_id': '18939574', 'instance_id': 'automation-rhel-for-x86-els-payg-addon-heu', 'timestamp': '2025-04-15T06:00:00Z', 'expiration': '2025-04-15T07:00:00Z', 'display_name': 'automation__cluster_automation-rhel-for-x86-els-payg-addon-heu', 'measurements': [{'value': 13, 'metric_id': 'vCPUs'}], 'sla': 'Premium', 'service_type': 'RHEL System', 'product_ids': ['204'], 'usage': 'Production', 'cloud_provider': 'AWS', 'hardware_type': 'Cloud', 'billing_provider': 'aws', 'billing_account_id': 'testdwk'}
      2025-04-15 08:25:52 INFO POST request response url: http://kafka-bridge-bridge-service:8080/topics/platform.rhsm-subscriptions.service-instance-ingress, status_code: 200
      2025-04-15 08:25:52 INFO Trace log using : None
      2025-04-15 08:25:52 INFO Sending the following kafka message to platform.rhsm-subscriptions.service-instance-ingress:
       {'event_source': 'cost-management', 'event_type': 'vCPUs', 'org_id': '18939574', 'instance_id': 'automation-rhel-for-x86-els-payg-addon-heu', 'timestamp': '2025-04-15T07:00:00Z', 'expiration': '2025-04-15T08:00:00Z', 'display_name': 'automation__cluster_automation-rhel-for-x86-els-payg-addon-heu', 'measurements': [{'value': 13, 'metric_id': 'vCPUs'}], 'sla': 'Premium', 'service_type': 'RHEL System', 'product_ids': ['204'], 'usage': 'Production', 'cloud_provider': 'AWS', 'hardware_type': 'Cloud', 'billing_provider': 'aws', 'billing_account_id': 'testdwk'}
      2025-04-15 08:25:53 INFO POST request response url: http://kafka-bridge-bridge-service:8080/topics/platform.rhsm-subscriptions.service-instance-ingress, status_code: 200
      2025-04-15 08:25:53 INFO Trace log using : None
      2025-04-15 08:25:53 INFO REST: GET http://swatch-api-nginx-proxy.ephemeral-q0xfmd.svc:8000/api/rhsm-subscriptions/v1/tally/products/rhel-for-x86-els-payg-addon/vCPUs with query params [('billing_account_id', '_ANY'), ('billing_provider', '_ANY'), ('granularity', 'Hourly'), ('beginning', '2025-04-15T05:00:00+00:00'), ('ending', '2025-04-15T12:00:00+00:00')] and x-rh-insights-request-id=None
      2025-04-15 08:25:53 INFO POST request response url: http://swatch-tally-service:8000/api/rhsm-subscriptions/v1/internal/tally/hourly?org=18939574&start=2025-04-15T05%3A00%3A00Z&end=2025-04-15T12%3A00%3A00Z, status_code: 204
      2025-04-15 08:25:53 INFO Trace log using : 00-d196fa2620f6648e85d59d9d582a6eb8-654ddf2719d71215-00  
      2025-04-15 08:25:53 INFO Not valid JSON output. Returning plain text message.
      2025-04-15 08:25:53 INFO Tally synced from 2025-04-15T05:00:00Z to 2025-04-15T12:00:00Z.
      2025-04-15 08:25:53 INFO REST: GET http://swatch-api-nginx-proxy.ephemeral-q0xfmd.svc:8000/api/rhsm-subscriptions/v1/tally/products/rhel-for-x86-els-payg-addon/vCPUs with query params [('billing_account_id', '_ANY'), ('billing_provider', '_ANY'), ('granularity', 'Hourly'), ('beginning', '2025-04-15T05:00:00+00:00'), ('ending', '2025-04-15T12:00:00+00:00')] and x-rh-insights-request-id=None
      2025-04-15 08:25:53 INFO Waiting for hourly tally sync completion...
      2025-04-15 08:26:08 INFO REST: GET http://swatch-api-nginx-proxy.ephemeral-q0xfmd.svc:8000/api/rhsm-subscriptions/v1/tally/products/rhel-for-x86-els-payg-addon/vCPUs with query params [('billing_account_id', '_ANY'), ('billing_provider', '_ANY'), ('granularity', 'Hourly'), ('beginning', '2025-04-15T05:00:00+00:00'), ('ending', '2025-04-15T12:00:00+00:00')] and x-rh-insights-request-id=None
      2025-04-15 08:26:08 INFO Tally updated with increased value......
      2025-04-15 08:26:08 INFO REST: GET http://swatch-api-nginx-proxy.ephemeral-q0xfmd.svc:8000/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-payg-addon with query params [('limit', 100), ('offset', 0), ('display_name_contains', 'automation-rhel-for-x86-els-payg-addon-heu')] and x-rh-insights-request-id=None
      2025-04-15 08:26:08 INFO [{'id': '43455f88-0f1c-40b9-ac37-6522f87bfdc0', 'instance_id': 'automation-rhel-for-x86-els-payg-addon-heu', 'display_name': 'automation__cluster_automation-rhel-for-x86-els-payg-addon-heu', 'billing_provider': 'aws', 'billing_account_id': 'testdwk', 'measurements': [39.0], 'last_seen': datetime.datetime(2025, 4, 15, 7, 0, tzinfo=tzlocal()), 'last_applied_event_record_date': datetime.datetime(2025, 4, 15, 8, 25, 53, 916867, tzinfo=tzlocal()), 'number_of_guests': 0, 'category': 'cloud', 'cloud_provider': 'aws', '_labeled_measurements': {'vCPUs': 39.0}}]
      2025-04-15 08:26:08 INFO SKUs for rhel-for-x86-els-payg-addon : ['RH02985HR']
      2025-04-15 08:26:09 INFO PUT request response url: http://swatch-contracts-service:8000/api/swatch-contracts/internal/rpc/offerings/sync/RH02985HR, status_code: 200
      2025-04-15 08:26:09 INFO Trace log using : 00-8a54131e258aff30fbc3e1af75fab8fa-e1d5c62166a02521-01  
      2025-04-15 08:26:09 INFO Offering RH02985HR synced.
      2025-04-15 08:26:09 INFO POST request response url: http://swatch-contracts-service:8000/api/swatch-contracts/internal/subscriptions?reconcileCapacity=true, status_code: 200
      2025-04-15 08:26:09 INFO Trace log using : 00-0a69acd7b47fa9a1fa707d000bf329c9-5f9ef990c00afd90-01  
      2025-04-15 08:26:09 INFO Creating payg host with data: {'vcpus': 13, 'billing_provider': 'azure', 'billing_account_id': 'testnop;testmrlz;testszxsl;testcznyfq', 'hours': 3, 'event_source': 'cost-management'} 
      2025-04-15 08:26:09 INFO Producing metering events for rhel-for-x86-els-payg-addon: [
          {
              "event_source": "cost-management",
              "event_type": "vCPUs",
              "org_id": "18939574",
              "instance_id": "automation-rhel-for-x86-els-payg-addon-wxx",
              "timestamp": "2025-04-15T05:00:00Z",
              "expiration": "2025-04-15T06:00:00Z",
              "display_name": "automation__cluster_automation-rhel-for-x86-els-payg-addon-wxx",
              "measurements": [
                  {
                      "value": 13,
                      "metric_id": "vCPUs"
                  }
              ],
              "sla": "Premium",
              "service_type": "RHEL System",
              "product_ids": [
                  "204"
              ],
              "usage": "Production",
              "cloud_provider": "Azure",
              "hardware_type": "Cloud",
              "billing_provider": "azure",
              "billing_account_id": "testnop;testmrlz;testszxsl;testcznyfq"
          },
          {
              "event_source": "cost-management",
              "event_type": "vCPUs",
              "org_id": "18939574",
              "instance_id": "automation-rhel-for-x86-els-payg-addon-wxx",
              "timestamp": "2025-04-15T06:00:00Z",
              "expiration": "2025-04-15T07:00:00Z",
              "display_name": "automation__cluster_automation-rhel-for-x86-els-payg-addon-wxx",
              "measurements": [
                  {
                      "value": 13,
                      "metric_id": "vCPUs"
                  }
              ],
              "sla": "Premium",
              "service_type": "RHEL System",
              "product_ids": [
                  "204"
              ],
              "usage": "Production",
              "cloud_provider": "Azure",
              "hardware_type": "Cloud",
              "billing_provider": "azure",
              "billing_account_id": "testnop;testmrlz;testszxsl;testcznyfq"
          },
          {
              "event_source": "cost-management",
              "event_type": "vCPUs",
              "org_id": "18939574",
              "instance_id": "automation-rhel-for-x86-els-payg-addon-wxx",
              "timestamp": "2025-04-15T07:00:00Z",
              "expiration": "2025-04-15T08:00:00Z",
              "display_name": "automation__cluster_automation-rhel-for-x86-els-payg-addon-wxx",
              "measurements": [
                  {
                      "value": 13,
                      "metric_id": "vCPUs"
                  }
              ],
              "sla": "Premium",
              "service_type": "RHEL System",
              "product_ids": [
                  "204"
              ],
              "usage": "Production",
              "cloud_provider": "Azure",
              "hardware_type": "Cloud",
              "billing_provider": "azure",
              "billing_account_id": "testnop;testmrlz;testszxsl;testcznyfq"
          }
      ]
      2025-04-15 08:26:09 INFO Sending the following kafka message to platform.rhsm-subscriptions.service-instance-ingress:
       {'event_source': 'cost-management', 'event_type': 'vCPUs', 'org_id': '18939574', 'instance_id': 'automation-rhel-for-x86-els-payg-addon-wxx', 'timestamp': '2025-04-15T05:00:00Z', 'expiration': '2025-04-15T06:00:00Z', 'display_name': 'automation__cluster_automation-rhel-for-x86-els-payg-addon-wxx', 'measurements': [{'value': 13, 'metric_id': 'vCPUs'}], 'sla': 'Premium', 'service_type': 'RHEL System', 'product_ids': ['204'], 'usage': 'Production', 'cloud_provider': 'Azure', 'hardware_type': 'Cloud', 'billing_provider': 'azure', 'billing_account_id': 'testnop;testmrlz;testszxsl;testcznyfq'}
      2025-04-15 08:26:10 INFO POST request response url: http://kafka-bridge-bridge-service:8080/topics/platform.rhsm-subscriptions.service-instance-ingress, status_code: 200
      2025-04-15 08:26:10 INFO Trace log using : None
      2025-04-15 08:26:10 INFO Sending the following kafka message to platform.rhsm-subscriptions.service-instance-ingress:
       {'event_source': 'cost-management', 'event_type': 'vCPUs', 'org_id': '18939574', 'instance_id': 'automation-rhel-for-x86-els-payg-addon-wxx', 'timestamp': '2025-04-15T06:00:00Z', 'expiration': '2025-04-15T07:00:00Z', 'display_name': 'automation__cluster_automation-rhel-for-x86-els-payg-addon-wxx', 'measurements': [{'value': 13, 'metric_id': 'vCPUs'}], 'sla': 'Premium', 'service_type': 'RHEL System', 'product_ids': ['204'], 'usage': 'Production', 'cloud_provider': 'Azure', 'hardware_type': 'Cloud', 'billing_provider': 'azure', 'billing_account_id': 'testnop;testmrlz;testszxsl;testcznyfq'}
      2025-04-15 08:26:10 INFO POST request response url: http://kafka-bridge-bridge-service:8080/topics/platform.rhsm-subscriptions.service-instance-ingress, status_code: 200
      2025-04-15 08:26:10 INFO Trace log using : None
      2025-04-15 08:26:10 INFO Sending the following kafka message to platform.rhsm-subscriptions.service-instance-ingress:
       {'event_source': 'cost-management', 'event_type': 'vCPUs', 'org_id': '18939574', 'instance_id': 'automation-rhel-for-x86-els-payg-addon-wxx', 'timestamp': '2025-04-15T07:00:00Z', 'expiration': '2025-04-15T08:00:00Z', 'display_name': 'automation__cluster_automation-rhel-for-x86-els-payg-addon-wxx', 'measurements': [{'value': 13, 'metric_id': 'vCPUs'}], 'sla': 'Premium', 'service_type': 'RHEL System', 'product_ids': ['204'], 'usage': 'Production', 'cloud_provider': 'Azure', 'hardware_type': 'Cloud', 'billing_provider': 'azure', 'billing_account_id': 'testnop;testmrlz;testszxsl;testcznyfq'}
      2025-04-15 08:26:14 INFO POST request response url: http://kafka-bridge-bridge-service:8080/topics/platform.rhsm-subscriptions.service-instance-ingress, status_code: 200
      2025-04-15 08:26:14 INFO Trace log using : None
      2025-04-15 08:26:14 INFO REST: GET http://swatch-api-nginx-proxy.ephemeral-q0xfmd.svc:8000/api/rhsm-subscriptions/v1/tally/products/rhel-for-x86-els-payg-addon/vCPUs with query params [('billing_account_id', '_ANY'), ('billing_provider', '_ANY'), ('granularity', 'Hourly'), ('beginning', '2025-04-15T05:00:00+00:00'), ('ending', '2025-04-15T12:00:00+00:00')] and x-rh-insights-request-id=None
      2025-04-15 08:26:14 INFO POST request response url: http://swatch-tally-service:8000/api/rhsm-subscriptions/v1/internal/tally/hourly?org=18939574&start=2025-04-15T05%3A00%3A00Z&end=2025-04-15T12%3A00%3A00Z, status_code: 204
      2025-04-15 08:26:14 INFO Trace log using : 00-01fb28b31998d68da31fdea54d25e38b-44bf84d2fb2c2b85-00  
      2025-04-15 08:26:14 INFO Not valid JSON output. Returning plain text message.
      2025-04-15 08:26:14 INFO Tally synced from 2025-04-15T05:00:00Z to 2025-04-15T12:00:00Z.
      2025-04-15 08:26:14 INFO REST: GET http://swatch-api-nginx-proxy.ephemeral-q0xfmd.svc:8000/api/rhsm-subscriptions/v1/tally/products/rhel-for-x86-els-payg-addon/vCPUs with query params [('billing_account_id', '_ANY'), ('billing_provider', '_ANY'), ('granularity', 'Hourly'), ('beginning', '2025-04-15T05:00:00+00:00'), ('ending', '2025-04-15T12:00:00+00:00')] and x-rh-insights-request-id=None
      2025-04-15 08:26:14 INFO Waiting for hourly tally sync completion...
      2025-04-15 08:26:29 INFO REST: GET http://swatch-api-nginx-proxy.ephemeral-q0xfmd.svc:8000/api/rhsm-subscriptions/v1/tally/products/rhel-for-x86-els-payg-addon/vCPUs with query params [('billing_account_id', '_ANY'), ('billing_provider', '_ANY'), ('granularity', 'Hourly'), ('beginning', '2025-04-15T05:00:00+00:00'), ('ending', '2025-04-15T12:00:00+00:00')] and x-rh-insights-request-id=None
      2025-04-15 08:26:29 INFO Tally updated with increased value......
      2025-04-15 08:26:29 INFO REST: GET http://swatch-api-nginx-proxy.ephemeral-q0xfmd.svc:8000/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-payg-addon with query params [('limit', 100), ('offset', 0), ('display_name_contains', 'automation-rhel-for-x86-els-payg-addon-wxx')] and x-rh-insights-request-id=None
      2025-04-15 08:26:29 INFO [{'id': '7ec91e2d-e70d-4609-814e-4ef5ffd2a632', 'instance_id': 'automation-rhel-for-x86-els-payg-addon-wxx', 'display_name': 'automation__cluster_automation-rhel-for-x86-els-payg-addon-wxx', 'billing_provider': 'azure', 'billing_account_id': 'testnop;testmrlz;testszxsl;testcznyfq', 'measurements': [39.0], 'last_seen': datetime.datetime(2025, 4, 15, 7, 0, tzinfo=tzlocal()), 'last_applied_event_record_date': datetime.datetime(2025, 4, 15, 8, 26, 14, 348196, tzinfo=tzlocal()), 'number_of_guests': 0, 'category': 'cloud', 'cloud_provider': 'azure', '_labeled_measurements': {'vCPUs': 39.0}}]
      2025-04-15 08:26:29 INFO GET request response url: http://swatch-billable-usage-service:8000/api/swatch-billable-usage/internal/remittance/accountRemittances?productId=rhel-for-x86-els-payg-addon&orgId=18939574&metricId=vCPUs&billingProvider=aws&billingAccountId=testdwk, status_code: 200
      2025-04-15 08:26:29 INFO Trace log using : 00-00000000000000000000000000000000-0000000000000000-00  
      2025-04-15 08:26:29 INFO The action 'wait for aws usages' succeeded with: [{'Timestamp': 1744704000.0, 'CustomerIdentifier': 'bb72b5fe-74f9-4b02-97cf-bdcc3105d178', 'Dimension': 'vcpu_hourly', 'Quantity': 26}, {'Timestamp': 1744704000.0, 'CustomerIdentifier': 'bb72b5fe-74f9-4b02-97cf-bdcc3105d178', 'Dimension': 'vcpu_hourly', 'Quantity': 13}]
      2025-04-15 08:26:29 INFO Reset moto b'{"status": "ok"}'
      2025-04-15 08:26:29 INFO Aws usage from moto: [{'Timestamp': 1744704000.0, 'CustomerIdentifier': 'bb72b5fe-74f9-4b02-97cf-bdcc3105d178', 'Dimension': 'vcpu_hourly', 'Quantity': 26}, {'Timestamp': 1744704000.0, 'CustomerIdentifier': 'bb72b5fe-74f9-4b02-97cf-bdcc3105d178', 'Dimension': 'vcpu_hourly', 'Quantity': 13}]
      --------------------------------- Captured Out ---------------------------------
      

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

                Created:
                Updated:
                Resolved: