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

Dynatrace Instrument mobile apps with Flutter

KM-DT
Frequent Guest

Hi All

 

Is it possible to use Dynatrace to monitor these 3 parts of flutter?

1.web socket/socket.io 

2.flutter for webview

3.http for lib dio

9 REPLIES 9

PierreGutierrez
Dynatrace Pro
Dynatrace Pro

Hi @KM-DT 

From a "Real user monitoring (RUM)" perspective, YES, Dynatrace can monitor all of this.

1.web socket/socket.io and 3.http for lib gave

Both are communication technologies/protocols between applications and servers.
You could help yourself with automatic instrumentation or perhaps manual instrumentation (so that you have greater control of your request)
Example : 

PierreGutierrez_0-1715815973922.png


2.flutter for webview
The web view part is monitored by the web application via the JS agent.
--------------------------------------------------------------------------------------------------------------------------
I share the Flutter instrumentation steps, in case you need them

PierreGutierrez_2-1715816169863.png  PierreGutierrez_3-1715816281482.png

For more information you can search here :  https://docs.dynatrace.com/docs/shortlink/flutter 
Demo implementation of Flutter : dynatrace_flutter_plugin example | Flutter package (pub.dev)

I hope it's helpful 💪

Pierre Gutierrez - LATAM ACE Consultant - Loving Cats! Loving Technology !

Hello PierreGutierrez

 

Initially, I have already auto-instrumented in flutter, but we can see only the http request action.

1.How to automatic instrumentation for socket.io ?

 

2.I see additional documentation for the lib dio. If I want to do automatic instrumentation, can I import the package:dynatrace_flutter_plugin_dio/dynatrace_flutter_plugin_dio.dart' in this document?

https://pub.dev/packages/dynatrace_flutter_plugin_dio

 

3.The web view part is monitored from your steps, I have already done it and still don't see the web view action.

web application via the JS agent, do you mean need agentless monitoring and inject the JavaScript tag

1.) There is no automatic instrumentation. + Manual instrumentation is for HTTP protocol. Not sure if Websockets somehow can be monitored with this. 

2) Correct. Use this package.

3) You need to inject into the web application the JavaScript Tag. Is the content localhost or some external page?

Hello matthias_hochri

 

1.)Can you check and confirm about websocket whether it supports or not?

if support what kind of instrumentation is required?

2.Thank you for your confirmation.

3.flutter webview use same method with agentless, So can inject into the JavaScript tag too right?

3) Yeah simply inject/add the JavaScript agent tag and enable hybridWebView mode on native agents. This should merge sessions of Mobile and what happens in the Webview. For further assistance please create a support ticket as this is too complex here. 

1) Our native agent supports and allows tracking of ws/wss as well. Tracking of Websockets can be done by marking start and end. Thus this makes sense for Websockets with shorter duration. If you keep your Socket connection open for a long time, this monitoring is not supported currently. 

There is a documentation for Android available here: https://docs.dynatrace.com/docs/platform-modules/digital-experience/mobile-applications/instrument-a... - Basically this work similar in Flutter because the WebRequestTiming API is available there as well. 

Hello matthias_hochri

 

1.Does it need to have oneagent on the server side or not?

Or just the oneagent on mobile native?

 

3.Thank you for your information.

Hi @KM-DT 
I am agree with the answers by Matthias, I will add some details that may be useful to you.
 
3 .- Yes, you can monitoring with OneAgent's JavaScript injection the webview.
Is not mandatory to enable "hybridWebView ", but it is a good recommendation however it requires some additional configuration.
The reason I say this is because there are some cases where the customer initially wants to monitor it separately (so as not to combine the apdex), and later unify it with "hybridWebView".

1.- In that case ( WebSocket ), manual instrumentation is necessary. And for this it is necessary to have the Dynatrace for Flutter library import.

import 'package:dynatrace_flutter_plugin/dynatrace_flutter_plugin.dart';

You may have to take into consideration some rules mentioned in ws/wss call recognition ( https://docs.dynatrace.com/docs/shortlink/oneagent-sdk-for-android#monitor-non-http-requests ) 

PierreGutierrez_0-1716002215813.png

I hope it's helpfull 💪

 

Pierre Gutierrez - LATAM ACE Consultant - Loving Cats! Loving Technology !

Hello

 

Thank for more detail.

I have more question,If it's non-HTTP(s), such as gRPC, will it be able to see Networks Request?

Currently we only support http(s) and ws(s). So if the endpoint starts differently the tracking might not work as the URL validation fails on the agent side. 

Featured Posts