✨ Update agent guidelines and improve documentation structure. Refactor AGENTS.md to streamline commands and code style guidelines, enhancing clarity and usability. Update README.md with refined NATS consumer configuration details and observability metrics. Modify .gitignore to exclude dynamically generated Prometheus target files. Enhance configuration files for development and production environments, ensuring consistency and clarity in settings.
This commit is contained in:
+11
-38
@@ -37,51 +37,24 @@ storage = "file"
|
||||
replicas = 1
|
||||
|
||||
[nats.consumer_rules]
|
||||
# Consumer delivery and retry rules (only applies when mode = "jetstream")
|
||||
# Consumer delivery rules (only applies when mode = "jetstream")
|
||||
# max_deliver: Maximum number of delivery attempts before giving up (0 = unlimited)
|
||||
max_deliver = 5
|
||||
max_deliver = 3
|
||||
# ack_wait: Time to wait for ACK before redelivering message (e.g., "30s", "2m")
|
||||
ack_wait = "30s"
|
||||
# max_ack_pending: Maximum number of unacknowledged messages before pausing delivery
|
||||
max_ack_pending = 1024
|
||||
# deliver_policy: When to start delivering messages:
|
||||
# - "all": Deliver all messages from the stream
|
||||
# - "new": Only deliver new messages after consumer creation
|
||||
# - "last": Deliver only the last message
|
||||
# - "last_per_subject": Deliver last message per subject
|
||||
# - "sequence": Start from a specific sequence (requires start_sequence)
|
||||
# - "time": Start from a specific time (requires start_time in RFC3339 format)
|
||||
deliver_policy = "all"
|
||||
# replay_policy: How to replay messages: "instant" (as fast as possible) or "original" (preserve timing)
|
||||
replay_policy = "instant"
|
||||
# backoff: Array of delays between retry attempts (e.g., ["5s", "30s", "2m"])
|
||||
# First retry waits 5s, second waits 30s, third and beyond wait 2m
|
||||
backoff = ["5s", "30s", "2m"]
|
||||
# start_sequence: Starting sequence number (only used when deliver_policy = "sequence")
|
||||
start_sequence = 0
|
||||
# start_time: Starting time in RFC3339 format (only used when deliver_policy = "time")
|
||||
# Example: "2024-11-15T08:00:00Z"
|
||||
start_time = ""
|
||||
max_ack_pending = 1000
|
||||
|
||||
[nats.auth]
|
||||
# NATS authentication configuration (optional for development)
|
||||
# Only one authentication method can be used at a time:
|
||||
# - token: Simple token authentication
|
||||
# - credentials_file: Path to NATS credentials file (e.g., /path/to/user.creds)
|
||||
# - user/password: Username and password authentication
|
||||
#
|
||||
# For development, authentication is typically not required.
|
||||
# Uncomment and configure as needed:
|
||||
# token = ""
|
||||
# credentials_file = ""
|
||||
# user = ""
|
||||
# password = ""
|
||||
#
|
||||
# TLS configuration (optional)
|
||||
# tls_enabled = false
|
||||
# tls_cert_file = "" # Client certificate file path
|
||||
# tls_key_file = "" # Client private key file path
|
||||
# tls_ca_file = "" # CA certificate file for server verification
|
||||
# token: Simple token authentication (uncomment if needed)
|
||||
# token = "your-dev-token"
|
||||
|
||||
# TLS configuration (optional - uncomment for secure connections)
|
||||
# tls_enabled = true
|
||||
# tls_cert_file = "/path/to/client.crt"
|
||||
# tls_key_file = "/path/to/client.key"
|
||||
# tls_ca_file = "/path/to/ca.crt"
|
||||
|
||||
[subscription]
|
||||
topic = "telegram.serial"
|
||||
|
||||
@@ -37,26 +37,13 @@ storage = "file"
|
||||
replicas = 3
|
||||
|
||||
[nats.consumer_rules]
|
||||
# Consumer delivery and retry rules for production
|
||||
# Consumer delivery rules (only applies when mode = "jetstream")
|
||||
# max_deliver: Maximum number of delivery attempts before giving up
|
||||
max_deliver = 5
|
||||
max_deliver = 3
|
||||
# ack_wait: Time to wait for ACK before redelivering message
|
||||
ack_wait = "30s"
|
||||
# max_ack_pending: Maximum number of unacknowledged messages before pausing delivery
|
||||
max_ack_pending = 1024
|
||||
# deliver_policy: "new" - Start from new messages after consumer creation (recommended for production)
|
||||
# Other options: "all", "last", "last_per_subject", "sequence", "time"
|
||||
deliver_policy = "new"
|
||||
# replay_policy: How to replay messages: "instant" (as fast as possible) or "original" (preserve timing)
|
||||
replay_policy = "instant"
|
||||
# backoff: Array of delays between retry attempts
|
||||
# First retry waits 5s, second waits 30s, third waits 2m, fourth+ wait 5m
|
||||
backoff = ["5s", "30s", "2m", "5m"]
|
||||
# start_sequence: Starting sequence number (only used when deliver_policy = "sequence")
|
||||
start_sequence = 0
|
||||
# start_time: Starting time in RFC3339 format (only used when deliver_policy = "time")
|
||||
# Example: "2024-11-15T08:00:00Z"
|
||||
start_time = ""
|
||||
max_ack_pending = 1000
|
||||
|
||||
[nats.auth]
|
||||
# NATS authentication configuration (REQUIRED for production)
|
||||
|
||||
@@ -287,93 +287,6 @@
|
||||
"legendFormat": "{{stream}} / {{consumer}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"type": "timeseries",
|
||||
"title": "NATS consumer ACK pending",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus-dev"
|
||||
},
|
||||
"gridPos": { "h": 7, "w": 12, "x": 12, "y": 26 },
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": { "mode": "palette-classic" },
|
||||
"mappings": [],
|
||||
"thresholds": { "mode": "absolute", "steps": [] }
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": { "displayMode": "table", "placement": "bottom" },
|
||||
"tooltip": { "mode": "single" }
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "last_over_time(caatsm_nats_consumer_ack_pending_sum[1m])",
|
||||
"legendFormat": "ACK pending"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"type": "timeseries",
|
||||
"title": "NATS consumer redelivered messages",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus-dev"
|
||||
},
|
||||
"gridPos": { "h": 7, "w": 12, "x": 0, "y": 33 },
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": { "mode": "palette-classic" },
|
||||
"mappings": [],
|
||||
"thresholds": { "mode": "absolute", "steps": [] }
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": { "displayMode": "table", "placement": "bottom" },
|
||||
"tooltip": { "mode": "single" }
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "last_over_time(caatsm_nats_consumer_redelivered_sum[1m])",
|
||||
"legendFormat": "Redelivered"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"type": "timeseries",
|
||||
"title": "NATS consumer delivered messages",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus-dev"
|
||||
},
|
||||
"gridPos": { "h": 7, "w": 12, "x": 12, "y": 33 },
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": { "mode": "palette-classic" },
|
||||
"mappings": [],
|
||||
"thresholds": { "mode": "absolute", "steps": [] }
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"legend": { "displayMode": "table", "placement": "bottom" },
|
||||
"tooltip": { "mode": "single" }
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "last_over_time(caatsm_nats_consumer_delivered_sum[1m])",
|
||||
"legendFormat": "Delivered"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user