-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
26 lines (22 loc) · 850 Bytes
/
config.py
File metadata and controls
26 lines (22 loc) · 850 Bytes
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
"""
Configuration - Kafka topics and system settings
"""
import os
import socket
import dotenv
dotenv.load_dotenv()
class Config:
HOSTNAME = socket.gethostname()
HOST = os.getenv("GRPC_SERVER_HOST", "localhost")
PORT = int(os.getenv("GRPC_SERVER_PORT", "50051"))
MONITORING_TOPIC = "metrics"
COMMAND_TOPIC = "command"
MONITORING_GROUP_ID = os.getenv("MONITORING_GROUP_ID", "monitoring")
COMMAND_GROUP_ID = os.getenv("COMMAND_GROUP_ID", "cmd")
KAFKA_BOOTSTRAP_SERVER = os.getenv("KAFKA_BOOTSTRAP_SERVERS", "localhost:9092")
KAFKA_DEFAULT_PARTITION = int(os.getenv("KAFKA_DEFAULT_PARTITIONS", "3"))
KAFKA_DEFAULT_REPLICATION_FACTOR = int(
os.getenv("KAFKA_DEFAULT_REPLICATION_FACTOR", "2")
)
ETCD_HOST = os.getenv("ETCD_HOST", "localhost")
ETCD_PORT = int(os.getenv("ETCD_PORT", "2379"))