Create a telemetry destination
curl --request POST \
--url https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endpoint": "<string>",
"protocol": "http/protobuf",
"isScopedToIntentionalRequestsOnly": false,
"headers": []
}
'import requests
url = "https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations"
payload = {
"endpoint": "<string>",
"protocol": "http/protobuf",
"isScopedToIntentionalRequestsOnly": False,
"headers": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endpoint: '<string>',
protocol: 'http/protobuf',
isScopedToIntentionalRequestsOnly: false,
headers: []
})
};
fetch('https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations', 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://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations",
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([
'endpoint' => '<string>',
'protocol' => 'http/protobuf',
'isScopedToIntentionalRequestsOnly' => false,
'headers' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations"
payload := strings.NewReader("{\n \"endpoint\": \"<string>\",\n \"protocol\": \"http/protobuf\",\n \"isScopedToIntentionalRequestsOnly\": false,\n \"headers\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"<string>\",\n \"protocol\": \"http/protobuf\",\n \"isScopedToIntentionalRequestsOnly\": false,\n \"headers\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endpoint\": \"<string>\",\n \"protocol\": \"http/protobuf\",\n \"isScopedToIntentionalRequestsOnly\": false,\n \"headers\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"signal": "logs",
"endpoint": "<string>",
"protocol": "http/protobuf",
"headers": [
{
"id": "<string>",
"name": "<string>",
"value": null,
"isSecret": true
}
],
"status": "active",
"lastFailureReason": "credentials",
"isScopedToIntentionalRequestsOnly": true
}{
"defined": true,
"code": "BAD_REQUEST",
"status": 400,
"message": "Bad Request",
"data": "<unknown>"
}{
"defined": true,
"code": "FORBIDDEN",
"status": 403,
"message": "Forbidden",
"data": "<unknown>"
}{
"defined": true,
"code": "NOT_FOUND",
"status": 404,
"message": "Not Found",
"data": "<unknown>"
}{
"defined": true,
"code": "INTERNAL_SERVER_ERROR",
"status": 500,
"message": "Internal Server Error",
"data": "<unknown>"
}telemetry
Create a telemetry destination
Verify and save an OTLP destination for logs, metrics, or traces.
POST
/
v1
/
environments
/
{environmentId}
/
telemetry-destinations
Create a telemetry destination
curl --request POST \
--url https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endpoint": "<string>",
"protocol": "http/protobuf",
"isScopedToIntentionalRequestsOnly": false,
"headers": []
}
'import requests
url = "https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations"
payload = {
"endpoint": "<string>",
"protocol": "http/protobuf",
"isScopedToIntentionalRequestsOnly": False,
"headers": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endpoint: '<string>',
protocol: 'http/protobuf',
isScopedToIntentionalRequestsOnly: false,
headers: []
})
};
fetch('https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations', 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://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations",
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([
'endpoint' => '<string>',
'protocol' => 'http/protobuf',
'isScopedToIntentionalRequestsOnly' => false,
'headers' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations"
payload := strings.NewReader("{\n \"endpoint\": \"<string>\",\n \"protocol\": \"http/protobuf\",\n \"isScopedToIntentionalRequestsOnly\": false,\n \"headers\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"<string>\",\n \"protocol\": \"http/protobuf\",\n \"isScopedToIntentionalRequestsOnly\": false,\n \"headers\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alpic.ai/v1/environments/{environmentId}/telemetry-destinations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endpoint\": \"<string>\",\n \"protocol\": \"http/protobuf\",\n \"isScopedToIntentionalRequestsOnly\": false,\n \"headers\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"signal": "logs",
"endpoint": "<string>",
"protocol": "http/protobuf",
"headers": [
{
"id": "<string>",
"name": "<string>",
"value": null,
"isSecret": true
}
],
"status": "active",
"lastFailureReason": "credentials",
"isScopedToIntentionalRequestsOnly": true
}{
"defined": true,
"code": "BAD_REQUEST",
"status": 400,
"message": "Bad Request",
"data": "<unknown>"
}{
"defined": true,
"code": "FORBIDDEN",
"status": 403,
"message": "Forbidden",
"data": "<unknown>"
}{
"defined": true,
"code": "NOT_FOUND",
"status": 404,
"message": "Not Found",
"data": "<unknown>"
}{
"defined": true,
"code": "INTERNAL_SERVER_ERROR",
"status": 500,
"message": "Internal Server Error",
"data": "<unknown>"
}Authorizations
Bearer token for authentication. Use an API key from the API Keys page in team settings, or an OAuth access token.
Path Parameters
The ID of the environment
Body
application/json
Available options:
logs, metrics, traces Required string length:
1 - 2048Available options:
http/protobuf, http/json Show child attributes
Show child attributes
Response
The telemetry destination has been created
Available options:
logs, metrics, traces Required string length:
1 - 2048Available options:
http/protobuf, http/json - Option 1
- Option 2
Show child attributes
Show child attributes
Available options:
active, suspended Available options:
credentials, wrong-path, wrong-protocol, invalid-payload, partial-rejection, blocked-target, timeout, unreachable, receiver-error, unexpected-status Was this page helpful?