@@ -44,83 +44,83 @@ func (p *Query) SpanWriter() spanstore.Writer {
44
44
}
45
45
46
46
func (p * Query ) GetTrace (ctx context.Context , traceID model.TraceID ) (* model.Trace , error ) {
47
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_trace" , "code" : "" }).Inc ()
47
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_trace" , "code" : "" }).Inc ()
48
48
start := time .Now ()
49
49
res , err := getTrace (ctx , p .conn , traceID )
50
50
if err == nil {
51
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_trace" , "code" : "200" }).Inc ()
51
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_trace" , "code" : "200" }).Inc ()
52
52
traceRequestsExec .Add (1 )
53
- metrics .RequestsDuration .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_trace" }).Observe (time .Since (start ).Seconds ())
53
+ metrics .RequestsDuration .With (prometheus.Labels {"type " : "trace" , "handler" : "get_trace" }).Observe (time .Since (start ).Seconds ())
54
54
} else {
55
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_trace" , "code" : "500" }).Inc ()
55
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_trace" , "code" : "500" }).Inc ()
56
56
}
57
57
return res , logError (err )
58
58
}
59
59
60
60
func (p * Query ) GetServices (ctx context.Context ) ([]string , error ) {
61
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_services" , "code" : "" }).Inc ()
61
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_services" , "code" : "" }).Inc ()
62
62
start := time .Now ()
63
63
res , err := getServices (ctx , p .conn )
64
64
if err == nil {
65
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_services" , "code" : "200" }).Inc ()
66
- metrics .RequestsDuration .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_services" }).Observe (time .Since (start ).Seconds ())
65
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_services" , "code" : "200" }).Inc ()
66
+ metrics .RequestsDuration .With (prometheus.Labels {"type " : "trace" , "handler" : "get_services" }).Observe (time .Since (start ).Seconds ())
67
67
} else {
68
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_services" , "code" : "500" }).Inc ()
68
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_services" , "code" : "500" }).Inc ()
69
69
}
70
70
return res , logError (err )
71
71
}
72
72
73
73
func (p * Query ) GetOperations (ctx context.Context , query spanstore.OperationQueryParameters ) ([]spanstore.Operation , error ) {
74
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_operations" , "code" : "" }).Inc ()
74
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_operations" , "code" : "" }).Inc ()
75
75
start := time .Now ()
76
76
res , err := getOperations (ctx , p .conn , query )
77
77
if err == nil {
78
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_operations" , "code" : "200" }).Inc ()
79
- metrics .RequestsDuration .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_operations" }).Observe (time .Since (start ).Seconds ())
78
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_operations" , "code" : "200" }).Inc ()
79
+ metrics .RequestsDuration .With (prometheus.Labels {"type " : "trace" , "handler" : "get_operations" }).Observe (time .Since (start ).Seconds ())
80
80
} else {
81
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_operations" , "code" : "500" }).Inc ()
81
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_operations" , "code" : "500" }).Inc ()
82
82
}
83
83
return res , logError (err )
84
84
}
85
85
86
86
func (p * Query ) FindTraces (ctx context.Context , query * spanstore.TraceQueryParameters ) ([]* model.Trace , error ) {
87
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "find_traces" , "code" : "" }).Inc ()
87
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "find_traces" , "code" : "" }).Inc ()
88
88
start := time .Now ()
89
89
res , err := findTraces (ctx , p .conn , query )
90
90
if err == nil {
91
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "find_traces" , "code" : "200" }).Inc ()
91
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "find_traces" , "code" : "200" }).Inc ()
92
92
traceRequestsExec .Add (1 )
93
- metrics .RequestsDuration .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "find_traces" }).Observe (time .Since (start ).Seconds ())
93
+ metrics .RequestsDuration .With (prometheus.Labels {"type " : "trace" , "handler" : "find_traces" }).Observe (time .Since (start ).Seconds ())
94
94
} else {
95
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "find_traces" , "code" : "500" }).Inc ()
95
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "find_traces" , "code" : "500" }).Inc ()
96
96
}
97
97
return res , logError (err )
98
98
}
99
99
100
100
func (p * Query ) FindTraceIDs (ctx context.Context , query * spanstore.TraceQueryParameters ) ([]model.TraceID , error ) {
101
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "find_trace_ids" , "code" : "" }).Inc ()
101
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "find_trace_ids" , "code" : "" }).Inc ()
102
102
start := time .Now ()
103
103
res , err := findTraceIDs (ctx , p .conn , query )
104
104
if err == nil {
105
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "find_trace_ids" , "code" : "200" }).Inc ()
105
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "find_trace_ids" , "code" : "200" }).Inc ()
106
106
traceRequestsExec .Add (1 )
107
- metrics .RequestsDuration .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "find_trace_ids" }).Observe (time .Since (start ).Seconds ())
107
+ metrics .RequestsDuration .With (prometheus.Labels {"type " : "trace" , "handler" : "find_trace_ids" }).Observe (time .Since (start ).Seconds ())
108
108
} else {
109
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "find_trace_ids" , "code" : "500" }).Inc ()
109
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "find_trace_ids" , "code" : "500" }).Inc ()
110
110
}
111
111
return res , logError (err )
112
112
}
113
113
114
114
func (p * Query ) GetDependencies (ctx context.Context , endTs time.Time , lookback time.Duration ) ([]model.DependencyLink , error ) {
115
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_dependencies" , "code" : "" }).Inc ()
115
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_dependencies" , "code" : "" }).Inc ()
116
116
start := time .Now ()
117
117
res , err := getDependencies (ctx , p .conn , endTs , lookback )
118
118
if err == nil {
119
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_dependencies" , "code" : "200" }).Inc ()
119
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_dependencies" , "code" : "200" }).Inc ()
120
120
dependencyRequestsExec .Add (1 )
121
- metrics .RequestsDuration .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_dependencies" }).Observe (time .Since (start ).Seconds ())
121
+ metrics .RequestsDuration .With (prometheus.Labels {"type " : "trace" , "handler" : "get_dependencies" }).Observe (time .Since (start ).Seconds ())
122
122
} else {
123
- metrics .RequestsTotal .With (prometheus.Labels {"subsystem " : "trace" , "handler" : "get_dependencies" , "code" : "500" }).Inc ()
123
+ metrics .RequestsTotal .With (prometheus.Labels {"type " : "trace" , "handler" : "get_dependencies" , "code" : "500" }).Inc ()
124
124
}
125
125
return res , logError (err )
126
126
}
0 commit comments