10
10
import java .util .concurrent .atomic .AtomicReference ;
11
11
import java .util .function .BiConsumer ;
12
12
import java .util .function .Function ;
13
+ import java .util .logging .Logger ;
13
14
14
15
import com .fasterxml .jackson .core .JsonProcessingException ;
15
16
import com .fasterxml .jackson .databind .ObjectMapper ;
16
17
17
18
public class GrafanaClient {
19
+ private static final Logger LOG = Logger .getLogger (GrafanaClient .class .getName ());
20
+
18
21
private static final ObjectMapper MAPPER = new ObjectMapper ();
19
22
20
23
private final String url ;
@@ -87,7 +90,9 @@ public User user() {
87
90
throw new UncheckedIOException (e );
88
91
}
89
92
});
90
- return ref .get ();
93
+ User user = ref .get ();
94
+ LOG .info ("User: " + user );
95
+ return user ;
91
96
}
92
97
93
98
public QueryResult query (String query ) {
@@ -104,7 +109,9 @@ public QueryResult query(String query) {
104
109
throw new UncheckedIOException (e );
105
110
}
106
111
});
107
- return ref .get ();
112
+ QueryResult queryResult = ref .get ();
113
+ LOG .info ("Query: " + queryResult );
114
+ return queryResult ;
108
115
}
109
116
110
117
public TempoResult traces (String service , int limit , int spss ) {
@@ -123,6 +130,8 @@ public TempoResult traces(String service, int limit, int spss) {
123
130
throw new UncheckedIOException (e );
124
131
}
125
132
});
126
- return ref .get ();
133
+ TempoResult tempoResult = ref .get ();
134
+ LOG .info ("Traces: " + tempoResult );
135
+ return tempoResult ;
127
136
}
128
137
}
0 commit comments