curl --request POST \
--url https://sreagent.app/api/v1/config/service_bindings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"service": "<string>",
"account_id": "<string>",
"environment": "<string>",
"log_filter": "<string>",
"log_groups": [
"<string>"
],
"log_inline_fields": [
"<string>"
],
"metric_selectors": [
{
"dimensions": [
{
"name": "<string>",
"value": "<string>"
}
],
"metric_name": "<string>",
"namespace": "<string>"
}
],
"region": "<string>",
"trace_service_names": [
"<string>"
]
}
'import requests
url = "https://sreagent.app/api/v1/config/service_bindings"
payload = {
"service": "<string>",
"account_id": "<string>",
"environment": "<string>",
"log_filter": "<string>",
"log_groups": ["<string>"],
"log_inline_fields": ["<string>"],
"metric_selectors": [
{
"dimensions": [
{
"name": "<string>",
"value": "<string>"
}
],
"metric_name": "<string>",
"namespace": "<string>"
}
],
"region": "<string>",
"trace_service_names": ["<string>"]
}
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({
service: '<string>',
account_id: '<string>',
environment: '<string>',
log_filter: '<string>',
log_groups: ['<string>'],
log_inline_fields: ['<string>'],
metric_selectors: [
{
dimensions: [{name: '<string>', value: '<string>'}],
metric_name: '<string>',
namespace: '<string>'
}
],
region: '<string>',
trace_service_names: ['<string>']
})
};
fetch('https://sreagent.app/api/v1/config/service_bindings', 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://sreagent.app/api/v1/config/service_bindings",
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([
'service' => '<string>',
'account_id' => '<string>',
'environment' => '<string>',
'log_filter' => '<string>',
'log_groups' => [
'<string>'
],
'log_inline_fields' => [
'<string>'
],
'metric_selectors' => [
[
'dimensions' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'metric_name' => '<string>',
'namespace' => '<string>'
]
],
'region' => '<string>',
'trace_service_names' => [
'<string>'
]
]),
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://sreagent.app/api/v1/config/service_bindings"
payload := strings.NewReader("{\n \"service\": \"<string>\",\n \"account_id\": \"<string>\",\n \"environment\": \"<string>\",\n \"log_filter\": \"<string>\",\n \"log_groups\": [\n \"<string>\"\n ],\n \"log_inline_fields\": [\n \"<string>\"\n ],\n \"metric_selectors\": [\n {\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"metric_name\": \"<string>\",\n \"namespace\": \"<string>\"\n }\n ],\n \"region\": \"<string>\",\n \"trace_service_names\": [\n \"<string>\"\n ]\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://sreagent.app/api/v1/config/service_bindings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"service\": \"<string>\",\n \"account_id\": \"<string>\",\n \"environment\": \"<string>\",\n \"log_filter\": \"<string>\",\n \"log_groups\": [\n \"<string>\"\n ],\n \"log_inline_fields\": [\n \"<string>\"\n ],\n \"metric_selectors\": [\n {\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"metric_name\": \"<string>\",\n \"namespace\": \"<string>\"\n }\n ],\n \"region\": \"<string>\",\n \"trace_service_names\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/service_bindings")
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 \"service\": \"<string>\",\n \"account_id\": \"<string>\",\n \"environment\": \"<string>\",\n \"log_filter\": \"<string>\",\n \"log_groups\": [\n \"<string>\"\n ],\n \"log_inline_fields\": [\n \"<string>\"\n ],\n \"metric_selectors\": [\n {\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"metric_name\": \"<string>\",\n \"namespace\": \"<string>\"\n }\n ],\n \"region\": \"<string>\",\n \"trace_service_names\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Create a service binding
Correct what a service is called in one telemetry backend: the log groups, log filter, X-Ray service names and metric selectors the Explorer binds for service (and environment, default ""), overriding AWS discovery and the OpenTelemetry convention. An OMITTED column keeps its stored value (or stays unbound, for a fresh binding); log_groups, trace_service_names and metric_selectors each REPLACE the stored list when named, so an empty array deliberately overrides that column to nothing rather than leaving it alone. resolve_service_bindings shows the difference as origin “override” with an empty value, versus falling through to discovery or the convention. An empty log_filter clears it back to unbound (there is no way to bind an empty filter on purpose). account_id and region pin where the service lives, so logs and metrics search only there (traces always search every account); null clears either. log_inline_fields chooses the fields shown inline on a JSON log line of the service (the binding with no environment only); null clears it. Audited, and this organization’s discovery cache is invalidated so the next read reflects it immediately.
curl --request POST \
--url https://sreagent.app/api/v1/config/service_bindings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"service": "<string>",
"account_id": "<string>",
"environment": "<string>",
"log_filter": "<string>",
"log_groups": [
"<string>"
],
"log_inline_fields": [
"<string>"
],
"metric_selectors": [
{
"dimensions": [
{
"name": "<string>",
"value": "<string>"
}
],
"metric_name": "<string>",
"namespace": "<string>"
}
],
"region": "<string>",
"trace_service_names": [
"<string>"
]
}
'import requests
url = "https://sreagent.app/api/v1/config/service_bindings"
payload = {
"service": "<string>",
"account_id": "<string>",
"environment": "<string>",
"log_filter": "<string>",
"log_groups": ["<string>"],
"log_inline_fields": ["<string>"],
"metric_selectors": [
{
"dimensions": [
{
"name": "<string>",
"value": "<string>"
}
],
"metric_name": "<string>",
"namespace": "<string>"
}
],
"region": "<string>",
"trace_service_names": ["<string>"]
}
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({
service: '<string>',
account_id: '<string>',
environment: '<string>',
log_filter: '<string>',
log_groups: ['<string>'],
log_inline_fields: ['<string>'],
metric_selectors: [
{
dimensions: [{name: '<string>', value: '<string>'}],
metric_name: '<string>',
namespace: '<string>'
}
],
region: '<string>',
trace_service_names: ['<string>']
})
};
fetch('https://sreagent.app/api/v1/config/service_bindings', 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://sreagent.app/api/v1/config/service_bindings",
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([
'service' => '<string>',
'account_id' => '<string>',
'environment' => '<string>',
'log_filter' => '<string>',
'log_groups' => [
'<string>'
],
'log_inline_fields' => [
'<string>'
],
'metric_selectors' => [
[
'dimensions' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'metric_name' => '<string>',
'namespace' => '<string>'
]
],
'region' => '<string>',
'trace_service_names' => [
'<string>'
]
]),
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://sreagent.app/api/v1/config/service_bindings"
payload := strings.NewReader("{\n \"service\": \"<string>\",\n \"account_id\": \"<string>\",\n \"environment\": \"<string>\",\n \"log_filter\": \"<string>\",\n \"log_groups\": [\n \"<string>\"\n ],\n \"log_inline_fields\": [\n \"<string>\"\n ],\n \"metric_selectors\": [\n {\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"metric_name\": \"<string>\",\n \"namespace\": \"<string>\"\n }\n ],\n \"region\": \"<string>\",\n \"trace_service_names\": [\n \"<string>\"\n ]\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://sreagent.app/api/v1/config/service_bindings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"service\": \"<string>\",\n \"account_id\": \"<string>\",\n \"environment\": \"<string>\",\n \"log_filter\": \"<string>\",\n \"log_groups\": [\n \"<string>\"\n ],\n \"log_inline_fields\": [\n \"<string>\"\n ],\n \"metric_selectors\": [\n {\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"metric_name\": \"<string>\",\n \"namespace\": \"<string>\"\n }\n ],\n \"region\": \"<string>\",\n \"trace_service_names\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/service_bindings")
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 \"service\": \"<string>\",\n \"account_id\": \"<string>\",\n \"environment\": \"<string>\",\n \"log_filter\": \"<string>\",\n \"log_groups\": [\n \"<string>\"\n ],\n \"log_inline_fields\": [\n \"<string>\"\n ],\n \"metric_selectors\": [\n {\n \"dimensions\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"metric_name\": \"<string>\",\n \"namespace\": \"<string>\"\n }\n ],\n \"region\": \"<string>\",\n \"trace_service_names\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Authorizations
Body
Up to 3 JSON log field keys the live stream and the Explorer show inline on a line of this service, in order (a nested field by its dotted key, user.id). Set on the binding with no environment only: it applies to every environment. null or [] clears it back to the built-in choice (trace and request ids, then the first fields of the line).
3Response
Created.
Was this page helpful?