Spaces method and path for this operation:
post /s/{space_id}/api/apm/services/{serviceName}/annotation
Refer to Spaces for more information.
Create a new annotation for a specific service.
Headers
-
The version of the API to use
Value is
2023-10-31. Default value is2023-10-31. -
A required header to protect against CSRF attacks
POST
/api/apm/services/{serviceName}/annotation
curl -X POST \
http://localhost:5601/api/apm/services/opbeans-java/annotation \
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: true' \
-H 'Authorization: Basic YhUlubWZhM0FDbnlQeE6WRtaW49FQmSGZ4RUWXdX' \
-d '{
"@timestamp": "2020-05-08T10:31:30.452Z",
"service": {
"version": "1.2"
},
"message": "Deployment 1.2"
}'
Request example
Run `POST /api/apm/services/{serviceName}/annotation` to create a deployment annotation for a service.
{
"@timestamp": "2024-01-15T12:00:00.000Z",
"message": "Deployment 1.2.0",
"service": {
"environment": "production",
"version": "1.2.0"
},
"tags": [
"apm",
"deployment"
]
}
Response examples (200)
An example of a successful response from `POST /api/apm/services/opbeans-java/annotation`, which creates an annotation for a service named `opbeans-java`.
{
"_id": "Lc9I93EBh6DbmkeV7nFX",
"_index": "observability-annotations",
"_primary_term": 1,
"_seq_no": 12,
"_source": {
"@timestamp": "2020-05-08T10:31:30.452Z",
"annotation": {
"type": "deployment"
},
"event": {
"created": "2020-05-09T02:34:43.937Z"
},
"message": "Deployment 1.2",
"service": {
"name": "opbeans-java",
"version": "1.2"
},
"tags": [
"apm",
"elastic.co",
"customer"
]
},
"_version": 1,
"found": true
}