This Org Metrics Exporter template uses Tinybird's Service Data Sources to aggregate and publish organizational metrics as endpoints in Prometheus format for quick integration with common monitoring tools.
# select or create a new workspace
tb login
# deploy the template
tb --cloud deploy --template https://github.com/tinybirdco/tinybird-org-metrics-exporter/tree/main/tinybird
To scrape the Tinybird metrics endpoint, you can configure your prometheus.yml
file as follows:
scrape_configs:
- job_name: tinybird_org_metrics
scrape_interval: 15s # Adjust the scrape interval as needed
scheme: 'https'
static_configs:
- targets:
- 'api.tinybird.co' # Adjust this for your region if necessary
metrics_path: '/v0/pipes/organization_metrics.prometheus'
bearer_token: '<admin-user-token>' # From an Organization admin
api.tinybird.co
with your Tinybird host if the workspace is in a different region. See Regions and endpoints.user@domain
Token of an Organization admin to authenticate requests (find it in the Tinybird dashboard). But for production, the creation of a new token with less permissions is recommended, including these scopes: PIPES:READ:organization_metrics
ORG_DATASOURCES:READ
ORG_DATASOURCES:READ
is not available from UI, but you can create this new prometheus_org_access token using tokens API like this:POST https://api.tinybird.co/v0/tokens/?name=prometheus_org_access&description=optional&scope=PIPES:READ:organization_metrics&scope=ORG_DATASOURCES:READ
We've included a sample dashboard config for Grafana to help you get started, see the JSON file.
Add the following configuration to your OpenMetrics Datadog agent conf.yaml
file:
instances:
- prometheus_url: 'https://api.tinybird.co/v0/pipes/organization_metrics.prometheus?token=<admin-user-token>'
namespace: tinybird_org_metrics
metrics:
- "*"
max_returned_metrics: 700000
api.tinybird.co
with your Tinybird host if the workspace is in a different region. See Regions and endpoints.admin user@domain Token
of an Organization admin to authenticate requests. Find it in the Tinybird dashboard.We've included a sample dashboard config for Datadog that you can use to get started, see the JSON file.