LogMetric not working with microsoft extension framework - azure-log-analytics

I am using the logging extension framework in an asp.net core function app. I have following code:
log.LogMetric("TESTER", 0);
log.LogInformation($"{{logTypeStart}}: {service.GetType()}", logTypeStart);
await service.Run(log);
log.LogInformation($"{{logTypeEnd}}: {service.GetType()}", logTypeEnd);
In log analytics I query following:
AppTraces
AppMetrics
The LogInformation logs traces to the AppTraces in Log Analytics. But AppMetrics does not provide any results. Any pointers on how to troubleshoot this?

I tested it with Function V3, the metrics can be sent to both AI and the connected Log Analytics.
Please check the things below:
1.Test your code first locally(please follow this thread to see how azure function and application insights works locally), and see if the metrics can be shown in visual studio output. The screenshot is as below:
2.Please make sure the Azure log Analytics is actually connected with the AI you're using.
3.In Azure log Analytics, when query in AppMetrics table, make sure you have selected the proper time range. Here is the screenshot of my metrics:
Please let me know if any more issues.

Related

Azure App Insights, is there a way to query for thread count details?

this question is mostly for DevOps experts, in app insights.
So I found I have an issue on my app, it seems some threads are being created and not released, causing the thread count to increase and ending at some point in the "CGI error", which usually happens when you exceed your quota in any resource.
I already identified the exceeded resource is thread count thanks to this Metrics option, which gives you a graphical representation on how it is being consumed (and released when an app restart happens)
I would like to have some details on this, not the grouped information but the actual information that is giving this graph, any lead would help me to understand which place is creating and not releasing threads, a namespace, a class name, anything.
Is there another place where I could get this information in a very detailed way? AppInsight queries seems to lack this metric.
Thanks in advance.
AFAIK there is no direct way to do this. The only way that I can see is by adding custom logging inside your application and sending the logs to a Log Analytics Workspace.
Inside your function app in the portal go to 'Diagnostic settings' and connect to your log analytics workspace (if it doesn't exist create one).
Inside the log analytics workspace you will find your custom logs either under a 'Custom Logs' tab or under 'Application Insights' tab, after this find the correct field and parse, something like:
customMetrics
| extend d=parse_json(customDimensions)
| extend processSessionId=d.processSessionId
For Azure related topics there is also a decent Q&A platform here:
https://learn.microsoft.com/en-us/answers/products/azure?product=all
For KSQL this is a handy page:
https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/tutorial?pivots=azuremonitor
Hope this helps somewhat

How can I connect a community connector (apps script) to a GA4 property so that it functions like it did with Advanced services and UA?

I am currently trying to connect a community connector (apps script) to GA4 in order to retrieve data and modify it before sending it to data studio. I have done this for Universal Analytics properties easily with advanced services; However, Since the Advanced services Analytics option does not work for GA4 properties I have been looking into retrieving data from analytics using fetchUrl. I am wondering if this is the best/only way to connect to GA4?
I have received input for my current code (basic fetchUrl code) which suggested that I would need to access the cloud api for authentication. Now I am wondering if I actually have to do these extra steps to connect to a google source from app script? The reason why I am unsure is because supermetrics has a GA4 connector which does not require any extra steps and of course connects to a GA4 property with a simple authentication method. I would like to essentially create that same connection in app script. Any advice would also be appreciated.
Also I would love to hear if there is any information on when we can expect advanced services to work for GA4.
Currently you will need to use the new Google Analytics Data API (GA4), however in this moment it is an early preview version of the API and is subject to change.
I don't know what the supermetrics plugin does specifically, however i recommend to link the automatic export of GA4 data in BigQuery and connect to it.
Google has not released any deadline for the release of this advanced service. I believe that before this it will have to make this whole new system stable since every week it undergoes updates and adjustments.

Analytics data does not shows up in Firebase console

My problem is about the analytics feature of Firebase. I set up my project with the help of react-native-firebase.
If I call: firebase.analytics(); which is provided by react-native-firebase no analytics data shows up in my Firebase console.
Why is that happening?
Info:
- I set up all as described in the official docs
It takes a few hours. In my case, it takes like 4 hours or something like that.
If you want to check out other features or check if Firebase is working for your app, you can force a crash, and see it in the Crash panel, cause this works almost real time.
Or you can send a notification to all users, this should work too, and it is faster than waiting for 4h or more to see if it is working really.

Stackdriver Error Reporting - Custom Data - NET Core

Currently trying to use Stackdriver Error Reporting with .NET Core 2.1, works great, but now, I had like to append custom label/field/data to a request.
Using the official lib Google.Cloud.Diagnostics.AspNetCore, how can I do that?
At the moment, the method the api is calling does not have room for custom labels. Please log a feature request here. And for the benefit of the community, you can also update the link here for tracking purposes.

BigQuery API [HELP]

My spreadsheet was working normally, but this error started to appear. My account is business, so I did not activate the charge.
I've done some spreadsheets and none of them needed it.
Can someone help me?
This error
The error message states that you do not have a billing account attached to this project and therefore you will not be able to perform querying in BigQuery of your own data until you attach a billing account. If you are saying that everything works from the UI of the Google Cloud Platform Console, you are probably using a different project there.