Client search mixin
provide.foundation.integrations.openobserve.client_search_mixin
¶
Search and streams operations for OpenObserve client.
Classes¶
SearchOperationsMixin
¶
Mixin providing search and streams operations.
Functions¶
get_search_history
async
¶
get_search_history(
stream_name: str | None = None,
size: int = 100,
start_time: str | int | None = None,
end_time: str | int | None = None,
) -> SearchResponse
Get search history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stream_name
|
str | None
|
Filter by stream name |
None
|
size
|
int
|
Number of history entries to return |
100
|
start_time
|
str | int | None
|
Start time (relative like "-1h" or microseconds) |
None
|
end_time
|
str | int | None
|
End time (relative like "now" or microseconds) |
None
|
Returns:
| Type | Description |
|---|---|
SearchResponse
|
SearchResponse with history entries |
Source code in provide/foundation/integrations/openobserve/client_search_mixin.py
list_streams
async
¶
List available streams.
Returns:
| Type | Description |
|---|---|
list[StreamInfo]
|
List of StreamInfo objects |
Source code in provide/foundation/integrations/openobserve/client_search_mixin.py
search
async
¶
search(
sql: str,
start_time: str | int | None = None,
end_time: str | int | None = None,
size: int = 100,
from_offset: int = 0,
) -> SearchResponse
Execute a search query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sql
|
str
|
SQL query to execute |
required |
start_time
|
str | int | None
|
Start time (relative like "-1h" or microseconds) |
None
|
end_time
|
str | int | None
|
End time (relative like "now" or microseconds) |
None
|
size
|
int
|
Number of results to return |
100
|
from_offset
|
int
|
Offset for pagination |
0
|
Returns:
| Type | Description |
|---|---|
SearchResponse
|
SearchResponse with results |
Source code in provide/foundation/integrations/openobserve/client_search_mixin.py
test_connection
async
¶
Test connection to OpenObserve.
Uses the @resilient decorator for standardized error handling and logging.
Returns:
| Type | Description |
|---|---|
bool
|
True if connection successful, False otherwise |