Firebase Realtime Database detailed usage - firebase

Where can I get Firebase Realtime Database detailed usage i.e. I want to get details about where data is being used? My database size is about 700kb and 10GB downloaded in 2 days, I am unable to figure it out, how did this happen. Currently, the usage tab just showing me the basic usage by day. Can I get more detailed usage information?

See the Firebase documentation on monitoring usage, which lists two main options:
The Usage in the Firebase console, which you already found.
StackDriver monitoring, which will you give you more granular usage data.
If neither of these allow you to determine where the usage is coming from, you have a few more options/things to consider:
Keep in mind that traffic for showing the database in the Firebase console is also charged. Especially early on in development this can be a major portion of the usage, as you won't have many users yet.
You can use the database profiler, which logs all the activity in your database over a given period of time.

Related

Error loading collections You have gone over your daily usage limits

My app is still in development and I uploaded about 35.6 MB of images to firebase storage.
suddenly the application stopped working and I cannot access the Firestore From the Firebase console. it shows the message
Error loading collections
You have gone over your daily usage limits
Is it possible that I have reached the limit and we are only 3 people currently using the application? Or is there an error in the firebase?
Will the problem be solved if I enabled payment in my account?
How much will I expect to pay monthly?
It is quite common to go over your free quota much earlier than you'd expect during development. During this phase developers usually keep the Firestore console open, and any data that the console reads is also charged. So you'll first want to check that, and see if you really need to keep the console open - or if you can see what you need in your app already, or with some dedicated queries.
Will the problem be solved if I enabled payment in my account?
If you've hit the free quota of your project, moving the project onto the paid/Blaze plan will remove/increase that quota.
How much will I expect to pay monthly?
Firestore pricing depends solely on your usage, so I recommend checking out the Firebase pricing page (and the calculator at the bottom)

Is there a Google API answering about Firestore database either Metrics or Health Checks or Current Active Connectios or Exceptions or Performance

Context: I am total Google Cloud begginer and I have just convinced my company headers to use Firestore Realtime Database for pushing transaction status to our mobile application. We have around 4 millions users that will use significantly our application for small money transfers. Now-a-days we use the concept of polling from Android/IOS to our Microservice endpoints and it will replaced by Firebase SDK imported to our Mobile app which will listen/observe to our Firestore Collection following few Firestore Rules. Since all money transfer will be confirmed/denied in short time (from few seconds to 1 or 2 minutes) the idea of replacing polling by a real reactive approach straigh from Firestore sounded and is already ongoing coding.
The issue: Firstly I don't what to compare solutions. It is just my reality: the prodution support operators must look after our internal Dashboard. Isn't allowed to them look at Google Dashboard Console (please accept this for this question). I need get on demand metrics of our FIrestore. It is nothing to do with Google pricing. It is just our demand: they want to see metrics like:
how many users listening at the same time now
how many users took some exception during connection
is there any user holding connection for more than X minute
when was the connection pick this morning
any exception of any type surrounding our Firestore database
I read Code Samples carefully follow the sample step-by-step trying to figure out some idea if there is some API providing the answers I am looking for.
So, my straight question is: is there such type of Google API providing metrics about my Firestore Database? Maybe following the same idea we found in Performance Monitor which works on Mobile side also some similar aproach on Firestore side.
*** Edited
Future readers may find worth read also about a way to get Firestore metrics info striagh from curl/postman
A couple of things: You mentioned both Firestore and Realtime Database; just wanted to make sure that you are aware that those are two different databases offered under the Firebase umbrella.
how many users listening at the same time now
is there any user holding connection for more than X minute
Yes, there's a dashboard: https://support.google.com/firebase/answer/6317517?hl=en. Including lots of options, like users active in the last 30 mins.
how many users took some exception during connection
any exception of any type surrounding our Firestore database
Yes, you can track errors and other logging via Stack Driver logging. These can give you reports on your cloud functions.
https://cloud.google.com/functions/docs/monitoring
Where can I find Stackdriver in Firebase console?
when was the connection pick this morning
For this one, I'm not sure if you mean A. when did somebody log on in the morning, or B. what was the time that there was the peak \ most usage. If B see 1. If A,
Real-time database has the concept of presence, which lets you know if a user is currently logged in or not. See examples here from the official documentation:
https://firebase.google.com/docs/firestore/solutions/presence
and this post
How to make user presence mechanism using Firebase?
Also applies to your
is there any user holding connection for more than X minute
..............
Edit in response to comments: I believe you are experiencing the XY problem https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem where you are focused on a particular solution, even though your problem has other solutions. User metrics, database events, and errors are all accessible through both dashboards and cloud functions. You can cURL cloud functions if you wish, or set up cron functions to auto report, or set up database trigger functions to log errors. So, while the exact way you want this to work may not exist, you just need to connect existing tools to get the result you want.

