curl --request POST \
--url https://gateway-api.unomiq.com/v1/traces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"resourceSpans": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "my-service"
}
},
{
"key": "service.version",
"value": {
"stringValue": "1.0.0"
}
}
]
},
"scopeSpans": [
{
"scope": {
"name": "my-instrumentation-library",
"version": "1.0.0"
},
"spans": [
{
"traceId": "5B8EFFF798038103D269B633813FC60C",
"spanId": "EEE19B7EC3C1B174",
"parentSpanId": "EEE19B7EC3C1B173",
"name": "GET /api/users",
"kind": 2,
"startTimeUnixNano": "1544712660000000000",
"endTimeUnixNano": "1544712661000000000",
"attributes": [
{
"key": "http.method",
"value": {
"stringValue": "GET"
}
},
{
"key": "http.url",
"value": {
"stringValue": "https://api.example.com/users"
}
},
{
"key": "http.status_code",
"value": {
"intValue": 200
}
}
],
"status": {
"code": 0
}
}
]
}
]
}
]
}
'import requests
url = "https://gateway-api.unomiq.com/v1/traces"
payload = { "resourceSpans": [
{
"resource": { "attributes": [
{
"key": "service.name",
"value": { "stringValue": "my-service" }
},
{
"key": "service.version",
"value": { "stringValue": "1.0.0" }
}
] },
"scopeSpans": [
{
"scope": {
"name": "my-instrumentation-library",
"version": "1.0.0"
},
"spans": [
{
"traceId": "5B8EFFF798038103D269B633813FC60C",
"spanId": "EEE19B7EC3C1B174",
"parentSpanId": "EEE19B7EC3C1B173",
"name": "GET /api/users",
"kind": 2,
"startTimeUnixNano": "1544712660000000000",
"endTimeUnixNano": "1544712661000000000",
"attributes": [
{
"key": "http.method",
"value": { "stringValue": "GET" }
},
{
"key": "http.url",
"value": { "stringValue": "https://api.example.com/users" }
},
{
"key": "http.status_code",
"value": { "intValue": 200 }
}
],
"status": { "code": 0 }
}
]
}
]
}
] }
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
resourceSpans: [
{
resource: {
attributes: [
{key: 'service.name', value: {stringValue: 'my-service'}},
{key: 'service.version', value: {stringValue: '1.0.0'}}
]
},
scopeSpans: [
{
scope: {name: 'my-instrumentation-library', version: '1.0.0'},
spans: [
{
traceId: '5B8EFFF798038103D269B633813FC60C',
spanId: 'EEE19B7EC3C1B174',
parentSpanId: 'EEE19B7EC3C1B173',
name: 'GET /api/users',
kind: 2,
startTimeUnixNano: '1544712660000000000',
endTimeUnixNano: '1544712661000000000',
attributes: [
{key: 'http.method', value: {stringValue: 'GET'}},
{key: 'http.url', value: {stringValue: 'https://api.example.com/users'}},
{key: 'http.status_code', value: {intValue: 200}}
],
status: {code: 0}
}
]
}
]
}
]
})
};
fetch('https://gateway-api.unomiq.com/v1/traces', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway-api.unomiq.com/v1/traces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resourceSpans' => [
[
'resource' => [
'attributes' => [
[
'key' => 'service.name',
'value' => [
'stringValue' => 'my-service'
]
],
[
'key' => 'service.version',
'value' => [
'stringValue' => '1.0.0'
]
]
]
],
'scopeSpans' => [
[
'scope' => [
'name' => 'my-instrumentation-library',
'version' => '1.0.0'
],
'spans' => [
[
'traceId' => '5B8EFFF798038103D269B633813FC60C',
'spanId' => 'EEE19B7EC3C1B174',
'parentSpanId' => 'EEE19B7EC3C1B173',
'name' => 'GET /api/users',
'kind' => 2,
'startTimeUnixNano' => '1544712660000000000',
'endTimeUnixNano' => '1544712661000000000',
'attributes' => [
[
'key' => 'http.method',
'value' => [
'stringValue' => 'GET'
]
],
[
'key' => 'http.url',
'value' => [
'stringValue' => 'https://api.example.com/users'
]
],
[
'key' => 'http.status_code',
'value' => [
'intValue' => 200
]
]
],
'status' => [
'code' => 0
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway-api.unomiq.com/v1/traces"
payload := strings.NewReader("{\n \"resourceSpans\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-service\"\n }\n },\n {\n \"key\": \"service.version\",\n \"value\": {\n \"stringValue\": \"1.0.0\"\n }\n }\n ]\n },\n \"scopeSpans\": [\n {\n \"scope\": {\n \"name\": \"my-instrumentation-library\",\n \"version\": \"1.0.0\"\n },\n \"spans\": [\n {\n \"traceId\": \"5B8EFFF798038103D269B633813FC60C\",\n \"spanId\": \"EEE19B7EC3C1B174\",\n \"parentSpanId\": \"EEE19B7EC3C1B173\",\n \"name\": \"GET /api/users\",\n \"kind\": 2,\n \"startTimeUnixNano\": \"1544712660000000000\",\n \"endTimeUnixNano\": \"1544712661000000000\",\n \"attributes\": [\n {\n \"key\": \"http.method\",\n \"value\": {\n \"stringValue\": \"GET\"\n }\n },\n {\n \"key\": \"http.url\",\n \"value\": {\n \"stringValue\": \"https://api.example.com/users\"\n }\n },\n {\n \"key\": \"http.status_code\",\n \"value\": {\n \"intValue\": 200\n }\n }\n ],\n \"status\": {\n \"code\": 0\n }\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway-api.unomiq.com/v1/traces")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"resourceSpans\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-service\"\n }\n },\n {\n \"key\": \"service.version\",\n \"value\": {\n \"stringValue\": \"1.0.0\"\n }\n }\n ]\n },\n \"scopeSpans\": [\n {\n \"scope\": {\n \"name\": \"my-instrumentation-library\",\n \"version\": \"1.0.0\"\n },\n \"spans\": [\n {\n \"traceId\": \"5B8EFFF798038103D269B633813FC60C\",\n \"spanId\": \"EEE19B7EC3C1B174\",\n \"parentSpanId\": \"EEE19B7EC3C1B173\",\n \"name\": \"GET /api/users\",\n \"kind\": 2,\n \"startTimeUnixNano\": \"1544712660000000000\",\n \"endTimeUnixNano\": \"1544712661000000000\",\n \"attributes\": [\n {\n \"key\": \"http.method\",\n \"value\": {\n \"stringValue\": \"GET\"\n }\n },\n {\n \"key\": \"http.url\",\n \"value\": {\n \"stringValue\": \"https://api.example.com/users\"\n }\n },\n {\n \"key\": \"http.status_code\",\n \"value\": {\n \"intValue\": 200\n }\n }\n ],\n \"status\": {\n \"code\": 0\n }\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.unomiq.com/v1/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"resourceSpans\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-service\"\n }\n },\n {\n \"key\": \"service.version\",\n \"value\": {\n \"stringValue\": \"1.0.0\"\n }\n }\n ]\n },\n \"scopeSpans\": [\n {\n \"scope\": {\n \"name\": \"my-instrumentation-library\",\n \"version\": \"1.0.0\"\n },\n \"spans\": [\n {\n \"traceId\": \"5B8EFFF798038103D269B633813FC60C\",\n \"spanId\": \"EEE19B7EC3C1B174\",\n \"parentSpanId\": \"EEE19B7EC3C1B173\",\n \"name\": \"GET /api/users\",\n \"kind\": 2,\n \"startTimeUnixNano\": \"1544712660000000000\",\n \"endTimeUnixNano\": \"1544712661000000000\",\n \"attributes\": [\n {\n \"key\": \"http.method\",\n \"value\": {\n \"stringValue\": \"GET\"\n }\n },\n {\n \"key\": \"http.url\",\n \"value\": {\n \"stringValue\": \"https://api.example.com/users\"\n }\n },\n {\n \"key\": \"http.status_code\",\n \"value\": {\n \"intValue\": 200\n }\n }\n ],\n \"status\": {\n \"code\": 0\n }\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"partialSuccess": {
"rejectedSpans": 0,
"errorMessage": ""
}
}Receive Traces
Submit trace data to the OpenTelemetry Collector using OTLP/HTTP protocol.
The request must include a valid OAuth2 bearer token in the Authorization header, obtained from the Unomiq OAuth API.
The collector processes traces through the following pipeline:
- Extract API key ID from JWT sub claim
- Extract app ID from JWT custom claim
- Filter out spans without app ID (silently dropped, no error returned)
Note: The endpoint always returns 200 OK if the request is valid, even if spans are filtered out due to missing app ID. Check partialSuccess in the response for details.
curl --request POST \
--url https://gateway-api.unomiq.com/v1/traces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"resourceSpans": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "my-service"
}
},
{
"key": "service.version",
"value": {
"stringValue": "1.0.0"
}
}
]
},
"scopeSpans": [
{
"scope": {
"name": "my-instrumentation-library",
"version": "1.0.0"
},
"spans": [
{
"traceId": "5B8EFFF798038103D269B633813FC60C",
"spanId": "EEE19B7EC3C1B174",
"parentSpanId": "EEE19B7EC3C1B173",
"name": "GET /api/users",
"kind": 2,
"startTimeUnixNano": "1544712660000000000",
"endTimeUnixNano": "1544712661000000000",
"attributes": [
{
"key": "http.method",
"value": {
"stringValue": "GET"
}
},
{
"key": "http.url",
"value": {
"stringValue": "https://api.example.com/users"
}
},
{
"key": "http.status_code",
"value": {
"intValue": 200
}
}
],
"status": {
"code": 0
}
}
]
}
]
}
]
}
'import requests
url = "https://gateway-api.unomiq.com/v1/traces"
payload = { "resourceSpans": [
{
"resource": { "attributes": [
{
"key": "service.name",
"value": { "stringValue": "my-service" }
},
{
"key": "service.version",
"value": { "stringValue": "1.0.0" }
}
] },
"scopeSpans": [
{
"scope": {
"name": "my-instrumentation-library",
"version": "1.0.0"
},
"spans": [
{
"traceId": "5B8EFFF798038103D269B633813FC60C",
"spanId": "EEE19B7EC3C1B174",
"parentSpanId": "EEE19B7EC3C1B173",
"name": "GET /api/users",
"kind": 2,
"startTimeUnixNano": "1544712660000000000",
"endTimeUnixNano": "1544712661000000000",
"attributes": [
{
"key": "http.method",
"value": { "stringValue": "GET" }
},
{
"key": "http.url",
"value": { "stringValue": "https://api.example.com/users" }
},
{
"key": "http.status_code",
"value": { "intValue": 200 }
}
],
"status": { "code": 0 }
}
]
}
]
}
] }
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
resourceSpans: [
{
resource: {
attributes: [
{key: 'service.name', value: {stringValue: 'my-service'}},
{key: 'service.version', value: {stringValue: '1.0.0'}}
]
},
scopeSpans: [
{
scope: {name: 'my-instrumentation-library', version: '1.0.0'},
spans: [
{
traceId: '5B8EFFF798038103D269B633813FC60C',
spanId: 'EEE19B7EC3C1B174',
parentSpanId: 'EEE19B7EC3C1B173',
name: 'GET /api/users',
kind: 2,
startTimeUnixNano: '1544712660000000000',
endTimeUnixNano: '1544712661000000000',
attributes: [
{key: 'http.method', value: {stringValue: 'GET'}},
{key: 'http.url', value: {stringValue: 'https://api.example.com/users'}},
{key: 'http.status_code', value: {intValue: 200}}
],
status: {code: 0}
}
]
}
]
}
]
})
};
fetch('https://gateway-api.unomiq.com/v1/traces', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway-api.unomiq.com/v1/traces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resourceSpans' => [
[
'resource' => [
'attributes' => [
[
'key' => 'service.name',
'value' => [
'stringValue' => 'my-service'
]
],
[
'key' => 'service.version',
'value' => [
'stringValue' => '1.0.0'
]
]
]
],
'scopeSpans' => [
[
'scope' => [
'name' => 'my-instrumentation-library',
'version' => '1.0.0'
],
'spans' => [
[
'traceId' => '5B8EFFF798038103D269B633813FC60C',
'spanId' => 'EEE19B7EC3C1B174',
'parentSpanId' => 'EEE19B7EC3C1B173',
'name' => 'GET /api/users',
'kind' => 2,
'startTimeUnixNano' => '1544712660000000000',
'endTimeUnixNano' => '1544712661000000000',
'attributes' => [
[
'key' => 'http.method',
'value' => [
'stringValue' => 'GET'
]
],
[
'key' => 'http.url',
'value' => [
'stringValue' => 'https://api.example.com/users'
]
],
[
'key' => 'http.status_code',
'value' => [
'intValue' => 200
]
]
],
'status' => [
'code' => 0
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway-api.unomiq.com/v1/traces"
payload := strings.NewReader("{\n \"resourceSpans\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-service\"\n }\n },\n {\n \"key\": \"service.version\",\n \"value\": {\n \"stringValue\": \"1.0.0\"\n }\n }\n ]\n },\n \"scopeSpans\": [\n {\n \"scope\": {\n \"name\": \"my-instrumentation-library\",\n \"version\": \"1.0.0\"\n },\n \"spans\": [\n {\n \"traceId\": \"5B8EFFF798038103D269B633813FC60C\",\n \"spanId\": \"EEE19B7EC3C1B174\",\n \"parentSpanId\": \"EEE19B7EC3C1B173\",\n \"name\": \"GET /api/users\",\n \"kind\": 2,\n \"startTimeUnixNano\": \"1544712660000000000\",\n \"endTimeUnixNano\": \"1544712661000000000\",\n \"attributes\": [\n {\n \"key\": \"http.method\",\n \"value\": {\n \"stringValue\": \"GET\"\n }\n },\n {\n \"key\": \"http.url\",\n \"value\": {\n \"stringValue\": \"https://api.example.com/users\"\n }\n },\n {\n \"key\": \"http.status_code\",\n \"value\": {\n \"intValue\": 200\n }\n }\n ],\n \"status\": {\n \"code\": 0\n }\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway-api.unomiq.com/v1/traces")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"resourceSpans\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-service\"\n }\n },\n {\n \"key\": \"service.version\",\n \"value\": {\n \"stringValue\": \"1.0.0\"\n }\n }\n ]\n },\n \"scopeSpans\": [\n {\n \"scope\": {\n \"name\": \"my-instrumentation-library\",\n \"version\": \"1.0.0\"\n },\n \"spans\": [\n {\n \"traceId\": \"5B8EFFF798038103D269B633813FC60C\",\n \"spanId\": \"EEE19B7EC3C1B174\",\n \"parentSpanId\": \"EEE19B7EC3C1B173\",\n \"name\": \"GET /api/users\",\n \"kind\": 2,\n \"startTimeUnixNano\": \"1544712660000000000\",\n \"endTimeUnixNano\": \"1544712661000000000\",\n \"attributes\": [\n {\n \"key\": \"http.method\",\n \"value\": {\n \"stringValue\": \"GET\"\n }\n },\n {\n \"key\": \"http.url\",\n \"value\": {\n \"stringValue\": \"https://api.example.com/users\"\n }\n },\n {\n \"key\": \"http.status_code\",\n \"value\": {\n \"intValue\": 200\n }\n }\n ],\n \"status\": {\n \"code\": 0\n }\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway-api.unomiq.com/v1/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"resourceSpans\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-service\"\n }\n },\n {\n \"key\": \"service.version\",\n \"value\": {\n \"stringValue\": \"1.0.0\"\n }\n }\n ]\n },\n \"scopeSpans\": [\n {\n \"scope\": {\n \"name\": \"my-instrumentation-library\",\n \"version\": \"1.0.0\"\n },\n \"spans\": [\n {\n \"traceId\": \"5B8EFFF798038103D269B633813FC60C\",\n \"spanId\": \"EEE19B7EC3C1B174\",\n \"parentSpanId\": \"EEE19B7EC3C1B173\",\n \"name\": \"GET /api/users\",\n \"kind\": 2,\n \"startTimeUnixNano\": \"1544712660000000000\",\n \"endTimeUnixNano\": \"1544712661000000000\",\n \"attributes\": [\n {\n \"key\": \"http.method\",\n \"value\": {\n \"stringValue\": \"GET\"\n }\n },\n {\n \"key\": \"http.url\",\n \"value\": {\n \"stringValue\": \"https://api.example.com/users\"\n }\n },\n {\n \"key\": \"http.status_code\",\n \"value\": {\n \"intValue\": 200\n }\n }\n ],\n \"status\": {\n \"code\": 0\n }\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"partialSuccess": {
"rejectedSpans": 0,
"errorMessage": ""
}
}Authorizations
OAuth2/OIDC JWT token with required app ID and API key ID claims.
Headers
Content type of the request body
application/json Body
OTLP ExportTraceServiceRequest. The request body follows the standard OTLP/HTTP JSON format. See https://opentelemetry.io/docs/specs/otlp/#otlphttp-request for the full schema.
Array of ResourceSpans as defined by the OTLP specification
Response
Traces accepted successfully
OTLP ExportTraceServiceResponse. See https://opentelemetry.io/docs/specs/otlp/#otlphttp-response for the full schema.
Show child attributes
Show child attributes