Quickstart

This guide will help you set up and start using the Unblind API. We’ll show you how to get started with common clients, make your first request, and find the resources you need to go further.

1. Integrating Open Telemetry

The first step is to point your OTEL collector to Unblind, and embed the API key. You can use either the http/protobuf or grpc endpoint:

Example using Opentelemetry stack
import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-proto";

const metricsExporter = new OTLPMetricExporter({
  url: "https://otlp.unblind.dev",
  headers: {
    "Content-Type": "application/x-protobuf",
    "Authorization: Bearer": "<API_KEY>",
  },
});

2. Identifying your tenants

For every piece of telemetry data sent to Unblind, you must identify the tenant that owns the telemetry data by adding a tenant.id attribute at the resource or attribute level depending your case. If both are defined, resource identifier will prevail. This enables Unblind to track and segment tenant data.

Example using Opentelemetry stack
import { resourceFromAttributes } from "@opentelemetry/resources";

const resource = resourceFromAttributes({
  [ATTR_SERVICE_NAME]: "<SERVICE_NAME>",
  "tenant.id": "<TENANT_ID>",
});

3. Listing tenants

Below, you can see how to send a GET request to the Tenants endpoint to get a list of all your metrics. By default, results are limited to 100 tenants per request.

GET
/v1/tenants
curl https://api.unblind.dev/v1/tenants \
  -H "Authorization: Bearer <API_KEY>"

4. Querying a tenant

Below, you can see how to send a POST request to the Tenants endpoint to query a tenant's data.

POST
/v1/tenants/<TENANT_ID>
curl -X POST "https://api.unblind.dev/v1/tenants/<TENANT_ID>/timeseries" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": [{ "metrics": [ "<METRIC_NAME>" ] }],
    "startTime": 1763724823
  }'

What's next?

Great, you're now set up and have made your first request to the API. Here are a few links that might be handy as you venture further into the Unblind API:

Was this page helpful?