Skip to main content

OpenObserve library

Project description

OpenObserve

Biblioteka do wysyłania logów do OpenObserve

Logi

Logi błędów biblioteki oraz dla global_exception_logger to:

cd /home/$USER/.openobserve/logs/log.log

Konfiguracja

import openobserve
openobserve.username = ''
openobserve.password = ''
openobserve.host = 'http://127.0.0.1:5080',
openobserve.stream_global = 'default' #domyślny stream
openobserve.organization_global = 'default' #domyślna organizacja
openobserve.ssl_verify = False #weryfikacja ssl hosta
openobserve.additional_info = False #dodatkowe dane

Wysyłanie loga

pola _stream oraz _organization nadpisują stream_global oraz organization_global

def send(
    job: Any = '',
    level: str = 'INFO',
    _stream: str = None,
    _organization: str = None,
    **kwargs
)

Przykład

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'
}

Dodatkowe dane dla openovserver.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()
}

Globalne zbieranie błędow

Kod do globalnego zbierania błędów z projektu

import openobserve.global_exception_logger

print(1 / 0)

W tym momencie log wysyła się na serwer oraz zapisuje na dysku

Konfiguracja

import openobserve.global_exception_logger

openobserve.global_exception_logger.organization_global = 'default'
openobserve.global_exception_logger.stream_global = 'default'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openobserve-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

openobserve-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file openobserve-1.0.0.tar.gz.

File metadata

  • Download URL: openobserve-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for openobserve-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c315fc5364f63bbeb9ccc50e28b81db0b39b38f6b6c674c5788e733855867a90
MD5 3d4da7750e1d2904d24ccc46369aaf06
BLAKE2b-256 28d7de2435b06a16cff0daaa23fcd58b8f2052445e7335d770a332f7cd6382bb

See more details on using hashes here.

File details

Details for the file openobserve-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: openobserve-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for openobserve-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7ceffac9671a6e59e8a9a7da6b33b2f0b026e3a9f8348082c5b216eca6500d3
MD5 e5b566bce2a0c09ea825f5e122ec3f91
BLAKE2b-256 b8376ff9c6983b921329da30af15fcf775fd6a4f9f5b5436e597b88a253ce754

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page