Turn an app's tracing on or off
Turns OpenTelemetry tracing on or off for every compose service of the app. Turning it on adds the app variables OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_EXPORTER_OTLP_COMPRESSION, OTEL_RESOURCE_ATTRIBUTES, OTEL_METRICS_EXPORTER and OTEL_LOGS_EXPORTER, which point an OpenTelemetry SDK at Cloady's trace store; turning it off deletes them. Each service then also gets OTEL_SERVICE_NAME. The app is reconciled, so its running services restart once; setting the current value changes nothing. Needs the developer role.
Authorization
cloady Personal API token (cldy_…)
In: header
Path Parameters
Query Parameters
Value in
- "production"
- "preview"
- "development"
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/api/workspaces/string/apps/string/tracing" \ -H "Content-Type: application/json" \ -d '{ "enabled": true }'{ "enabled": true, "services": [ { "name": "string", "env": { "property1": "string", "property2": "string" }, "receiving": true } ]}Read an app's tracing setting GET
Returns whether tracing is on, which is whether the app holds the variable OTEL_EXPORTER_OTLP_ENDPOINT, the OpenTelemetry variables each compose service gets while it is, and which services have sent spans in the last 7 days. Spans need an OpenTelemetry SDK or agent in the app.
Search a service's traces GET
Returns a sample of the requests the service handled in the range, one per trace, with their method, route, status and duration, plus the range's request count and median and 95th-percentile duration. Filter on `route`, `method` and `status` (2xx to 5xx, or a code). Needs tracing on for the app and an OpenTelemetry SDK in the service; traces are kept for 7 days. `serviceName` is a compose service.