Package codes.grow.packages.skywalking
Class SkyWalkingLogQueryClient
java.lang.Object
codes.grow.packages.skywalking.SkyWalkingLogQueryClient
- All Implemented Interfaces:
LogQueryClient
LogQueryClient for SkyWalking (GraphQL queryLogs); query syntax in ParsedLogQuery. OAP on BanyanDB ignores content keywords, so free-text terms are filtered client
side: search(java.lang.String, codes.grow.packages.skywalking.logging.SearchOptions) reads raw pages of 1000 logs (newest first by default)
and keeps the matching ones until limit matches or maxScanPages pages;
nextCursor ("page:offset:size") continues where it stopped. Without free text the page
size is limit and nothing is filtered except the exact time window. Default window: the
last hour. Obtain it from SkyWalkingClient.logs().-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault number of raw pages one search may scan.static final intRaw page size used while filtering free text client side. -
Method Summary
Modifier and TypeMethodDescriptionLog tag keys seen in the last hour (queryLogTagAutocompleteKeys).AsynchronousLogQueryClient.listLabels().Service names known to OAP (SkyWalking has no streams; the service is the equivalent), sorted.AsynchronousLogQueryClient.listStreams().intThe number of raw pages one search may scan.search(String query, SearchOptions options) Searches logs (see the class description for paging andParsedLogQueryfor the syntax).searchAsync(String query, SearchOptions options) AsynchronousLogQueryClient.search(String, SearchOptions).tail(String query, Consumer<LogRecord> onRecord, TailOptions options) Polling tail on top ofsearch(java.lang.String, codes.grow.packages.skywalking.logging.SearchOptions): everyintervalit asks for records newer than the last one seen (ascending) and callsonRecordonce per new record.withMaxScanPages(int maxScanPages) Returns a client that scans at mostmaxScanPagesraw pages per search.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface codes.grow.packages.skywalking.logging.LogQueryClient
search, waitForLog, waitForLog, waitForLogAsync
-
Field Details
-
SCAN_PAGE_SIZE
public static final int SCAN_PAGE_SIZERaw page size used while filtering free text client side.- See Also:
-
DEFAULT_MAX_SCAN_PAGES
public static final int DEFAULT_MAX_SCAN_PAGESDefault number of raw pages one search may scan.- See Also:
-
-
Method Details
-
withMaxScanPages
Returns a client that scans at mostmaxScanPagesraw pages per search.- Parameters:
maxScanPages- positive page count- Returns:
- a new client sharing this client's connections
-
maxScanPages
public int maxScanPages()The number of raw pages one search may scan.- Returns:
- the page count
-
search
Searches logs (see the class description for paging andParsedLogQueryfor the syntax).- Specified by:
searchin interfaceLogQueryClient- Parameters:
query- query textoptions- window, limit (1..10000), order and cursor- Returns:
- matching records and the next cursor
-
searchAsync
Description copied from interface:LogQueryClientAsynchronousLogQueryClient.search(String, SearchOptions).- Specified by:
searchAsyncin interfaceLogQueryClient- Parameters:
query- query textoptions- options- Returns:
- future page
-
tail
Polling tail on top ofsearch(java.lang.String, codes.grow.packages.skywalking.logging.SearchOptions): everyintervalit asks for records newer than the last one seen (ascending) and callsonRecordonce per new record. Errors go toTailOptions.onError().- Specified by:
tailin interfaceLogQueryClient- Parameters:
query- query textonRecord- callback (called from the tail's daemon thread)options- start, interval and error callback- Returns:
- a handle;
TailHandle.stop()ends the tail
-
listStreams
Service names known to OAP (SkyWalking has no streams; the service is the equivalent), sorted.- Specified by:
listStreamsin interfaceLogQueryClient- Returns:
- the names
-
listStreamsAsync
Description copied from interface:LogQueryClientAsynchronousLogQueryClient.listStreams().- Specified by:
listStreamsAsyncin interfaceLogQueryClient- Returns:
- future names
-
listLabels
Log tag keys seen in the last hour (queryLogTagAutocompleteKeys).- Specified by:
listLabelsin interfaceLogQueryClient- Returns:
- the keys
-
listLabelsAsync
Description copied from interface:LogQueryClientAsynchronousLogQueryClient.listLabels().- Specified by:
listLabelsAsyncin interfaceLogQueryClient- Returns:
- future names
-