You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/developer/component-framework/sample-controls/customized-editable-grid-control.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ You can find the code for sample here: [PowerApps-Samples/component-framework/Po
35
35
36
36
The key change is to [PAGridCustomizer/customizers/CellRendererOverrides.tsx ](https://github.com/microsoft/PowerApps-Samples/blob/master/component-framework/PowerAppsGridCustomizerControl/PAGridCustomizer/customizers/CellRendererOverrides.tsx).
37
37
38
-
This sample uses the following override for the cell renderer to change the the text color for text fields to green, and the color of the `creditlimit` column depends on the value.
38
+
This sample uses the following override for the cell renderer to change the text color for text fields to green, and the color of the `creditlimit` column depends on the value.
Copy file name to clipboardExpand all lines: powerapps-docs/developer/data-platform/application-insights-ilogger.md
+26-26Lines changed: 26 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Write Telemetry to your Application Insights resource using ILogger (Microsoft Dataverse) | Microsoft Docs"
3
-
description: "When you enable Application Insights for your organization, any plug-ins written using the ILogger Interface provided in the SDK will write telemetry to your Application Insights resource."
4
-
ms.date: 10/06/2022
3
+
description: "When you enable Application Insights for your organization, any plug-ins written using the ILogger Interface provided in the SDK writes telemetry to your Application Insights resource."
4
+
ms.date: 03/10/2023
5
5
author: divkamath
6
6
ms.author: dikamath
7
7
ms.reviewer: pehecke
@@ -23,36 +23,36 @@ contributors:
23
23
> To use this capability you must first enable the Application Insights integration feature. More information: [Analyze model-driven apps and Microsoft Dataverse telemetry with Application Insights](/power-platform/admin/analyze-telemetry)<p/>
24
24
> There is presently no support of `ILogger` within a plug-in profiling/debug session of the Plug-in Registration tool or the Power Platform Tools extension for Visual Studio.
25
25
26
-
When you enable Application Insights for your organization, any plug-ins written using the [ILogger Interface](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger) provided in the Organization Service SDK assemblies will write telemetry to your Application Insights resource.
26
+
When you enable Application Insights for your organization, any plug-ins written using the [ILogger Interface](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger) provided in the Organization Service SDK assemblies write telemetry to your Application Insights resource.
27
27
28
-
The Dataverse and model-driven app telemetry data you receive when using the Application Insights integration is captured by the Dataverse platform and exported to your Application Insights resource. This means there will be some latency between the time it was captured and when it becomes available to you in Application Insights. Because this telemetry is gathered by Microsoft, you do not need to write any code to enable it.
28
+
The Dataverse platform captures the Dataverse and model-driven app telemetry data and exports it to your Application Insights resource. There's some latency between the time it was captured and when it becomes available to you in Application Insights. Because Microsoft gathers this telemetry, you don't need to write any code to enable it.
29
29
30
30
Telemetry data that comes from plug-ins using the ILogger interface is different in two ways:
31
31
32
32
- This telemetry is written directly to your Application Insights resource and is never sent to Microsoft.
33
-
-This means there will be less latency in viewing this data.
33
+
-There's less latency in viewing this data.
34
34
- You must update your plug-in code to use the ILogger interface.
35
35
36
-
Using ILogger will provide true telemetry data and is intended to work together with the existing Plug-in Trace Logs written using the [ITracingService Interface](/dotnet/api/microsoft.xrm.sdk.itracingservice). The following table compares the capabilities:
36
+
Using ILogger provides true telemetry data and is intended to work together with the existing Plug-in Trace Logs written using the [ITracingService Interface](xref:Microsoft.Xrm.Sdk.ITracingService). The following table compares the capabilities:
37
37
38
38
39
39
|Criteria |ILogger for Application Insights |ITracingService Trace for Plug-in Trace Logs |
40
40
|---------|---------|---------|
41
41
|Intended use|Capture telemetry over time for analysis and debugging.|While developing and debugging plug-ins|
42
42
|How long data is stored|According to your Application Insights data retention period, which is 90 days by default|24 hours|
43
-
|Available|Only for organizations that have subscribed to Application Insights integration.|For any organization when Plug-in tracing is enabled.|
44
-
|Amount of data|Each log message can pass a String value.|Only 10kb of text can be written for each plug-in execution. Any more will be truncated.|
45
-
|Available in runtime errors|No|Available in model-driven app client errors and as annotations in Web API. More information: [Include additional details with errors](webapi/compose-http-requests-handle-errors.md#include-additional-details-with-errors)|
43
+
|Available|Only for organizations that have subscribed to Application Insights integration.|Available for any organization when Plug-in tracing is enabled.|
44
+
|Amount of data|Each log message can pass a String value.|Only 10 kb of text can be written for each plug-in execution. Any more is truncated.|
45
+
|Available in runtime errors|No|Available in model-driven app client errors and as annotations in Web API. More information: [Include more details with errors](webapi/compose-http-requests-handle-errors.md#include-more-details-with-errors)|
46
46
47
-
You should continue to use the [ITracingService.Trace](/dotnet/api/microsoft.xrm.sdk.itracingservice.trace) to write to the Plug-in Trace Log table when needed. Not every organization will enable Application Insights. If your plug-in code uses the ILogger interface and the organization does not have Application Insights integration enabled, nothing will be written. So, it is important to continue to use the ITracingService Trace method in your plug-ins. Plug-in trace logs continue to be an important way to capture data while developing and debugging plug-ins, but they were never intended to provide telemetry data. More information: [Plug-ins: Tracing and logging](logging-tracing.md)
47
+
You should continue to use the [ITracingService.Trace](xref:Microsoft.Xrm.Sdk.ITracingService.Trace%2A) to write to the Plug-in Trace Log table when needed. Not every organization enables Application Insights. If your plug-in code uses the ILogger interface and the organization doesn't have Application Insights integration enabled, nothing is written. So, it's important to continue to use the ITracingService Trace method in your plug-ins. Plug-in trace logs continue to be an important way to capture data while developing and debugging plug-ins, but they were never intended to provide telemetry data. More information: [Plug-ins: Tracing and logging](logging-tracing.md)
48
48
49
-
You should use [ILogger](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger) because it will allow for telemetry about what happens within a plug-in to be integrated with the larger scope of data captured with the Application Insights integration. The Application Insights integration will tell you when a plug-in executes, how long it takes to run and whether it makes any external http requests, but Microsoft cannot add any telemetry code within the plug-ins that people write to extend the behavior of the platform.
49
+
You should use [ILogger](xref:Microsoft.Xrm.Sdk.PluginTelemetry.ILogger) because it provides telemetry about what happens within a plug-in. This telemetry is integrated with the larger scope of data captured with the Application Insights integration. The Application Insights integration tells you when a plug-in executes, how long it takes to run and whether it makes any external http requests, but Microsoft can't add any telemetry code within the plug-ins that you write to extend the behavior of the platform.
50
50
51
-
If you are an ISV with a product that includes plug-ins, your customers who enable Application Insights will appreciate being able to see what is going on within your plug-ins and this data may help you support them if there are issues. But data captured using ILogger will only be sent to the subscribing customer's resource. You will only be able to see data captured for your own environments when you have Application Insights enabled.
51
+
If you're an ISV with a product that includes plug-ins, your customers who enable Application Insights appreciate being able to see what is going on within your plug-ins and this data may help you support them if there are issues. But data captured using ILogger is only sent to the subscribing customer's resource. You'll only be able to see data captured for your own environments when you have Application Insights enabled.
52
52
53
53
## Use ILogger
54
54
55
-
ILogger is a common interface for capturing log information. The implementation provided with the Organization Service SDK assemblies provides common methods to support establishing a scope and different levels of logging. There is currently no setting to control what level of logs are written. The levels can be used within Application Insights to filter which logs to view.
55
+
ILogger is a common interface for capturing log information. The implementation provided with the Organization Service SDK assemblies provides common methods to support establishing a scope and different levels of logging. There's currently no setting to control what level of logs are written. The levels can be used within Application Insights to filter which logs to view.
56
56
57
57
The following is an example of a plug-in using both ILogger and ITracingService.Trace.
58
58
@@ -207,7 +207,7 @@ namespace ILoggerExample
207
207
208
208
When this plug-in is registered on a synchronous `PostOperation` step for the `Create` of an `account` entity, you can use Application Insights Logs to view the output within a few minutes. You can use [Kusto Query Language (KQL)](/azure/data-explorer/kql-quick-reference) to query the results.
209
209
210
-
You can filter items for a single operation using the `operation_ParentId` that represents the request id of the response header.
210
+
You can filter items for a single operation using the `operation_ParentId` that represents the request ID of the response header.
211
211
212
212
:::image type="content" source="media/application-insights-ilogger-trace-operation_parentid.png" alt-text="Filter items for a single operation using the operation_ParentId .":::
213
213
@@ -223,19 +223,19 @@ Outbound call started
223
223
Outbound call ended successfully
224
224
```
225
225
226
-
Note that the information set with the [BeginScope Method](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger.beginscope)is not visible in the rows returned in Application Insights. This data is set within the `customDimensions` of logs added within that scope. You can use this query to show the logs within the scope.
226
+
The information set with the [BeginScope Method](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger.beginscope)isn't visible in the rows returned in Application Insights. This data is set within the `customDimensions` of logs added within that scope. You can use this query to show the logs within the scope.
227
227
228
-
This query will limit the results to the logs added during the `Callback` scope
228
+
This query limits the results to the logs added during the `Callback` scope
229
229
230
-
:::image type="content" source="media/application-insights-ilogger-trace-callback-scope.png" alt-text="Query will limit the results to the logs added during the Callback scope.":::
230
+
:::image type="content" source="media/application-insights-ilogger-trace-callback-scope.png" alt-text="Query limits the results to the logs added during the Callback scope.":::
231
231
232
-
And this query will limit the results to the logs added during the `OutboundCall` scope:
232
+
And this query limits the results to the logs added during the `OutboundCall` scope:
233
233
234
-
:::image type="content" source="media/application-insights-ilogger-trace-outboundcall-scope.png" alt-text="query will limit the results to the logs added during the OutboundCall scope.":::
234
+
:::image type="content" source="media/application-insights-ilogger-trace-outboundcall-scope.png" alt-text="query limits the results to the logs added during the OutboundCall scope.":::
235
235
236
236
## Logging Exceptions
237
237
238
-
At the bottom of the the plug-in code example above, the following code uses [LogError](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger.logerror) to log a caught exception and throws an [InvalidPluginExecutionException](/dotnet/api/microsoft.xrm.sdk.invalidpluginexecutionexception):
238
+
At the bottom of the plug-in code example above, the following code uses [LogError](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger.logerror) to log a caught exception and throws an [InvalidPluginExecutionException](/dotnet/api/microsoft.xrm.sdk.invalidpluginexecutionexception):
239
239
240
240
```csharp
241
241
catch (Exceptione)
@@ -251,9 +251,9 @@ Using the plug-in code above, you can cause an exception by passing an invalid v
251
251
252
252
:::image type="content" source="media/application-insights-ilogger-cause-error.png" alt-text="Causing an error by entering invalid configuration value in plug-in step registration.":::
253
253
254
-
This will override the default value (`https://www.bing.com`) and cause the outbound call to fail.
254
+
This value overrides the default value (`https://www.bing.com`) and cause the outbound call to fail.
255
255
256
-
There is nothing wrong with the request that a client may send:
256
+
There's nothing wrong with the request that a client may send:
257
257
258
258
```http
259
259
POST [Organization URI]/api/data/v9.1/accounts HTTP/1.1
But due to the incorrect plug-in step registration the response will return the following error with all the details when the `Prefer: odata.include-annotations="*"` header is used:
269
+
But due to the incorrect plug-in step registration the response returns the following error with all the details when the `Prefer: odata.include-annotations="*"` header is used:
@@ -329,11 +329,11 @@ Within Application Insights, if you view traces scoped to this request and with
329
329
330
330
:::image type="content" source="media/application-insights-ilogger-trace-error.png" alt-text="View traces scoped to this request and with the scope set to OutboundCall.":::
331
331
332
-
Within Application Insights, when you switch your query to use `exceptions` rather than `traces`, you will see three exceptions logged:
332
+
Within Application Insights, when you switch your query to use `exceptions` rather than `traces`, you'll see three exceptions logged:
333
333
334
334
:::image type="content" source="media/application-insights-ilogger-cause-error-exceptions.png" alt-text="Switch your query to use exceptions rather than traces.":::
335
335
336
-
The one where `cloud_RoleInstance` equals `SandboxRoleInstance` is the one which was written because of the [ILogger LogError method](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger.logerror). The other two represent different locations where the error was logged on the server.
336
+
The one where `cloud_RoleInstance` equals `SandboxRoleInstance` is the one that was written because of the [ILogger LogError method](/dotnet/api/microsoft.xrm.sdk.plugintelemetry.ilogger.logerror). The other two represent different locations where the error was logged on the server.
337
337
338
338
> [!NOTE]
339
339
> The SandboxRoleInstance `client_Type` is `PC`. This is because the plug-in runs in an isolated sandbox as a client rather than on the server.
Copy file name to clipboardExpand all lines: powerapps-docs/developer/data-platform/best-practices/business-logic/set-timeout-for-external-calls-from-plug-ins.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ If a plug-in makes external web requests that fail to respond quickly, the plug-
45
45
46
46
The default timeout value for .Net Http clients is 100 seconds, just 20 seconds short of the time available for the plug-in to complete. It is best to establish an expected baseline time that a calling service will respond. The longer it exceeds this normal response time, the higher the probability it will ultimately fail. As a performance best practice, it is best to fail quickly rather than allow the default timeout period to expire. You should control the period that your call to the external service will wait.
47
47
48
-
The timeout value you should set will depend on the service. For example, if you can monitor the performance of the service you may determine a duration where 99.999% of requests succeed and set your timeout period to that duration with a few seconds buffer. This will prevent the the occasional outliers from having an inordinate impact on the performance of your plug-in.
48
+
The timeout value you should set will depend on the service. For example, if you can monitor the performance of the service you may determine a duration where 99.999% of requests succeed and set your timeout period to that duration with a few seconds buffer. This will prevent the occasional outliers from having an inordinate impact on the performance of your plug-in.
49
49
50
50
If you are using [System.Net.Http.HttpClient Class](/dotnet/api/system.net.http.httpclient), you can set the `Timeout` value explicitly, as shown in this example setting the timeout to 15 seconds.
0 commit comments