-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
125 lines (115 loc) · 3.6 KB
/
config.example.yaml
File metadata and controls
125 lines (115 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
server:
port: 8080
metrics_port: 9090
host: 0.0.0.0
read_header_timeout: 10s
read_timeout: 30s
write_timeout: 30s
idle_timeout: 120s
clickhouse:
dsn: "clickhouse://default:supersecret@localhost:9000"
database: "mainnet"
use_final: true
max_open_conns: 10
max_idle_conns: 5
conn_max_lifetime: 60s
dial_timeout: 10s
read_timeout: 30s
write_timeout: 30s
max_execution_time: 60
insecure_skip_verify: false
discovery:
prefixes:
- fct
- int
- dim
- admin_cbt_incremental
exclude:
- "*_local" # Exclude all local tables
proto:
output_dir: "./pkg/proto/clickhouse"
package: "cbt.v1"
go_package: "github.com/ethpandaops/cbt-api/pkg/proto/clickhouse"
include_comments: true
api:
base_path: "/api/v1"
# Only tables with these prefixes will be exposed via REST API
expose_prefixes:
- fct
- int
- dim
- admin_cbt_incremental
# Exclude tables matching these patterns from API exposure
exclude:
- "*_local"
# Field whitelist for uint64→string conversion
bigint_to_string_fields:
- peer_id_unique_key
- consensus_payload_value
- execution_payload_value
- block_number
- total_accounts
- total_storage_slots
- expired_accounts
- expired_contracts
- total_contract_accounts
- expired_slots
- expired_storage_slots
telemetry:
enabled: false
endpoint: "tempo.example.com:443"
insecure: false
headers:
Authorization: "Bearer <your-token-here>"
service_name: "cbt-api"
service_version: "1.0.0"
environment: "mainnet"
sample_rate: 0.1
always_sample_errors: true
export_timeout: 10s
export_batch_size: 512
# HTTP Headers Configuration
# Allows setting arbitrary HTTP headers per endpoint based on path patterns
# Policies are evaluated in order - first match wins
# Use this for Cache-Control, Vary, security headers, custom headers, etc.
headers:
policies:
# OpenAPI spec - aggressive caching (spec rarely changes)
# Static file that can be cached for a long time
- name: "openapi_spec"
path_pattern: "^/openapi\\.yaml$"
headers:
Cache-Control: "public, max-age=3600, s-maxage=3600"
# Vary: "Accept-Encoding" # Example: vary cache on encoding
# API documentation - moderate caching
# HTML page that should be relatively fresh but can be cached
- name: "api_docs"
path_pattern: "^/docs$"
headers:
Cache-Control: "public, max-age=300, s-maxage=300"
# Health endpoint - minimal caching for monitoring
# Health checks should be relatively fresh but brief caching reduces load
- name: "health"
path_pattern: "^/health$"
headers:
Cache-Control: "public, max-age=5, s-maxage=5"
# API query endpoints - short caching with stale-while-revalidate
# Query results can be cached briefly, especially for identical queries
# stale-while-revalidate allows serving cached responses while fetching fresh data
- name: "api_queries"
path_pattern: "^/api/v1/.*"
headers:
Cache-Control: "public, max-age=30, s-maxage=60, stale-while-revalidate=120"
# Example: Custom headers for specific endpoint
# - name: "custom_endpoint"
# path_pattern: "^/api/v1/special$"
# headers:
# Cache-Control: "public, max-age=300"
# X-Custom-Header: "my-value"
# Vary: "Accept-Encoding, Accept-Language"
# Default fallback - no caching for unmatched paths
# Ensures new endpoints default to no caching until explicitly configured
- name: "default"
path_pattern: ".*"
headers:
Cache-Control: "no-cache, no-store, must-revalidate"