diff --git a/modules/ROOT/pages/_partials/include-permissions-osv2.adoc b/modules/ROOT/pages/_partials/include-permissions-osv2.adoc index 29df47d..1884326 100644 --- a/modules/ROOT/pages/_partials/include-permissions-osv2.adoc +++ b/modules/ROOT/pages/_partials/include-permissions-osv2.adoc @@ -25,8 +25,5 @@ |View all clients of a cloud store. |This permission doesn't apply to Object Store v2. -|Store Metrics Viewer -|Retrieve Object Store v2 metrics using the Object Store v2 Stats API. -| |=== // end::osv2PermissionsTable[] \ No newline at end of file diff --git a/modules/ROOT/pages/_partials/osv2-on-hyperforce.adoc b/modules/ROOT/pages/_partials/osv2-on-hyperforce.adoc index 50b6095..459eb2d 100644 --- a/modules/ROOT/pages/_partials/osv2-on-hyperforce.adoc +++ b/modules/ROOT/pages/_partials/osv2-on-hyperforce.adoc @@ -1,5 +1,5 @@ // tag::osv2SupportOnHyperforce[] -You can't access or configure some Object Store v2 features, such as the Object Store v2 Stats API. +You can't access or configure some Object Store v2 features. For information, see xref:object-store::index.adoc#osv2-on-hyperforce[Object Store v2 on Hyperforce]. // end::osv2SupportOnHyperforce[] @@ -9,10 +9,6 @@ For information, see xref:object-store::index.adoc#osv2-on-hyperforce[Object Sto // end::osv2FeaturesNoHF[] -// tag::apiStatsAPInotHF[] -Only the US Cloud and EU Cloud instances of Anypoint Platform support these REST APIs. -// end::apiStatsAPInotHF[] - // Note for features unsupported on HF // tag::osv2FeaturesNoHFnote[] Only the US Cloud and EU Cloud instances of Anypoint Platform support this feature. diff --git a/modules/ROOT/pages/index.adoc b/modules/ROOT/pages/index.adoc index 25928c3..9e8bd5e 100644 --- a/modules/ROOT/pages/index.adoc +++ b/modules/ROOT/pages/index.adoc @@ -151,10 +151,7 @@ To avoid these issues, use a distributed key-value store as a lock to synchroniz |{empty} -* xref:osv2-usage.adoc#access-usage-charts[Usage Charts] (Access Management) * xref:cloudhub::deploying-to-cloudhub.adoc[CloudHub 1.0 Deployments] -* xref:osv2-apis.adoc#osv2-stats-api[Object Store v2 Stats API] - | Yes | No @@ -183,12 +180,6 @@ All Object Store v2 features are supported on https://ca1.platform.mulesoft.com[ | *xref:cloudhub::deploying-to-cloudhub.adoc[CloudHub 1.0 Deployments]* | Not supported. Deploy apps to xref:cloudhub-2::ch2-shared-space-about.adoc[CloudHub 2.0 shared spaces] or xref:runtime-fabric::index.adoc[Anypoint Runtime Fabric]. -| *xref:osv2-usage.adoc#access-usage-charts[Usage Charts] (Access Management)* -| Not available. Use xref:osv2-usage.adoc#access-os-usage-reports[Usage Reports] instead. - -| *xref:osv2-apis.adoc#osv2-stats-api[Object Store v2 Stats API]* -| Not supported. - |=== For information about the regions where Object Store v2 is available, see xref:osv2-faq.adoc#osv2-regions[Object Store v2 Regions]. @@ -201,5 +192,4 @@ For information about Anypoint Platform on other control planes, see xref:hyperf * xref:access-management::permissions-by-product.adoc[] * xref:release-notes::object-store/anypoint-osv2-release-notes.adoc[Object Store v2 Release Notes] * xref:connectors::object-store/object-store-connector.adoc[Object Store Connector for Mule 4] -* https://dev-portal.mulesoft.com/apis/object-store-v2-stats.html[Object Store V2 Stats API] * https://blogs.mulesoft.com/dev-guides/how-to-tutorials/data-synchronizing-made-easy-with-mule-watermarks/[Object Store Watermarks] diff --git a/modules/ROOT/pages/osv2-apis.adoc b/modules/ROOT/pages/osv2-apis.adoc index 2d7ca61..9eabea1 100644 --- a/modules/ROOT/pages/osv2-apis.adoc +++ b/modules/ROOT/pages/osv2-apis.adoc @@ -7,12 +7,10 @@ The Object Store v2 APIs enable you to use REST to: * Retrieve a list of object stores and keys associated with an application. * Store and retrieve key-value pairs in an object store. * Delete key-value pairs from an object store. -* Retrieve Object Store usage statistics for your organization. Object Store provides these APIs: * <> -* <> [[before-you-begin]] @@ -28,10 +26,10 @@ You need the bearer token to access all Object Store v2 APIs. You need the organization ID and environment ID for operations with all Object Store v2 APIs. * <>. + -You need the region ID for operations with the Object Store v2 Stats API. +You need the region ID for operations with the Object Store v2 API. * <>. + -You need the store ID for operations with the Object Store v2 Stats API. +You need the store ID for operations with the Object Store v2 API. [[get-bearer-token]] @@ -547,274 +545,6 @@ This command returns output similar to: ---- -[[osv2-stats-api]] -== Object Store v2 Stats API - -[NOTE] -// Not on HF -include::partial$osv2-on-hyperforce.adoc[tag=apiStatsAPInotHF] - -The Object Store v2 Stats API enables you to retrieve statistics on your Object Store usage. - -The usage statistics aren't real-time and might include latency. - -Use the Stats API to view your entire organization's usage of Object Store for billing purposes: - -* Usage per root organization and all sub-organizations -* Usage per organization -* Usage per environment -* Usage per region -* Usage per store - - -[[osv2-usage-limits]] -=== Usage Metrics Limits - -[%header,cols="10,15,15a"] -|=== -| Parameter | Description | Values -| Time series (`period`) | Interval that the query records | - -* `1hour` -* `1day` -* `1month` - -|Data retention | Length of time that Object Store retains the data, based on `period`| - -* `period=1hour`: 3 months -* `period=1day`: 12 months -* `period=1month`: 24 months - -| Query timeframe | Maximum interval between `startDate` and `endDate` in the query, based on `period` | - -* `period=1hour`: 1 day -* `period=1day`: 1 month -* `period=1month`: 2 months - -NOTE: If the interval between `startDate` and `endDate` exceeds the limits, the API returns an HTTP 400 error. -|=== - - -[[access-osv2-stats-api]] -=== Access the Object Store v2 Stats API - -. <>. -. Set up an application, such as Postman, to access the object store. -. Configure the access URL, replacing ORG_ID with your organization ID and -ENV_ID with your environment ID: -+ -[source,bash,linenums] ----- -https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations//environments/ENV_ID?startDate=...&endDate=...&period=... ----- -+ -[IMPORTANT] -include::partial$osv2-faq.adoc[tag=urlEncoded] -. Configure the application with HTTP headers and body for values to store to or read from -the object store. -. Send the operation to the Object Store v2 Stats API. - -See also https://help.salesforce.com/s/articleView?id=002778591&type=1[How to use Object Store v2 Stats API]. - - -[[example-osv2-stats-api]] -=== Examples: Object Store v2 Stats API - -* <> -* <> -* <> -* <> - - -[[usage-by-org]] -==== Example: Get Usage Metrics by Organization - -By default, the Object Store v2 Stats API endpoint retrieves statistics only for the specified ORG_ID. -To get the usage data for the root organization and all sub-organizations, set `isMaster` to `true` when ORG_ID is the root organization. -If you use `isMaster=true` to query a sub-organization, the endpoint returns no results. - -To view Object Store usage statistics for the root organization and all sub-organizations, -between August 11, 2024 and September 11, 2024, -submit a `curl` command, -replacing -ORG_ID with the organization ID for your root organization and -BEARER_TOKEN with your bearer token: - - -[source,bash,linenums] ----- -curl -X GET \ - 'https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations/?startDate=2024-08-11T17%3A51%3A54.000Z&endDate=2024-09-11T17%3A51%3A54.000Z&period=1month&isMaster=true' \ - -H 'authorization: Bearer ' ----- - -This request returns a response similar to: - -[source,json,linenums] ----- -[ - {"timeStamp":"2024-08-01T00:00:00Z","objectStoreRequestCount":38}, - {"timeStamp":"2024-09-01T00:00:00Z","objectStoreRequestCount":28} -] ----- - -To view Object Store usage statistics for the root organization and all sub-organizations for one day, submit a `curl` command, -replacing -ORG_ID with the organization ID for your root organization and -BEARER_TOKEN with your bearer token: - -[source,bash,linenums] ----- -curl -X GET \ - 'https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations/?startDate=2024-11-11T17%3A51%3A54.000Z&endDate=2024-11-131T17%3A51%3A54.000Z&period=1day&isMaster=true' \ - -H 'authorization: Bearer ' ----- - -This request returns a response similar to: - -[source,json,linenums] ----- -[ - {"timeStamp":"2024-11-11T00:00:00Z","objectStoreRequestCount":36} - {"timeStamp":"2024-11-12T00:00:00Z","objectStoreRequestCount":22} - {"timeStamp":"2024-11-13T00:00:00Z","objectStoreRequestCount":43} -] ----- - -To view Object Store usage statistics for a sub-organization, -between February 10, 2024 and March 10, 2024, -submit a `curl` command, -replacing -ORG_ID with the organization ID for the sub-organization and -BEARER_TOKEN with your bearer token: - - -[source,bash,linenums] ----- -curl -X GET \ - 'https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations/?startDate=2024-02-10T17%3A51%3A54.000Z&endDate=2024-03-10T17%3A51%3A54.000Z&period=1month' \ - -H 'authorization: Bearer ' ----- - -This request returns a response similar to: - -[source,json,linenums] ----- -[ - {"timeStamp":"2024-02-10T00:00:00Z","objectStoreRequestCount":1}, - {"timeStamp":"2024-03-10T00:00:00Z","objectStoreRequestCount":15}, -] ----- - -To view Object Store usage statistics for one day for a sub-organization, -submit a `curl` command, replacing -ORG_ID with the organization ID for the sub-organization and -BEARER_TOKEN with your bearer token: - -[source,bash,linenums] ----- -curl -X GET \ - 'https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations/?startDate=2024-12-01T17%3A51%3A54.000Z&endDate=2024-12-03T17%3A51%3A54.000Z&period=1day' \ - -H 'authorization: Bearer ' ----- - -This request returns a response similar to: - -[source,json,linenums] ----- -[ - {"timeStamp":"2024-12-01T00:00:00Z","objectStoreRequestCount":4} - {"timeStamp":"2024-12-02T00:00:00Z","objectStoreRequestCount":2} - {"timeStamp":"2024-12-03T00:00:00Z","objectStoreRequestCount":8} - -] ----- - -[[usage-by-env]] -==== Example: Get Usage Metrics by Environment - -To view Object Store usage statistics for an environment between August 13, 2024 and September 13, 2024, -submit a `curl` command, replacing -ORG_ID with your organization ID, -ENV_ID with your environment ID, -and BEARER_TOKEN with your bearer token: - - -[source,bash,linenums] ----- -curl -X GET \ - 'https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations//environments/?startDate=2024-08-13T17%3A51%3A54.000Z&endDate=2024-09-13T17%3A51%3A54.000Z&period=1month' \ - -H 'authorization: Bearer ' ----- - -This request returns a response similar to: - -[source,json,linenums] ----- -[ - {"timeStamp":"2024-08-01T00:00:00Z","objectStoreRequestCount":1}, - {"timeStamp":"2024-09-01T00:00:00Z","objectStoreRequestCount":25} -] ----- - -[[usage-by-region]] -==== Example: Get Usage Metrics by Region - -To view Object Store usage statistics for a region, -submit a `curl` command, replacing -ORG_ID with your organization ID, -ENV_ID with your environment ID, -REGION_ID with the region from which to retrieve metrics, and -BEARER_TOKEN with your bearer token: - -[source,bash,linenums] ----- - curl -X GET \ - 'https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations//environments//regions/?startDate=2024-08-13T17%3A51%3A54.000Z&endDate=2024-09-13T17%3A51%3A54.000Z&period=1month' \ - -H 'authorization: Bearer ' ----- - -To retrieve the REGION_ID, see <>. - -This request returns a response similar to: - -[source,json,linenums] ----- -[ - {"timeStamp":"2024-08-01T00:00:00Z","objectStoreRequestCount":1}, - {"timeStamp":"2024-09-01T00:00:00Z","objectStoreRequestCount":25} -] ----- - -[[usage-by-store]] -==== Example: Get Usage Metrics by Store - -To view Object Store usage statistics for a store, -submit a `curl` command, replacing -ORG_ID with your organization ID, -ENV_ID with your environment ID, -REGION_ID with the region to retrieve metrics from, -STORE_ID with the store ID to retrieve metrics for, -and BEARER_TOKEN with your bearer token: - -[source,bash,linenums] ----- - curl -X GET \ - 'https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations//environments//regions//stores/?startDate=2024-08-13T17%3A51%3A54.000Z&endDate=2024-09-13T17%3A51%3A54.000Z&period=1month' \ - -H 'authorization: Bearer ' ----- - -To retrieve the STORE_ID, see <>. - -This request returns a response similar to: - -[source,json,linenums] ----- -[ - {"timeStamp":"2024-08-01T00:00:00Z","objectStoreRequestCount":1}, - {"timeStamp":"2024-09-01T00:00:00Z","objectStoreRequestCount":25} -] ----- [[download-osv2-apis]] == Download Object Store APIs from Exchange @@ -834,6 +564,5 @@ image::os-exchange-download.png["Download button for the Object Store v2 API in * xref:index.adoc#rolling-ttl[Rolling TTL] * https://dev-portal.mulesoft.com/apis/object-store-v2.html[Object Store v2 API] -* https://dev-portal.mulesoft.com/apis/object-store-v2-stats.html[Object Store v2 Stats API] * https://dev-portal.mulesoft.com/apis/access-management.html[Access Management API] * xref:connectors::object-store/object-store-connector.adoc[Object Store Connector for Mule 4] diff --git a/modules/ROOT/pages/osv2-connected-apps.adoc b/modules/ROOT/pages/osv2-connected-apps.adoc index 767cd1a..c31a48c 100644 --- a/modules/ROOT/pages/osv2-connected-apps.adoc +++ b/modules/ROOT/pages/osv2-connected-apps.adoc @@ -68,7 +68,4 @@ This scope doesn't apply to Object Store v2. This scope doesn't apply to Object Store v2. -|Store Metrics Viewer -|`read:store_metrics` -|Retrieve Object Store v2 metrics using the Object Store v2 Stats API. |=== diff --git a/modules/ROOT/pages/osv2-faq.adoc b/modules/ROOT/pages/osv2-faq.adoc index f455d91..0673386 100644 --- a/modules/ROOT/pages/osv2-faq.adoc +++ b/modules/ROOT/pages/osv2-faq.adoc @@ -69,12 +69,14 @@ For information about the Mule object store, see xref:mule-runtime::mule-object- == How can I see usage data? -To view API request data, see xref:osv2-usage.adoc[View Usage Graphs]. +To view Object Store v2 usage data: + +* For a UI view, use xref:osv2-usage.adoc#access-os-usage-reports[Anypoint Usage Reports]. +* For programmatic access, use the xref:osv2-usage.adoc#anypoint-usage-api[Anypoint Usage API]. == What happens when the transaction limit for my subscription is reached? An Object Store v2 subscription pack allows up to 100 million transactions per month for an Anypoint Platform organization. This limit is applied across all Production and non-Production environments. -You can use the https://dev-portal.mulesoft.com/apis/object-store-v2-stats.html[Object Store v2 Stats API] to monitor usage. //Shared Usage Overage @@ -141,10 +143,9 @@ xref:osv2-guide.adoc#configure-a-custom-time-to-live-period[Configure a Custom T == Where is the Object Store v2 REST API portal? -The Object Store v2 APIs are available in the Anypoint Platform Developer's portal: +The Object Store v2 API is available in the Anypoint Platform Developer's portal: * https://dev-portal.mulesoft.com/apis/object-store-v2.html[Object Store v2] -* https://dev-portal.mulesoft.com/apis/object-store-v2-stats.html[Object Store v2 Stats] == Where is the Object Store connector? @@ -198,7 +199,6 @@ By default, the *Use Object Store v2* option is enabled during CloudHub applicat == See Also * https://dev-portal.mulesoft.com/apis/object-store-v2.html[Object Store v2 API] -* https://dev-portal.mulesoft.com/apis/object-store-v2-stats.html[Object Store v2 Stats API] * xref:osv2-guide.adoc#configure-a-custom-time-to-live-period[Configure a Custom Time-to-Live Period] * xref:osv2-guide.adoc#create-object-store-partitions[Create Object Store Partitions] * xref:connectors::object-store/object-store-connector.adoc[Object Store Connector for Mule 4] diff --git a/modules/ROOT/pages/osv2-guide.adoc b/modules/ROOT/pages/osv2-guide.adoc index 58d90e7..2857486 100644 --- a/modules/ROOT/pages/osv2-guide.adoc +++ b/modules/ROOT/pages/osv2-guide.adoc @@ -22,9 +22,6 @@ To use Object Store v2 with Mule 4 apps, ensure that you select the correct obje * REST API + The Object Store v2 API enables you to create and delete objects, set TTL (time to live) for objects, and set usage limits. -+ -The Object Store v2 Stats API enables you to retrieve Object Store v2 usage statistics, -such as how many API calls per month your organization makes to Object Store. * Anypoint Runtime Manager + @@ -228,7 +225,6 @@ to deploy your app to CloudHub: * xref:index.adoc#rolling-ttl[Rolling TTL] * xref:osv2-faq.adoc#what-are-the-advantages-of-using-partitions[What are the advantages of using partitions?] * https://dev-portal.mulesoft.com/apis/object-store-v2.html[Object Store v2 API] -* https://dev-portal.mulesoft.com/apis/object-store-v2-stats.html[Object Store v2 Stats API] * xref:release-notes::object-store/anypoint-osv2-release-notes.adoc[Object Store v2 Release Notes] * xref:connectors::object-store/object-store-connector.adoc[Object Store Connector for Mule 4] * xref:mule-runtime::deploy-to-cloudhub.adoc[Deploy Applications to CloudHub] \ No newline at end of file diff --git a/modules/ROOT/pages/osv2-usage.adoc b/modules/ROOT/pages/osv2-usage.adoc index 2855062..9e19222 100644 --- a/modules/ROOT/pages/osv2-usage.adoc +++ b/modules/ROOT/pages/osv2-usage.adoc @@ -1,12 +1,9 @@ = Object Store v2 Rate Limiting and Billing -Monitor your Object Store v2 billing by understanding how API requests and effective API requests impact rate limiting and billing. Track usage metrics through Access Management or Usage to optimize application performance and avoid exceeding your subscription limits. +Monitor your Object Store v2 billing by understanding how API requests and effective API requests impact rate limiting and billing. Track usage metrics through Anypoint Usage Reports or the Anypoint Usage API to optimize application performance and avoid exceeding your subscription limits. Object Store v2 uses two metrics to determine rate-limiting and billing: API requests and effective API requests. -Depending on your Anypoint Platform instance, you access usage data in Access Management or Usage. - -* <> -* <> +To access usage data, use <> or the <>. [NOTE] ==== @@ -144,48 +141,9 @@ based on your subscription type: include::partial$osv2-faq.adoc[tag=faqUsageOverage] -[[access-usage-charts]] -== Access Effective API Request Usage Charts - -[NOTE] -include::partial$osv2-on-hyperforce.adoc[tag=osv2FeaturesNoHFnote] - -To view a chart that shows how many effective API requests your apps have consumed and the number of effective API requests that your subscription allows: - -. In Anypoint Platform, go to *Access Management*. -. Click *Object Store* in the *Subscription* section: -+ -image::os-access-mgmt-subscription.png["Object Store option in the Subscriptions section of the Access Management navigation"] -+ -The chart shows usage stats for the current and previous month: -+ -image::os-access-mgmt-usage-chart.png["Object Store Usage page for effective API requests"] -+ -[calloutlist] -.. Percentage and amount of your quota that you have used -+ -If the usage is 0, the chart displays `<1%`. -+ -The circle graph changes to red as your effective API request usage approaches your quota: -+ -image::os-access-mgmt-requests-color.png["Object Store effective API request graph showing the usage in red"] -+ -NOTE: Monthly billing usage information might be delayed by up to 24 hours. -.. Subscription type -*** `Base 0.0` indicates the Base subscription. -*** Base values greater than `0.0` indicate Premium add-on subscriptions. - -In some cases, the stats for the current month might not load when the backend process updates the records. -If this happens, use the Object Store v2 Stats API -xref:osv2-apis.adoc#usage-by-org[Usage Metrics by Organization] -to query the daily usage in the current month and then add the daily usage together. - [[access-os-usage-reports]] == Access Effective API Request Usage Reports -[NOTE] -include::partial$osv2-on-hyperforce.adoc[tag=osv2FeaturesOnlyHFnote] - To view Object Store usage reports in Usage: . In Anypoint Platform, go to *Usage*. @@ -203,21 +161,78 @@ The report shows: For more information, see xref:general::usage-reports.adoc[]. +[[anypoint-usage-api]] +== Retrieve Usage Metrics with the Anypoint Usage API -[[osv2-stats-api]] -== Retrieve Usage Metrics with Object Store v2 Stats API +To retrieve Object Store v2 usage metrics programmatically, use the Anypoint Usage API. + +The Anypoint Usage API uses AMQL (Anypoint Metric Query Language), a SQL-like query language, to query usage meters. + +=== Before You Begin + +* Get a bearer token for an Anypoint Platform user with the *Usage Viewer* permission at the root organization level. ++ +See xref:osv2-apis.adoc#get-bearer-token[Get a Bearer Token]. + +=== Discover Available Meters + +To view all available Object Store meters and their column names: + +[source,bash,linenums] +---- +curl -X GET 'https://anypoint.mulesoft.com/metering/usage/api/v1/meters:describe' \ + -H 'Authorization: Bearer ' +---- + +=== Query Object Store Usage + +To retrieve effective API request counts, submit a POST request using AMQL: + +[source,bash,linenums] +---- +curl -X POST 'https://anypoint.mulesoft.com/metering/usage/api/v1/meters:search' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + -d '{ + "query": "SELECT effective_api_requests FROM object_store_effective_api_requests_count WHERE timestamp between and TIMESERIES P1D" + }' +---- + +Replace `START_EPOCH_MS` and `END_EPOCH_MS` with epoch milliseconds for your date range. [NOTE] -include::partial$osv2-on-hyperforce.adoc[tag=osv2FeaturesNoHFnote] +==== +The Usage API uses epoch milliseconds, not ISO 8601 strings. +For example, `2024-01-01T00:00:00.000Z` = `1704067200000`. +==== -To use the Object Store v2 Stats API to retrieve usage metrics, see: +=== AMQL Query Reference + +[source,sql] +---- +SELECT +FROM +WHERE timestamp between and + [AND org_id = ''] + [AND env_id = ''] +TIMESERIES +---- + +[%header,cols="20,40,40"] +|=== +| Parameter | Description | Values +| `TIMESERIES` | Granularity of results | `P1D` (daily) or `P1M` (monthly) +| Daily range (`P1D`) | Maximum query interval | 30 days +| Monthly range (`P1M`) | Maximum query interval | 60 days +| Data recency | Delay for data consolidation | 3-day delay +|=== -* xref:osv2-apis.adoc#usage-by-org[Get Usage Metrics by Organization] -* xref:osv2-apis.adoc#usage-by-env[Get Usage Metrics by Environment] -* xref:osv2-apis.adoc#usage-by-region[Get Usage Metrics by Region] -* xref:osv2-apis.adoc#usage-by-store[Get Usage Metrics by Store] +[IMPORTANT] +`SELECT *` is not supported. Always specify column names explicitly. +Use the `:describe` endpoint to get the current column names for each meter. == See Also * xref:osv2-faq.adoc[Object Store FAQ] +* xref:general::usage-reports.adoc[]