OpenObserve
A library for sending logs to OpenObserve
Logi
Logs for library errors and for global_exception_logger are located at:
cd /home/$USER/.openobserve/logs/log.log
Configuration
import openobserve
openobserve.username = ''
openobserve.password = ''
openobserve.host = 'http://127.0.0.1:5080',
openobserve.stream_global = 'default' #default stream
openobserve.organization_global = 'default' #default organization
openobserve.ssl_verify = False #SSL host verification
openobserve.additional_info = False #additional data
openobserve.enable_threading = True #enable send logs in thread (speed up)
Sending a log
Fields _stream and _organization override stream_global and organization_global
def send(
job: Any = '',
level: str = 'INFO',
_stream: str = None,
_organization: str = None,
**kwargs
)
Example
import openobserve
openobserve.send(job='test', _return_data=True,message='test message')
Log:
{
'_timestamp': '2024-03-25T20:10:47.106',
'level': 'INFO',
'job': 'test',
'message': 'test message'
}
Additional data for openobserve.additionalinfo
{
'hostname': socket.gethostname(),
'user_name': socket.gethostname(),
'system': platform.system(),
'system_architecture': platform.machine(),
'system_version': platform.version(),
'system_release': platform.release(),
'python_version': platform.python_version()
}
Global error collection
Code for globally collecting errors from the project
import openobserve.global_exception_logger
print(1 / 0)
At this point, the log is sent to the server and saved on disk
Configuration
import openobserve.global_exception_logger
openobserve.global_exception_logger.organization_global = 'default'
openobserve.global_exception_logger.stream_global = 'default'
Metadata
Release files for openobserve 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openobserve-1.0.2.tar.gz | 3.9 kB | Without provenance | Details for openobserve-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openobserve-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for openobserve-1.0.2-py3-none-any.whl |
Total release size: 8.7 kB
Release files / openobserve-1.0.2.tar.gz
| Download URL | openobserve-1.0.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b12ced89b214fcf12bd4dda49deaa941cfded1330051cd7a86faffad21b35f27
|
|
BLAKE2b-256 checksum How to use checksums |
1bcecb9c1966fe5d6d34e2c2af4753178868abdae72e4f531df2301bb1ba25e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / openobserve-1.0.2-py3-none-any.whl
| Download URL | openobserve-1.0.2-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d487c976d0fbd76fb102d7d2bbf819e1ae0df83b2617c9fa1ea344d098643578
|
|
BLAKE2b-256 checksum How to use checksums |
f045a6cc7acb08134c686851d9002c189ed883ff9e9aae8ab3016eeb956e9a42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Security for openobserve 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.