cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mobile App: MAUI auto instrument

Afternoon community,

we currently host a mobile Maui app for which we'd like to implement auto instrumentation.
I think part of the auto-instrumentation is Step number 5 mentioned in the doc (Enabling automatic web request instrumentation )

The dev implementing this is using httpclient factory which brings complexity in implementing the suggestion in Step 5.
Has anyone experienced such complexity and how did you solve this?

Regards

1 REPLY 1

matthias_hochri
Dynatrace Pro
Dynatrace Pro

I don't have direct experience with the HttpClientFactory, but documentation shows how to create the HttpMessageHandler.

and in your documentation example about the usage of HttpClientFactory I can see the following:

 

builder.Services.AddHttpClient();

 

So I would assume the following usage:

 

builder.Services.AddHttpClient()
.ConfigureHttpMessageHandler(() => { 
   return Agent.Instance.GetHttpMessageHandler();
});

 

or

 

builder.Services.AddHttpClient()
.ConfigureHttpMessageHandlerBuilder((builder) => { 
   builder.PrimaryHandler = Agent.Instance.GetHttpMessageHandler();
   builder.Build();
});​

 

See https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory#configure-the-httpmessag...

 

Featured Posts