Skip to content

Create and manage destinations of Telemetry Router

Last updated on

For each instance of the Telemetry Router, you define destinations to which your data stream is forwarded. You can send the data stream to an OpenTelemetry-compatible endpoint or to an S3-compatible STACKIT Object Storage. For OpenTelemetry, either Basic or Token Auth can be used so that your Telemetry Router instance can authenticate itself to your destination. You define the actual target endpoint using a URI.

To execute the API commands in this guide, you must first export the following path parameters as environment variables in your terminal (or replace them directly in the commands):

  • $PROJECT_ID: Your unique STACKIT project ID (e.g., 16dbfb51...).
  • $REGION_ID: The region where your instance is located (e.g., eu01 or eu02).
  • $TELEMETRY_ROUTER_ID: The unique ID of your Telemetry Router instance.
  • $DESTINATION_ID: The specific identifier of a destination (required for View, Edit, and Delete operations).

To configure a destination, you need to provide a destination uri, a type and an authentication.

You add the destination configuration as JSON key called config to the appropriate requests. The following table represents the available keys within this object:

To configure an Open Telemetry destination, the openTelemetry object is mandatory. It consists of an URI and authentication parameters. For authentication, either basicAuth or bearerToken must be provided.

The Basic-Auth object consists of two keys:

{
"configType": "OpenTelemetry",
"openTelemetry":
{
"basicAuth": {
"username": "stackit-open-telemetry-client",
"password": "my-top-secret-password"
},
"uri": "https://my-opentelemetry-destination.on-prem-cloud.example.com"
},
"displayName": "My Open Telemetry destination"
}

To configure a S3 destination, the s3 object is mandatory. It consists of an endpoint-bucket-combination and authentication parameters. For authentication, an accessKey must be provided.

The access key object consists of two keys:

{
"configType": "S3",
"s3":
{
"accessKey": {
"id": "stackit-s3-client",
"secret": "my-secret"
},
"bucket": "my-bucket",
"endpoint": "https://my-s3-bucket.on-prem-cloud.example.com"
},
"displayName": "My S3 destination"
}

To create a Telemetry Router destination, you need to call the appropriate endpoint.

Choose the properties for your new destination

Section titled “Choose the properties for your new destination”
Terminal window
stackit curl -X POST \
"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/destinations" \
-H "Content-Type: application/json" \
--data '{
"displayName": "<DISPLAY_NAME>",
"description": "<DESCRIPTION>",
"config": <CONFIG_OBJECT>
}'

Example for an S3-compatible storage destination

Section titled “Example for an S3-compatible storage destination”
Terminal window
stackit curl -X POST \
"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/destinations" \
-H "Content-Type: application/json" \
--data '{
"displayName": "my-telemetry-destination",
"description": "My telemetry destination",
"config": {
"configType": "S3",
"s3": {
"accessKey": {
"id": "stackit-s3-client",
"secret": "my-secret"
},
"bucket": "my-bucket",
"endpoint": "https://my-s3-bucket.on-prem-cloud.example.com"
},
"displayName": "My S3 destination"
}
}'
Terminal window
stackit curl -X POST \
"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/destinations" \
-H "Content-Type: application/json" \
--data '{
"displayName": "my-telemetry-destination",
"description": "My telemetry destination",
"config": {
"configType": "OpenTelemetry",
"openTelemetry": {
"basicAuth": {
"username": "stackit-open-telemetry-client",
"password": "my-top-secret-password"
},
"uri": "https://my-opentelemetry-destination.on-prem-cloud.example.com"
},
"displayName": "My Open Telemetry destination"
}
}'
Terminal window
stackit curl -X GET \
"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/destinations" \
-H "Content-Type: application/json"
Terminal window
stackit curl -X GET \
"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/destinations" \
-H "Content-Type: application/json"
Terminal window
stackit curl -X GET \
"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/destinations/$DESTINATION_ID" \
-H "Content-Type: application/json"
Terminal window
stackit curl -X GET \
"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/destinations/60e59099-8209-4b69-a553-239fd79038a3" \
-H "Content-Type: application/json"
Terminal window
stackit curl -X PUT \
"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/destinations/$DESTINATION_ID" \
-H "Content-Type: application/json" \
--data '{
"displayName": "<DISPLAY_NAME>",
"description": "<DESCRIPTION>",
"config": <CONFIG_OBJECT>
}'

Example of editing a destination to an S3 compatible storage to an existing Telemetry Router instance

Section titled “Example of editing a destination to an S3 compatible storage to an existing Telemetry Router instance”
Terminal window
stackit curl -X PUT \
"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/destinations/60e59099-8209-4b69-a553-239fd79038a3" \
-H "Content-Type: application/json" \
--data '{
"config": {
"configType": "S3",
"s3": {
"accessKey": {
"id": "stackit-s3-client",
"secret": "my-secret"
},
"bucket": "my-bucket",
"endpoint": "https://my-s3-bucket.on-prem-cloud.example.com"
},
"displayName": "My S3 destination"
}
}'

