Streaming
provide.foundation.integrations.openobserve.streaming
¶
Streaming search operations for OpenObserve using Foundation transport.
Classes¶
Functions¶
stream_logs
¶
stream_logs(
sql: str,
start_time: str | int | None = None,
poll_interval: int = 5,
client: OpenObserveClient | None = None,
) -> Generator[dict[str, Any], None, None]
Stream logs from OpenObserve with polling.
Continuously polls for new logs and yields them as they arrive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sql
|
str
|
SQL query to execute |
required |
start_time
|
str | int | None
|
Initial start time |
None
|
poll_interval
|
int
|
Seconds between polls |
5
|
client
|
OpenObserveClient | None
|
OpenObserve client |
None
|
Yields:
| Type | Description |
|---|---|
dict[str, Any]
|
Log entries as they arrive |
Source code in provide/foundation/integrations/openobserve/streaming.py
stream_search_http2
¶
stream_search_http2(
sql: str,
start_time: str | int | None = None,
end_time: str | int | None = None,
client: OpenObserveClient | None = None,
) -> Generator[dict[str, Any], None, None]
Stream search results using HTTP/2 streaming endpoint (sync wrapper).
This is a sync wrapper around the async streaming function for CLI use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sql
|
str
|
SQL query to execute |
required |
start_time
|
str | int | None
|
Start time |
None
|
end_time
|
str | int | None
|
End time |
None
|
client
|
OpenObserveClient | None
|
OpenObserve client |
None
|
Yields:
| Type | Description |
|---|---|
dict[str, Any]
|
Log entries as they stream |
Source code in provide/foundation/integrations/openobserve/streaming.py
stream_search_http2_async
async
¶
stream_search_http2_async(
sql: str,
start_time: str | int | None = None,
end_time: str | int | None = None,
client: OpenObserveClient | None = None,
) -> AsyncGenerator[dict[str, Any], None]
Stream search results using HTTP/2 streaming endpoint (async version).
Uses Foundation's transport for HTTP/2 streaming.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sql
|
str
|
SQL query to execute |
required |
start_time
|
str | int | None
|
Start time |
None
|
end_time
|
str | int | None
|
End time |
None
|
client
|
OpenObserveClient | None
|
OpenObserve client |
None
|
Yields:
| Type | Description |
|---|---|
AsyncGenerator[dict[str, Any], None]
|
Log entries as they stream |
Source code in provide/foundation/integrations/openobserve/streaming.py
tail_logs
¶
tail_logs(
stream: str = "default",
filters: dict[str, str] | None = None,
follow: bool = True,
lines: int = 10,
client: OpenObserveClient | None = None,
) -> Generator[dict[str, Any], None, None]
Tail logs similar to 'tail -f' command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stream
|
str
|
Stream name to tail |
'default'
|
filters
|
dict[str, str] | None
|
Dictionary of key-value pairs for filtering |
None
|
follow
|
bool
|
If True, continue streaming new logs |
True
|
lines
|
int
|
Number of initial lines to show |
10
|
client
|
OpenObserveClient | None
|
OpenObserve client |
None
|
Yields:
| Type | Description |
|---|---|
dict[str, Any]
|
Log entries |