SWATCH-2297: Rename metric for ingested usage data from Prometheus #3961
+8
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira issue: SWATCH-2297
Relates to #3888
Description
These changes include:
This is to follow the same convention as written in the document attached in the JIRA ticket epic.
Testing
Setup
RHSM_SUBSCRIPTIONS_ENABLE_SYNCHRONOUS_OPERATIONS=true DEV_MODE=true PROM_URL=http://localhost:8082/api/metrics/v1/telemeter/api/v1 SWATCH_CONTRACTS_INTERNAL_SERVICE=http://localhost:8003 SERVER_PORT=8000 SPRING_PROFILES_ACTIVE=worker,kafka-queue,api,capacity-ingress,kafka-queue,rhsm-conduit ./gradlew :bootRun
Steps
{ "sla": "Premium", "org_id": "111111111", "timestamp": "2024-10-24T15:00:00.0000+04:00", "conversion": false, "event_type": "snapshot_rhel-for-x86-els-payg-addon_vCPUs", "expiration": "2025-06-10T11:00:00.0000+04:00", "instance_id": "d147ddf2-be4a-4a59-acf7-7f222758b47d", "product_tag": [ "rhel-for-x86-els-payg-addon" ], "display_name": "automation__cluster_d147ddf2-be4a-4a59-acf7-7f222758b47c", "event_source": "prometheus", "billing_provider": "aws", "measurements": [ { "value": 4.0, "metric_id": "vCPUs" } ], "service_type": "RHEL System" }
http ':9000/metrics' | grep 'swatch_metrics'
Verification
swatch_metrics_ingested_usage_total{billing_provider="aws",metric_id="vCPUs",product="rhel-for-x86-els-payg-addon"} 8.0