@@ -41,42 +41,43 @@ const (
4141
4242LatencyLabel = "filename"
4343HostLabel = "host"
44+ MetricPrefix = "netobserv"
4445)
4546
4647var (
4748encodedBytes = prometheus .NewCounterVec (prometheus.CounterOpts {
48- Namespace : "promtail" ,
49- Name : "encoded_bytes_total " ,
49+ Namespace : MetricPrefix ,
50+ Name : "loki_encoded_bytes_total " ,
5051Help : "Number of bytes encoded and ready to send." ,
5152}, []string {HostLabel })
5253sentBytes = prometheus .NewCounterVec (prometheus.CounterOpts {
53- Namespace : "promtail" ,
54- Name : "sent_bytes_total " ,
54+ Namespace : MetricPrefix ,
55+ Name : "loki_sent_bytes_total " ,
5556Help : "Number of bytes sent." ,
5657}, []string {HostLabel })
5758droppedBytes = prometheus .NewCounterVec (prometheus.CounterOpts {
58- Namespace : "promtail" ,
59- Name : "dropped_bytes_total " ,
59+ Namespace : MetricPrefix ,
60+ Name : "loki_dropped_bytes_total " ,
6061Help : "Number of bytes dropped because failed to be sent to the ingester after all retries." ,
6162}, []string {HostLabel })
6263sentEntries = prometheus .NewCounterVec (prometheus.CounterOpts {
63- Namespace : "promtail" ,
64- Name : "sent_entries_total " ,
64+ Namespace : MetricPrefix ,
65+ Name : "loki_sent_entries_total " ,
6566Help : "Number of log entries sent to the ingester." ,
6667}, []string {HostLabel })
6768droppedEntries = prometheus .NewCounterVec (prometheus.CounterOpts {
68- Namespace : "promtail" ,
69- Name : "dropped_entries_total " ,
69+ Namespace : MetricPrefix ,
70+ Name : "loki_dropped_entries_total " ,
7071Help : "Number of log entries dropped because failed to be sent to the ingester after all retries." ,
7172}, []string {HostLabel })
7273requestDuration = prometheus .NewHistogramVec (prometheus.HistogramOpts {
73- Namespace : "promtail" ,
74- Name : "request_duration_seconds " ,
74+ Namespace : MetricPrefix ,
75+ Name : "loki_request_duration_seconds " ,
7576Help : "Duration of send requests." ,
7677}, []string {"status_code" , HostLabel })
7778batchRetries = prometheus .NewCounterVec (prometheus.CounterOpts {
78- Namespace : "promtail" ,
79- Name : "batch_retries_total " ,
79+ Namespace : MetricPrefix ,
80+ Name : "loki_batch_retries_total " ,
8081Help : "Number of times batches has had to be retried." ,
8182}, []string {HostLabel })
8283streamLag * metric.Gauges
@@ -97,7 +98,7 @@ func init() {
9798prometheus .MustRegister (requestDuration )
9899prometheus .MustRegister (batchRetries )
99100var err error
100- streamLag , err = metric .NewGauges ("promtail_stream_lag_seconds " ,
101+ streamLag , err = metric .NewGauges (MetricPrefix + "_loki_stream_lag_seconds " ,
101102"Difference between current time and last batch timestamp for successful sends" ,
102103metric.GaugeConfig {Action : "set" },
103104int64 (1 * time .Minute .Seconds ()), // This strips out files which update slowly and reduces noise in this metric.
0 commit comments