Monitoring and tracing

To Monitor and trace user activity on the client side, we need to enable telemetry. will see how to enable the telemetry in our dev environment and also in the local environment.

Local Environment:-

To enable it into local development we need to add the javascript code block of telemetry into the index.html

Path:- micro-ui → web → public → index.html

Link:- https://github.com/egovernments/DIGIT-Dev/blob/master/frontend/micro-ui/web/public/index.html

Script:-

<script src=https://unpkg.com/@egovernments/telemetry@0.0.2/dist/egov-telemetry-1557467338.js type=text/javascript> </script>

 

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <link rel="icon" href="https://cdn.jsdelivr.net/npm/@egovernments/digit-ui-css/img/browser-icon.png"/> <link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap" rel='stylesheet' type='text/css'> <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.4.111/dist/index.css"/> <!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css/dist/index.css"/> --> <meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="theme-color" content="#00bcd1"/> <title>mSeva</title> <!-- <script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js"></script> --> <script src=https://unpkg.com/@egovernments/telemetry@0.0.2/dist/egov-telemetry-1557467338.js type=text/javascript> </script> </head> <body> <noscript>You need to enable JavaScript to run this app.</noscript> <div id="root"></div> <!-- This HTML file is a template. If you open it directly in the browser, you will see an empty page. You can add webfonts, meta tags, or analytics to this file. The build step will place the bundled scripts into the <body> tag. To begin the development, run `npm start` or `yarn start`. To create a production bundle, use `npm run build` or `yarn build`. --> </body> </html>

 

Once the script was added to the index.html restart the server and go to the Network tab and filter for telemetry.



Dev Environment:-

To enable it in the dev environment we need to add the javascript code block of telemetry into the
Path:- DIGIT-DevOps/deploy-as-code/helm/environments/dev.yam

Link:-https://github.com/egovernments/DIGIT-DevOps/blob/1505924733cc56f85912b3add1f21815d8f62b7a/deploy-as-code/helm/environments/dev.yaml#L394

<script src=https://unpkg.com/@egovernments/telemetry@0.0.2/dist/egov-telemetry-1557467338.js type=text/javascript> </script>

 

 

Whichever environment file has been used to deploy DIGIT, please make sure the above code blocks are added to the file.

If these don't exist already in the file, add these and redeploy the citizen, employee, and digit-UI modules using Helm.

Once Build is successful and deployed on the dev server we can track it into the Network tab by filter telemetry.