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.