How to use TAGs efficiently with Datasentinel

post-thumb

Datasentinel uses the very popular timeseries database InfluxDB as storage space for activity metrics for PostgreSQL instances.
One of the features offered by InfluxDB is to be able to associate tags with measurements, in other words, to index the metrics on certain criteria.

A tag is composed of a key and a value. (Ex application=crm)

Some tags are created automatically by Datasentinel for each PostgreSQL instance.

Tag Description
pg_instance Concatenation of the server name and the instance name
pg_version PostgreSQL version
server Server name
database Database name, if any



Define your own tags


For example, specify the application to which the instance belongs.
It can also be the environment, the provider, and so on…
There is no restriction to create TAGs according to your needs

Example of tag association with an instance registration on a Datasentinel agent

{
    "name": "crm", 
    "host": "pg-crm-2031",
    "port": 9342,
    "user": "datasentinel",
    "password": "password",
    "tags": "application=crm,environment=production,provider=azure,datacenter=lyon"
}

The GUI simplexity allows you to navigate and use tags easily and efficiently.


Avoid any special character in the keys and their value except the underscore character

Sessions workload module


Sampling of active sessions (See Documentation) performed by Datasentinel (view pg_stat_activity) automatically adds tags relating to sessions

Tag Description
application_name Application name, if any
client_host_name Server name or IP address
command_type SQL command type
process_id Process identifier
query_md5_id Identifier (MD5 value calculated by Datasentinel) of the running sql
user_name User name
wait_event Wait event (Ios wait, Lock, …) or running on CPU
wait_event_type Event type (CPU, IOS, ..)

PostgreSQL top consumers per provider


Tags: but what for?


Once tags have been configured, it becomes very easy to filter a perimeter of instances by tag.
For example, to focus on a particular environment.

PostgreSQL how to use filters


It is also possible to extract different statistics by tag (or dimension) in order to have a global vision of the activity, and why not, use it for re-invoicing purposes.
This is what the Data analysis module offers.

Below, the example shows the top consumers grouped by a tag: the provider

PostgreSQL top consumers per provider


Consolidated workload


This involves grouping the workload of several instances according to a criteria, which allows a wide choice of analyzes.
For example:

  • List the Top queries of several instances of the same application.
  • See the overall activity for instances of a server
  • Analyse the consolidated workload of your primary and replicated read-only instances
  • And so on…

All this in just a few clicks, thanks to tags


PostgreSQL consolidated workload


But that’s not all


Datasentinel offers a management of users (See Documentation)
The Role based access feature allows you to create roles based on the value of one or more tags.

Associating a role with a user makes it possible to limit access to all or part of a scope of your PostgreSQL instances.

For example:

  • Create a user with access only to development environments.

Conclusion


Datasentinel is a PostgreSQL performance monitoring tool.
Using TAGs properly is essential to take advantage of Datasentinel.

Its unique features and the simplexity of its graphical interface allow a quick start to easily and precisely analyze the workload of your PostgreSQL instances.


Stay connected!