Database Usage & Insights

This guide explains how to use the Overview, Insights, and Users pages available on every database detail page in the AppsCode console. These pages give you a live view of your database's connection details, performance metrics, query analytics, and access control bindings.


1. Getting Started

From the Datastore section in the left sidebar, click on any database engine (e.g., MongoDB) and then click on a database instance name to open its detail page. The top of the page shows three main tabs:

  • Overview — Connection details and a high-level insights summary.
  • Insights — Detailed metrics, Grafana dashboards, slow queries, and top collections.
  • Users — Root user credentials, AppBindings, and KubeVault-managed access.

2. Overview

The Overview tab is the landing page for any database instance. It is divided into two panels — Connection Details and Insights — and a Nodes table at the bottom.

Database Overview page showing Connection Details, Insights summary panel, and Nodes table

2.1 - Connection Details

The Connection Details panel provides everything needed to connect to the database:

  • Basic tab — Shows the primary connection string and quick-copy flags for connecting with the CLI or client libraries.
  • Connection Parameters tab — Breaks down individual connection parameters (host, port, username, database name) so you can assemble a custom connection string.

Note: After clicking the link, please wait a few moments for it to process. You may need to refresh the page to see the updated data.

2.2 - Insights Summary

The Insights panel on the right gives a live snapshot of key database statistics:

MetricDescription
Current ConnectionsNumber of active client connections at this moment
Total ConnectionsCumulative connections since the database started
Available ConnectionsRemaining connections before the limit is reached
Active ConnectionsConnections currently executing an operation
Total IndexesTotal number of indexes across all collections
Index SizeTotal disk space used by all indexes
Total CollectionsTotal number of collections in the database
Data SizeTotal size of all documents stored
Replicas Per ShardsNumber of replicas in each shard
Number Of ShardsTotal number of shards in the cluster
Number Of ChunksTotal number of chunks across all shards
Chunks BalancedWhether chunks are evenly distributed across shards

2.3 - Nodes

The Nodes table at the bottom lists every pod in the database cluster with its role, CPU and memory usage, storage, status, age, and links to its dashboard and connect shell.


3. Insights

The Insights tab provides a deeper view into database performance — including Grafana dashboards, slow query analysis, and collection-level storage metrics.

Insights tab showing stat summary, Grafana Dashboards section, Slow Queries table, and Top Collections table

3.1 - Insights Summary Row

A condensed stat row at the top mirrors the key metrics from the Overview panel for quick reference without switching tabs.

3.2 - Grafana Dashboards

The Grafana Dashboards section embeds pre-built dashboards for your database directly in the console. If Grafana integration is not yet configured, an error message will indicate that the dashboard link is missing and provide instructions to set it up.

Tip: To enable Grafana dashboards, ensure the Grafana datasource is configured in your cluster and the correct dashboard URL is registered in your AppsCode settings.

3.3 - Slow Queries

The Slow Queries table lists database operations that exceeded a performance threshold. Each row contains:

ColumnDescription
OperationThe type of database operation (e.g., find, update)
Database NameThe database where the slow query ran
Collection NameThe collection targeted by the query
CommandThe raw command document
CountHow many times this query pattern was recorded
Avg Execution Time (ms)Average time the query took to execute
Min Execution Time (ms)Fastest recorded execution for this query pattern
Max Execution Time (ms)Slowest recorded execution for this query pattern

Use the pagination controls at the bottom-right to navigate through results.

3.4 - Top Collections

The Top Collections table lists collections ranked by total storage size, helping you identify which collections consume the most disk space.

ColumnDescription
NameThe fully qualified collection name (e.g., health.check)
Total SizeCombined size of documents and indexes in the collection

4. Users

The Users tab shows all access credentials, bindings, and KubeVault-managed secrets associated with the database instance.

Users tab showing Root User, AppBinding, VaultServers, and SecretEngines sections

4.1 - Root User

The Root User section lists the primary database credentials created by KubeDB. Each entry shows:

ColumnDescription
NameThe Kubernetes Secret name holding the credentials
NamespaceThe namespace where the Secret resides
AnnotationsKey annotations applied to the Secret (e.g., managed-by, instance)
TypeThe Secret type (e.g., kubernetes.io/basic-auth)
DateCreation date of the Secret
AgeAge of the Secret

4.2 - AppBinding

The AppBinding section lists AppBinding resources that expose this database to other applications in the cluster. Each entry shows:

ColumnDescription
NameThe AppBinding resource name
NamespaceThe namespace where the AppBinding resides
TypeThe AppBinding type (e.g., kubedb.com/mongodb)
VersionThe database engine version
GenresThe genre classification of the binding
SecretThe Secret referenced by this AppBinding for credentials
AgeAge of the AppBinding resource

4.3 - VaultServers, SecretEngines, MongoDBRoles & SecretAccessRequests

The lower sections of the Users tab are powered by KubeVault and provide dynamic secret management for your database.

Users tab lower sections showing VaultServers, SecretEngines, MongoDBRoles, and SecretAccessRequests — all requiring kubevault to be enabled

SectionDescription
VaultServersLists Vault server instances managing secrets for this database
SecretEnginesLists configured secret engines that generate dynamic database credentials
MongoDBRolesLists KubeVault roles that define credential policies for this database
SecretAccessRequestsLists requests made by applications for dynamic credentials

Note: These sections require the kubevault feature to be enabled in your cluster. If not yet enabled, each section will show a prompt with a link to enable the feature.


Quick Reference

ActionWhere to find it
Get the database connection stringOverviewConnection Details → Basic tab
View live connection and storage statsOverviewInsights panel
Check pod-level resource usageOverviewNodes table
View Grafana performance dashboardsInsightsGrafana Dashboards
Identify slow queriesInsightsSlow Queries table
Find largest collectionsInsightsTop Collections table
Access root credentialsUsersRoot User
View AppBindings for this databaseUsersAppBinding
Manage dynamic secrets via KubeVaultUsers → VaultServers / SecretEngines / MongoDBRoles / SecretAccessRequests