Example of editing a destination to an OpenTelemetry storage to an existing Telemetry Router instance

Section titled “Example of editing a destination to an OpenTelemetry storage to an existing Telemetry Router instance”
Terminal window
stackit curl -X PUT \
"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/destinations/60e59099-8209-4b69-a553-239fd79038a3" \
-H "Content-Type: application/json" \
--data '{
"config": {
"configType": "OpenTelemetry",
"openTelemetry": {
"basicAuth": {
"username": "stackit-open-telemetry-client",
"password": "my-top-secret-password"
},
"uri": "https://my-opentelemetry-destination.on-prem-cloud.example.com"
},
"displayName": "My Open Telemetry destination"
}
}'

To delete a Telemetry Router destination, you need to call the DELETE endpoint.

Terminal window
stackit curl -X DELETE \
"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/destinations/$DESTINATION_ID" \
-H "Content-Type: application/json"

Example:

Terminal window
stackit curl -X DELETE \
"https://telemetry-router.api.stackit.cloud/v1/projects/16dbfb51-7a75-42d3-a51d-99f87f48cd32/regions/eu01/telemetry-routers/d5b5cdcc-c155-4d66-82ef-4289db8e4557/destinations/60e59099-8209-4b69-a553-239fd79038a3" \
-H "Content-Type: application/json"

The following shows a view real world use cases that can be modified and applied.

Logs can be matched with matchers based on the provided attributes.

Terminal window
stackit curl -X POST \
"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/destinations" \
-H "Content-Type: application/json" \
--data '{
"name": "secrets-manager-destination",
"description": "Forwards only logs originating from the secrets-manager service",
"type": "OTLP",
"config": {
"configType": "OpenTelemetry",
"filter": {
"attributes": [
{
"key": "service.name",
"level": "logRecord",
"matcher": "=",
"values": [
"secrets-manager"
]
}
]
},
"uri": "https://my-opentelemetry-destination.logs.eu01.onstackit.cloud/otlp/v1/logs",
"bearerToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6ImE1NTZmYWI0MWY2YzQ1MGY3ZDU5YzRmNGVkNWI0NmMxIn0.eyJub3RpY2UiOiJDb25ncmF0dWxhdGlvbnMhIFlvdSBoYXZlIGRlY29kZWQgYSBiZWFyZXIgdG9rZW4gbWVhbnQgZm9yIGRlbW9uc3RyYXRpb24gcHVycG9zZXMuIFdlIGF0IFNUQUNLSVQgZW1waGFzaXplIHNlY3VyaXR5IGFuZCBkYXRhIGludGVncml0eS4gUGxlYXNlIHVzZSB5b3VyIG93biBhY2Nlc3MgdG9rZW4gZm9yIHlvdXIgcmVzb3VyY2VzLiJ9.LPOHfT45JNOpTSh_q6x4pDRVK052QwUwSFU9tLPB6gGrYjf4dTKjWJ-2aRdd2LlWsxO5y0it89VsZpbzVRvI5Q"
}
}'

Logs can be filtered with matchers based on the provided attributes.

Terminal window
stackit curl -X POST \
"https://telemetry-router.api.stackit.cloud/v1/projects/$PROJECT_ID/regions/$REGION_ID/telemetry-routers/$TELEMETRY_ROUTER_ID/destinations" \
-H "Content-Type: application/json" \
--data '{
"name": "secrets-manager-destination",
"description": "Forwards only logs originating from the secrets-manager service",
"type": "OTLP",
"config": {
"configType": "OpenTelemetry",
"filter": {
"attributes": [
{
"key": "service.name",
"level": "logRecord",
"matcher": "!=",
"values": [
"secrets-manager"
]
}
]
},
"uri": "https://my-opentelemetry-destination.logs.eu01.onstackit.cloud/otlp/v1/logs",
"bearerToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6ImE1NTZmYWI0MWY2YzQ1MGY3ZDU5YzRmNGVkNWI0NmMxIn0.eyJub3RpY2UiOiJDb25ncmF0dWxhdGlvbnMhIFlvdSBoYXZlIGRlY29kZWQgYSBiZWFyZXIgdG9rZW4gbWVhbnQgZm9yIGRlbW9uc3RyYXRpb24gcHVycG9zZXMuIFdlIGF0IFNUQUNLSVQgZW1waGFzaXplIHNlY3VyaXR5IGFuZCBkYXRhIGludGVncml0eS4gUGxlYXNlIHVzZSB5b3VyIG93biBhY2Nlc3MgdG9rZW4gZm9yIHlvdXIgcmVzb3VyY2VzLiJ9.LPOHfT45JNOpTSh_q6x4pDRVK052QwUwSFU9tLPB6gGrYjf4dTKjWJ-2aRdd2LlWsxO5y0it89VsZpbzVRvI5Q"
}
}'