Configuration
TelemetryLane can be configured via a YAML configuration file, environment variables, or programmatically. The configuration file is the recommended approach for production deployments.
Configuration File
By default, TelemetryLane looks for telemetrylane.yaml in the current working directory. You can specify a custom path:
a, err := agent.Init(agent.Config{
ConfigPath: "/etc/telemetrylane/config.yaml",
})
Full Configuration Example
# TelemetryLane Configuration
# See https://telemetrylane.com/docs/configuration.html
service:
name: "api-gateway"
environment: "production"
version: "1.4.2"
pipeline:
buffer_size: 4096
flush_interval: "5s"
batch_size: 512
collectors:
traces:
enabled: true
sample_rate: 0.1
logs:
enabled: true
min_level: "info"
metrics:
enabled: true
aggregation_interval: "10s"
exporters:
otlp:
endpoint: "https://otel-collector.internal:4317"
protocol: "grpc"
compression: "gzip"
headers:
authorization: "Bearer ${OTLP_TOKEN}"
# Alternative: Jaeger exporter
# jaeger:
# endpoint: "http://jaeger:14268/api/traces"
# protocol: "thrift-http"
# Alternative: Zipkin exporter
# zipkin:
# endpoint: "http://zipkin:9411/api/v2/spans"
routing:
- name: "all-to-otlp"
match: "*"
target: "otlp"
logging:
level: "info"
format: "json"
Exporter Configuration
OTLP
| Parameter |
Type |
Default |
Description |
endpoint |
string |
"http://localhost:4317" |
OTLP collector endpoint |
protocol |
string |
"grpc" |
Transport protocol (grpc or http) |
compression |
string |
"none" |
Compression algorithm (none, gzip) |
headers |
map |
{} |
Additional request headers |
Jaeger
| Parameter |
Type |
Default |
Description |
endpoint |
string |
"http://localhost:14268/api/traces" |
Jaeger collector endpoint |
protocol |
string |
"thrift-http" |
Protocol (thrift-http, grpc) |
username |
string |
"" |
Basic auth username |
password |
string |
"" |
Basic auth password |
Zipkin
| Parameter |
Type |
Default |
Description |
endpoint |
string |
"http://localhost:9411/api/v2/spans" |
Zipkin collector endpoint |
max_batch_size |
int |
100 |
Maximum spans per batch request |
timeout |
string |
"5s" |
HTTP request timeout |
Environment Variables
All configuration options can be overridden with environment variables. The format is TELEMETRYLANE_ followed by the uppercased key path with underscores.
| Variable |
Config Path |
Example |
TELEMETRYLANE_SERVICE_NAME |
service.name |
"api-gateway" |
TELEMETRYLANE_PIPELINE_BUFFER_SIZE |
pipeline.buffer_size |
4096 |
TELEMETRYLANE_EXPORTERS_OTLP_ENDPOINT |
exporters.otlp.endpoint |
"https://otel:4317" |
TELEMETRYLANE_COLLECTORS_TRACES_SAMPLE_RATE |
collectors.traces.sample_rate |
0.5 |
TELEMETRYLANE_LOG_LEVEL |
logging.level |
"debug" |