File size: 710 Bytes
a7d24e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
Prometheus metrics configuration
"""

from prometheus_client import Counter, Histogram


# Request metrics
REQUEST_COUNT = Counter(
    'sema_requests_total', 
    'Total requests', 
    ['method', 'endpoint', 'status']
)

REQUEST_DURATION = Histogram(
    'sema_request_duration_seconds', 
    'Request duration', 
    ['method', 'endpoint']
)

# Translation metrics
TRANSLATION_COUNT = Counter(
    'sema_translations_total', 
    'Total translations', 
    ['source_lang', 'target_lang']
)

CHARACTER_COUNT = Counter(
    'sema_characters_translated_total', 
    'Total characters translated'
)

# Error metrics
ERROR_COUNT = Counter(
    'sema_errors_total', 
    'Total errors', 
    ['error_type']
)