Skip to main content

IraWatch client for Python

Project description

IraWatch

This is a client library which sends traces to IraWatch collector.

Install

pip install setuptools
pip install git+ssh://git@github.com/darylac/irawatch.git
import nats

# It is important to have a import statement like this. `from irawatch.trace import Tracer, Span` won't work due to design considerations.
from irawatch import trace

nc = await nats.connect()

# Initialise tracer when application starts up
trace.Tracer(service_name="App A", nats_conn=nc)

# The trace ID must be 16 bytes. UUID4 is 16 bytes, so can be used.
trace_id = uuid.uuid4().bytes

# Every time you want to send a trace, you do the following
span = trace.Span(name="Task A", trace_id=trace_id).start()
time.sleep(2) # some task
await span.stop() # when you invoke stop, it will send the trace to the collector.

span = trace.Span("Task B", trace_id).start()
time.sleep(3)
await span.stop(attributes={"attr1": "val1"}) # the attributes argument takes dict where key is string and value is any valid JSON value

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

irawatch-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

irawatch-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file irawatch-0.1.0.tar.gz.

File metadata

  • Download URL: irawatch-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for irawatch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 64d90a3770c557550b611d2a4be963e365692668b2300c50fc2a046013a8be60
MD5 fea555b2d51db7dbf499b5620322dabb
BLAKE2b-256 dbfab362eb9bae1e1c69d62efe27338538ac698626c8c742fb8825ed2fa62f54

See more details on using hashes here.

File details

Details for the file irawatch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: irawatch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for irawatch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75cd3e7615aab167eb8810b400a50bc4bd4583e708402532087c045b0c57c548
MD5 5282eebabedc9a19a9254a7feaaccb62
BLAKE2b-256 3abae1b5b9727173a937d29eb7369bb642e51f2e68bd11aa82d9fd4974f7f1d2

See more details on using hashes here.

Supported by

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