How fast can i reach 1GB in firebase realtime database

I am using firebase database and my question is, for example how fast can I reach 1GB if i have 100 users each storing worth 10 document pages of microsoft word full of text everyday, for one month?
Word documents would be stored in Firebase Storage, not the realtime database. Realistically, the only way you will be billed anything for using the Firebase platform is if your app gets a significant of usage. I suspect that 99% of firebase apps do not generate any billing whatsoever. ...that's just a hunch.
If you do run into billing issues, that will/would be a good thing.
Although this question is too broad since it lacks various variables like the number of users, size of the files and how this data is presented in the app I will try to give my $0.02 on this in a very generic way which can also be interpreted as how not to end up with a huge bill while using firebase,
Even though Firebase provides a sufficient space to test out the app in production there is a lot of ways in which things can go bad real quick like,
1) since firebase automatically handles the sync this additional read/write call comes out of your quota apart from the call you trigger check-out how one app developers found this out the hard way
2) if you have bad DB schema/design that you have not addressed, then you end up making multiple calls to the server to fetch the data which again bloats up the number of calls you make read about this here
3) Not setting spending limits and alerts, this should be a mandatory step to avoid a lot of the above problems even though the docs clearly gives an indication on how to set this up
These are some of the cases that I have come across I hope this serves as a guideline to set up your app

Firebase storage states full after deleting all files

Like many other people out there, I am using Firebase for my project. In the past few days I have used Firebase quite a lot for sending media files between users. Now, I am also on the free plan, as I am still testing Firebase.
All of a sudden, Firebase has stopped responding, mentioning that
"You have exceeded your quota for this project. Please upgrade your plan.
LEARN MORE"
I know that Firebase has a limit on the amount of data I can transfer per day and store, that's no problem. My problem is that even after a full day, and having everything in storage deleted, I still get the same error.
Truth is, this error only shows up for the storage section. But, as you can see in the picture, my storage is now empty. Therefore my question is how can I reset firebase, or there's no other way around other than paying?
Since I am not able to see any files, I am also suspecting that I have not deleted them all, or them correctly? Could this be what's going on?
The more interesting part is the when clicking on "LEARN MORE", I am prompted to the following page, which is even more misleading.
Update: After looking at my quota details I found out that my Cloud Storage Network is full:
Looking at the Pricing for Storage on the Spark Plan it says that you can store up to 5Gb of data. Now this plan is based on Cloud Platform's Always Free and their documentation says "5Gb-months". I'm not sure of what that means, but I'm assuming that you have already exceeded your 5Gb for this month (even though you deleted the files afterwards). Maybe your quota will actually have some kind of "refresh" next month so you'll probably only be able to use Firebase storage again by that time.

Firebase debugging tools

Is there any way to debug firebase instance like number of reads / writes / live connections etc.
We have hit the firebase outage many times and it is only firebase support tell us about these metrics.
Are there tools available which if I run on instance let me know all above information ?
Thanks
You can use the Firebase Profiler tool to get an idea of your bandwidth consumption but as stated by the doc, it's not a tool to estimate your billing. Many other factors affect your billing, such as protocol overhead, ssh overhead etc. You can read more on the Understand Realtime Database Billing here.
The Firebase profiler can however helps you to see potential issues with your database, and potential heavy listeners that sync too many data. Keep in mind that every time you write a on listener, firebase will download all the initial data at this node, each time, thus increasing bandwidth usage.

Resources