API7 Docs

Update Observability Exporter

PATCH /environments/{env_id}/observability_exporters/{exporter_id}

PATCH /environments/{env_id}/observability_exporters/{exporter_id}

Interactive request editor loads with JavaScript.

Authorization

BearerAdminToken
AuthorizationBearer <token>

Organization-scoped admin token. Read operations require a valid token, and write operations require a token with write permission.

In: header

Path Parameters

env_id*string

Environment ID that scopes the request.

Formatuuid
exporter_id*string

Observability exporter ID within the environment.

Formatuuid

Request Body

application/json

Patch selected exporter fields. The name and kind are fixed at creation, and a field that does not belong to the exporter's kind is rejected. Set fields are merged into the stored configuration and the result is validated against the same rules as create. An explicit empty string clears optional fields such as the object_store region; sample_rate cannot be cleared back to absent — 1 is the equivalent of exporting everything. The object_store provider is immutable.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "$AISIX_CP/environments/$ENV_ID/observability_exporters/$EXPORTER_ID" \  -H "Authorization: Bearer $AISIX_TOKEN" \  -H "Content-Type: application/json" \  -d '{}'

OK

{
  "observability_exporter": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "env_id": "3f917d0d-4dff-42f3-97c4-6a5455dfe8c2",
    "name": "string",
    "enabled": true,
    "kind": "otlp_http",
    "endpoint": "string",
    "header_keys": [
      "string"
    ],
    "headers_set": true,
    "trace_ui_url_template": "string",
    "sample_rate": 0,
    "project": "string",
    "logstore": "string",
    "content_mode": "metadata_only",
    "content_max_bytes": 0,
    "provider": "s3",
    "bucket": "string",
    "prefix": "string",
    "region": "string",
    "compression": "gzip",
    "auth_mode": "credential_ref",
    "site": "string",
    "service": "string",
    "ddsource": "string",
    "tags": [
      "string"
    ],
    "credential_ref": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
Complete operation details and schema variants

PATCH /environments/{env_id}/observability_exporters/{exporter_id}

Update Observability Exporter

Update selected fields on an exporter. The exporter name and kind are fixed at creation, and a field that does not belong to the exporter's kind is rejected. Configuration changes are validated against the same rules as create; an explicit empty string clears optional fields such as the object_store region.

Parameters

  • env_id (path, string, required): Environment ID that scopes the request.
  • exporter_id (path, string, required): Observability exporter ID within the environment.

Request body

Content type: application/json

  • enabled (boolean, optional): Send false to stop the gateway from shipping telemetry to this exporter, or true to re-enable it.

  • endpoint (string, optional): Replacement endpoint. For otlp_http, the receiver URL; for aliyun_sls, the bare SLS region host; for object_store, the S3-compatible host override.

  • headers (object, optional): Replacement static header set (otlp_http). Replaces the stored headers as a whole; values are encrypted at rest and never returned.

  • trace_ui_url_template (string, optional): Replacement deep-link template (otlp_http). An empty string clears it.

  • sample_rate (number, optional): Replacement trace sampling fraction (otlp_http).

  • project (string, optional): Replacement SLS project name (aliyun_sls).

  • logstore (string, optional): Replacement SLS logstore name (aliyun_sls).

  • credential_ref (string, optional): Replacement credential name (aliyun_sls, datadog, object_store).

  • content_mode (string, optional): What the exporter captures per request. metadata_only ships operational metadata such as latency, token counts, and status. full additionally captures the prompt and the assembled response, each truncated to content_max_bytes.

  • content_max_bytes (integer, optional): Replacement per-field capture cap in bytes (otlp_http, aliyun_sls, datadog). 0 applies the default of 131072 (128 KiB); the ceiling is 1 MiB.

  • site (string, optional): Replacement Datadog site host (datadog).

  • service (string, optional): Replacement Datadog service attribute (datadog).

  • ddsource (string, optional): Replacement Datadog ddsource attribute (datadog). An empty string resets it to aisix-ai-gateway.

  • tags (array, optional): Replacement Datadog tag list (datadog).

  • provider (string, optional): Object-storage service for object_store exporters. Fixed at creation because it selects the credential family the gateway resolves.

  • bucket (string, optional): Replacement bucket or container name (object_store).

  • prefix (string, optional): Replacement key prefix (object_store).

  • region (string, optional): Replacement cloud region (object_store). An empty string clears it.

  • compression (string, optional): Compression for the telemetry files an object_store exporter writes. Defaults to gzip when omitted.

  • auth_mode (string, optional): How the gateway authenticates to the object store. credential_ref (the default) resolves a static cloud key from a named credential the gateway holds locally. cloud_identity uses the gateway's own attached cloud identity — supported for s3 and gcs, and incompatible with a custom endpoint or a credential_ref.

Responses

  • 200: OK

  • observability_exporter (object, required): A configured telemetry exporter. The gateway ships telemetry directly to the target; the AISIX Cloud control plane stores the configuration only. Fields other than name, enabled, and kind are present when the exporter's kind uses them. Secrets are never returned: otlp_http reads expose header_keys and headers_set instead of header values, and the other kinds expose only the credential_ref pointer.

  • observability_exporter.id (string, required): Observability exporter ID.

  • observability_exporter.env_id (string, required): Environment ID that owns this exporter.

  • observability_exporter.name (string, required): Human-readable exporter name, unique within the environment. Fixed at creation.

  • observability_exporter.enabled (boolean, required): Disabled exporters are kept but the gateway stops shipping telemetry to them.

  • observability_exporter.kind (string, required): Telemetry destination type, fixed at creation. otlp_http sends traces over OTLP/HTTP to an OpenTelemetry-compatible receiver. aliyun_sls delivers request logs to an Alibaba Cloud SLS logstore. object_store writes newline-delimited JSON telemetry files to S3, Google Cloud Storage, or Azure Blob Storage. datadog delivers request logs to the Datadog Logs intake.

  • observability_exporter.endpoint (string, optional): For otlp_http, the receiver URL. For aliyun_sls, the bare SLS region host. For object_store, the optional S3-compatible host override.

  • observability_exporter.header_keys (array, optional): Names of the static headers attached to every export request (otlp_http). Header values are never returned.

  • observability_exporter.headers_set (boolean, optional): Whether encrypted header values are stored for this exporter (otlp_http).

  • observability_exporter.trace_ui_url_template (string, optional): Deep-link template used by log views to open a request's trace in an external UI (otlp_http). Contains a {request_id} placeholder, a {trace_id} placeholder, or both — {trace_id} addresses the trace by the trace ID the gateway exported its spans under; {request_id} suits backends that search the request-ID span attribute.

  • observability_exporter.sample_rate (number, optional): Fraction of requests whose traces are exported, between 0 and 1 (otlp_http). Absent means every request is exported.

  • observability_exporter.project (string, optional): SLS project name (aliyun_sls).

  • observability_exporter.logstore (string, optional): SLS logstore name (aliyun_sls).

  • observability_exporter.content_mode (string, optional): What the exporter captures per request. metadata_only ships operational metadata such as latency, token counts, and status. full additionally captures the prompt and the assembled response, each truncated to content_max_bytes.

  • observability_exporter.content_max_bytes (integer, optional): Per-field capture cap in bytes when content_mode is full (otlp_http, aliyun_sls, datadog).

  • observability_exporter.provider (string, optional): Object-storage service for object_store exporters. Fixed at creation because it selects the credential family the gateway resolves.

  • observability_exporter.bucket (string, optional): Bucket or container name (object_store).

  • observability_exporter.prefix (string, optional): Key prefix for written objects (object_store).

  • observability_exporter.region (string, optional): Cloud region of the bucket (object_store).

  • observability_exporter.compression (string, optional): Compression for the telemetry files an object_store exporter writes. Defaults to gzip when omitted.

  • observability_exporter.auth_mode (string, optional): How the gateway authenticates to the object store. credential_ref (the default) resolves a static cloud key from a named credential the gateway holds locally. cloud_identity uses the gateway's own attached cloud identity — supported for s3 and gcs, and incompatible with a custom endpoint or a credential_ref.

  • observability_exporter.site (string, optional): Datadog site host, such as datadoghq.com or datadoghq.eu (datadog).

  • observability_exporter.service (string, optional): Datadog service attribute (datadog).

  • observability_exporter.ddsource (string, optional): Datadog ddsource attribute (datadog).

  • observability_exporter.tags (array, optional): Tags rendered into Datadog's ddtags attribute (datadog).

  • observability_exporter.credential_ref (string, optional): Name of the credential the gateway resolves from its own runtime environment (aliyun_sls, object_store, datadog). The referenced secret never leaves the gateway host.

  • observability_exporter.created_at (string, required): Time when the exporter was created.

  • observability_exporter.updated_at (string, required): Time when the exporter was last updated.

  • 400: Request body or parameters failed validation.

  • error (object, required): Error details.

  • error.code (string, required): Machine-readable identifier. Examples: UNAUTHENTICATED, INVALID_REQUEST, MASTER_KEY_UNSET, INTERNAL.

  • error.message (string, required): Human-readable explanation; safe to surface to operators.

  • 401: Missing or invalid bearer. Response fields (application/json): identical to PATCH /environments/{env_id}/observability_exporters/{exporter_id}, response 400 above.

  • 403: Authenticated request is not permitted. Response fields (application/json): identical to PATCH /environments/{env_id}/observability_exporters/{exporter_id}, response 400 above.

  • 404: Resource not found. Response fields (application/json): identical to PATCH /environments/{env_id}/observability_exporters/{exporter_id}, response 400 above.

cURL

curl -X PATCH '$AISIX_CP/environments/{env_id}/observability_exporters/{exporter_id}' -H 'Authorization: Bearer $AISIX_TOKEN'