Creating Queries

Trusted Metrics data can be easily queried by accessing the W3bstream Metrics portal at and logging in with your GitHub account. In the following sections, we will guide you on how to create Trusted Metrics queries, which you can later use to create insightful dashboards. Moreover, these queries can be executed, and the results retrieved through an API endpoint, providing you with seamless integration and further data analysis options.

Accessing the Query Designer

To access the Trusted Metrics Query Designer, open and login with your GitHub account:

Once logged in, use the + button in the top-right corner of the page, and select New Query to access the Query Designer:

Query Designer Overview

The image below provides a quick overview of the main elements of the Query Designer that are relevant when you want to query the Trusted Metrics API.

The Queries List panel (1), located on the left side, displays a list of all queries that have already been created. You can select a query from this panel at any time to edit it.

The Query Editor (2) is where you type your actual query, and in the bottom-right corner, you will find the Run Button to test your query.

The Query Results (3) panel, located at the bottom, displays the results generated by your query after you run it.

Finally, the Save button (4), located in the top-right corner, lets you save your query once you are happy with the results.

Creating Queries

To create a Trusted Metrics query, which you can later access for your needs, follow the steps below:

  1. Type the following query in the Query Editor:

SELECT project, SUM(value) as total
FROM ws_metrics.publishers_metrics 
WHERE project='eth_0x2c37a2cbcfaccdd0625b4e3151d6260149ee866b_test'
GROUP BY project

The above query will return a single record as a result, providing the total number of devices registered for a certain project.

  1. Click the Run button to see the result in the Query Results panel

  2. Give a descriptive name to the query, like "Total Devices"

  3. Save the query and check that it's been added to the Queries List panel on the left side

Last updated