Skip to content

Commit 26ea65a

Browse files
Merge pull request #289620 from dlepow/beid
[APIM] Backend ID dimension for custom metrics
2 parents 9f69029 + 18a397c commit 26ea65a

File tree

4 files changed

+31
-34
lines changed

4 files changed

+31
-34
lines changed

articles/api-management/azure-openai-emit-token-metric-policy.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: reference
9-
ms.date: 09/26/2024
9+
ms.date: 04/01/2025
1010
ms.author: danlep
1111
ms.collection: ce-skilling-ai-copilot
1212
ms.custom:
@@ -65,19 +65,11 @@ The `azure-openai-emit-token-metric` policy sends custom metrics to Application
6565
| name | A string or policy expression. Name of dimension. | Yes | N/A |
6666
| value | A string or policy expression. Value of dimension. Can only be omitted if `name` matches one of the default dimensions. If so, value is provided as per dimension name. | No | N/A |
6767

68-
### Default dimension names that may be used without value
69-
70-
* API ID
71-
* Operation ID
72-
* Product ID
73-
* User ID
74-
* Subscription ID
75-
* Location
76-
* Gateway ID
68+
[!INCLUDE [api-management-emit-metric-dimensions](../../includes/api-management-emit-metric-dimensions.md)]
7769

7870
## Usage
7971

80-
- [**Policy sections:**](./api-management-howto-policies.md#sections) inbound
72+
- [**Policy sections:**](./api-management-howto-policies.md#sections) inbound, outbound
8173
- [**Policy scopes:**](./api-management-howto-policies.md#scopes) global, workspace, product, API, operation
8274
- [**Gateways:**](api-management-gateways-overview.md) classic, v2, consumption, self-hosted, workspace
8375

@@ -91,7 +83,7 @@ The `azure-openai-emit-token-metric` policy sends custom metrics to Application
9183

9284
## Example
9385

94-
The following example sends Azure OpenAI token count metrics to Application Insights along with API ID as a custom dimension.
86+
The following example sends Azure OpenAI token count metrics to Application Insights along with API ID as a default dimension.
9587

9688
```xml
9789
<policies>

articles/api-management/emit-metric-policy.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: reference
9-
ms.date: 09/25/2024
9+
ms.date: 04/01/2025
1010
ms.author: danlep
1111
ms.custom: engagement-fy23
1212
---
@@ -59,15 +59,7 @@ The `emit-metric` policy sends custom metrics in the specified format to Applica
5959
| name | A string or policy expression. Name of dimension. | Yes | N/A |
6060
| value | A string or policy expression. Value of dimension. Can only be omitted if `name` matches one of the default dimensions. If so, value is provided as per dimension name. | No | N/A |
6161

62-
### Default dimension names that may be used without value
63-
64-
* API ID
65-
* Operation ID
66-
* Product ID
67-
* User ID
68-
* Subscription ID
69-
* Location
70-
* Gateway ID
62+
[!INCLUDE [api-management-emit-metric-dimensions](../../includes/api-management-emit-metric-dimensions.md)]
7163

7264
## Usage
7365

@@ -81,7 +73,7 @@ The `emit-metric` policy sends custom metrics in the specified format to Applica
8173

8274
## Example
8375

84-
The following example sends a custom metric to count the number of API requests along with API ID as a custom dimension.
76+
The following example sends a custom metric to count the number of API requests along with API ID as a default dimension.
8577

8678
```xml
8779
<policies>

articles/api-management/llm-emit-token-metric-policy.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: reference
9-
ms.date: 09/26/2024
9+
ms.date: 04/01/2025
1010
ms.author: danlep
1111
ms.collection: ce-skilling-ai-copilot
1212
ms.custom:
@@ -67,19 +67,12 @@ The `llm-emit-token-metric` policy sends custom metrics to Application Insights
6767
| name | A string or policy expression. Name of dimension. | Yes | N/A |
6868
| value | A string or policy expression. Value of dimension. Can only be omitted if `name` matches one of the default dimensions. If so, value is provided as per dimension name. | No | N/A |
6969

70-
### Default dimension names that may be used without value
70+
[!INCLUDE [api-management-emit-metric-dimensions](../../includes/api-management-emit-metric-dimensions.md)]
7171

72-
* API ID
73-
* Operation ID
74-
* Product ID
75-
* User ID
76-
* Subscription ID
77-
* Location
78-
* Gateway ID
7972

8073
## Usage
8174

82-
- [**Policy sections:**](./api-management-howto-policies.md#sections) inbound
75+
- [**Policy sections:**](./api-management-howto-policies.md#sections) inbound, outbound
8376
- [**Policy scopes:**](./api-management-howto-policies.md#scopes) global, workspace, product, API, operation
8477
- [**Gateways:**](api-management-gateways-overview.md) classic, v2, consumption, self-hosted, workspace
8578

@@ -92,7 +85,7 @@ The `llm-emit-token-metric` policy sends custom metrics to Application Insights
9285

9386
## Example
9487

95-
The following example sends LLM token count metrics to Application Insights along with API ID as a custom dimension.
88+
The following example sends LLM token count metrics to Application Insights along with API ID as a default dimension.
9689

9790
```xml
9891
<policies>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
author: dlepow
3+
ms.service: azure-api-management
4+
ms.custom:
5+
- build-2024
6+
ms.topic: include
7+
ms.date: 10/31/2024
8+
ms.author: danlep
9+
---
10+
11+
### Default dimension names that may be used without value
12+
13+
* API ID
14+
* Operation ID
15+
* Product ID
16+
* User ID
17+
* Subscription ID
18+
* Location
19+
* Gateway ID
20+
* Backend ID (use only in outbound policy)

0 commit comments

Comments
 (0)