Get Samply Profile
Try it
GET
/v0/pipelines/{pipeline_name}/samply_profileRetrieve the last samply profile of a pipeline, regardless of whether profiling is currently in progress. If ?latest parameter is specified and Samply profile collection is in progress, returns HTTP 307 with Retry-After header.
Authentication
JSON web token (JWT) or API keyBearer token
Parameters
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
pipeline_name | string | Yes | Unique pipeline name |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
ordinal | integer | No | In a multihost pipeline, the ordinal of the pipeline to sample. |
latest | boolean | No | If true, returns 204 redirect with Retry-After header if profile collection is in progress. If false or not provided, returns the last collected profile. |
Response
200Samply profile as a gzip containing the profile that can be inspected by the samply tool. Note: may return 204 No Content with Retry-After header if latest=true and profiling is in progress.
application/gzip- string (binary)
400No samply profile exists for the pipeline, create one by calling `POST /pipelines/{pipeline_name}/samply_profile?duration_secs=30`
application/json- objectInformation returned by REST API endpoints on error.
detailsobjectrequiredDetailed error metadata. The contents of this field is determined by `error_code`.error_codestringrequiredError code is a string that specifies this error type.messagestringrequiredHuman-readable error message.
404Pipeline with that name does not exist
application/json- objectInformation returned by REST API endpoints on error.
detailsobjectrequiredDetailed error metadata. The contents of this field is determined by `error_code`.error_codestringrequiredError code is a string that specifies this error type.messagestringrequiredHuman-readable error message.
500
application/json- objectInformation returned by REST API endpoints on error.
detailsobjectrequiredDetailed error metadata. The contents of this field is determined by `error_code`.error_codestringrequiredError code is a string that specifies this error type.messagestringrequiredHuman-readable error message.
503
application/json- objectInformation returned by REST API endpoints on error.
detailsobjectrequiredDetailed error metadata. The contents of this field is determined by `error_code`.error_codestringrequiredError code is a string that specifies this error type.messagestringrequiredHuman-readable error message.
curl -X GET 'https://api.example.com/v0/pipelines/{pipeline_name}/samply_profile?ordinal=<ordinal>&latest=<latest>' \
-H 'Authorization: Bearer YOUR_TOKEN'const response = await fetch('https://api.example.com/v0/pipelines/{pipeline_name}/samply_profile?ordinal=<ordinal>&latest=<latest>', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
});
const data = await response.json();
console.log(data);interface ApiResponse {
// shape your response here
}
const response: Response = await fetch('https://api.example.com/v0/pipelines/{pipeline_name}/samply_profile?ordinal=<ordinal>&latest=<latest>', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
});
const data = (await response.json()) as ApiResponse;
console.log(data);import requests
url = "https://api.example.com/v0/pipelines/{pipeline_name}/samply_profile"
params = {
"ordinal": "<ordinal>",
"latest": "<latest>"
}
headers = {
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.request("get", url, params=params, headers=headers)
print(response.json())package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.example.com/v0/pipelines/{pipeline_name}/samply_profile?ordinal=<ordinal>&latest=<latest>", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}"string"{
"message": "Unknown pipeline name 'non-existent-pipeline'",
"error_code": "UnknownPipelineName",
"details": {
"pipeline_name": "non-existent-pipeline"
}
}