How to Configure Grafana to Access a Non-Default Firestore Database in the Same Project?

Hello,
I am a first-time user of Grafana and am currently trying to connect it with Google Firestore.

I successfully connected to Firestore by providing the project ID and key. However, my Firestore project contains a default database and an additional database. I want to configure Grafana to access the additional database instead of the default one, but I am unsure how to do so.

In Python, I was able to achieve this using the following code, but I don’t know how to replicate this setup in Grafana. Could you please assist me?

Here is the code I used in Python:

python

# Firebase connection
import os
import firebase_admin.firestore
import firebase_admin
from firebase_admin import credentials, firestore
from datetime import datetime
import string
import random
import pytz

# Firebase initialization
CREDENTIAL_PATH = 'firebase-adminsdk.json'
cred = credentials.Certificate(CREDENTIAL_PATH)
firebase_app = firebase_admin.initialize_app(cred)

db = firestore.client(app=firebase_app)

# Set the database to 'loop-2' instead of the default
db._database = 'loop-2'

The critical part here is this line:

python

db._database = 'loop-2'

This is how I accessed the other database within the same project in Python. Could you guide me on how to configure Grafana to connect to a non-default database in Firestore?

Looking forward to your reply.

welcome to forum @gathers2001

can you do the following?

select * from "loop-2"

I have downloaded Grafana locally and integrated it with Firestore to connect to the database. The code above specifies a separate database within the same project by explicitly selecting a different database. However, when connecting Grafana locally, it can only connect to the default database of the project and cannot select a specific database.

Is there a way to choose a specific database when connecting to a Firestore project locally?


like this… i can’t find select specific DB in picture…

i can write project id and service account
but i can choose specific DB…

might want to ask the developer as there is nothing in that datasource ui to specify a static database