Skip to main content
TLSExporter reports span data to the Volcengine TLS log service over OTLP (HTTP). Data is organized by TLS topic, which suits centralized storage, long-term retention, and cross-service trace analysis.

When to use

  • You want your agent’s execution traces stored centrally in the Volcengine TLS log service;
  • You need long-term retention and compliance/audit trails for trace data;
  • You want to observe traces with TLS alerting and analysis capabilities.

Prerequisites

Complete installation and model configuration, then set the environment variables below before starting Python. Replace placeholders with accessible resources and valid credentials
TLS receives traces and may incur storage charges. Specify an existing trace topic ID where possible; otherwise VeADK calls TLS to obtain or create default trace resources. This example uses a Volcengine TLS endpoint. With CLOUD_PROVIDER=byteplus, credential configuration can use BytePlus AK/SK. Match the endpoint, region, and topic to the target service; using a BytePlus model alone does not configure TLS

Usage

Save as app.py and run python app.py. The example uses existing resources and flushes pending traces after one model call
app.py

Parameters

Constructor parameters

TLSExporter carries its connection parameters in the config field of type TLSExporterConfig; when omitted, each field is read automatically from the corresponding environment variable.

TLS connection config

config is a TLSExporterConfig; each field defaults from TLSConfig and Volcengine credentials, with the following environment variables:
When topic_id is not provided via OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME, the exporter calls VeTLS to fetch the tracing topic ID automatically, so valid Volcengine credentials (VOLCENGINE_ACCESS_KEY and VOLCENGINE_SECRET_KEY) are required.
You can also let Agent attach the TLS exporter automatically from an environment variable, without constructing it explicitly:
With ENABLE_TLS=true, Agent creates an OpentelemetryTracer and attaches TLSExporter automatically, even when the agent provides no tracers.

Verification and troubleshooting

Search for the run’s Trace ID in the target backend. A successful model response does not prove trace delivery. If data is missing, check the endpoint and region, credential permissions, target resource, and whether tracer.force_export() ran before the process exited
Last modified on September 19, 2026