Code Monkey home page Code Monkey logo

deep-python-client's People

Contributors

snyk-bot avatar umaaz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

deep-python-client's Issues

Error on shutdown

Describe the bug
When the application with deep is shutdown there is sometimes an error thrown.

To Reproduce
Reproduction is not easy. Essentially if deep shuts down while set_trace is running there can be an exception thrown.

Expected behavior
No exception on shutdown.

Desktop (please complete the following information):

  • OS: linux
  • Version: main
  • Python Version cpython 3.12

Additional context
Probably just need to add atexit handler.

Feature: span events

Is your feature request related to a problem? Please describe.
Add a span event for snapshots. As it is possible to have more than 1 snapshot within the scope of a span we should use events rather than attributes. This provides a scope to set the snapshot id, context id and tracepoint ids as attributes within the events. The events can then also set the name as the snapshot location, and provide scoped time.

Describe the solution you'd like
Call add_event when a snapshot is collected.

Default tracepoint logger is set to higher priority then new custom providers

Describe the bug
Creating a new tracepoint logger for deep requires the order to be set to -1 to override the default provider.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new plugin to act as tracepoint logger
  2. register the plugin
  3. it will not be used until the order is set to -1

Expected behavior
Shouldn't need to specify the order on custom plugins to override plugins that do not allow for multiple.

Desktop (please complete the following information):

  • Version [e.g. 22] main@ac1ec83e
  • Python Version [e.g. cpython 3.12] cpython 3.10

Additional context
Add any other context about the problem here.

Snapshot duration missing

Describe the bug
The snapshot duration is missing.

To Reproduce
Steps to reproduce the behavior:

  1. Send snapsshot
  2. see duration is missing

Expected behavior
Duration should be set to the time taken to process the sanpshot.

Screenshots
image

Desktop (please complete the following information):

  • Version [e.g. 22] 1.1.0
  • Python Version [e.g. cpython 3.12] cpython

Additional context
Add any other context about the problem here.

Otel metrics error when using api calls

Describe the bug
The error below is given when using the api to create tracepoints (_deep.register_tracepoint("simple_test.py", 41, metrics=[MetricDefinition("uuid_length", "histogram")])

2024-02-05 18:19:15,907 - deep - ERROR - Error registering metric histogram deep_uuid_length
Traceback (most recent call last):
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/deep/api/plugin/metric/otel_metrics.py", line 107, in histogram
    histogram = self.__check_cache(name, 'histogram',
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/deep/api/plugin/metric/otel_metrics.py", line 47, in __check_cache
    default = from_default()
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/deep/api/plugin/metric/otel_metrics.py", line 108, in <lambda>
    lambda: get_meter('deep').create_histogram(f'{namespace}_{name}', unit,
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/opentelemetry/sdk/metrics/_internal/__init__.py", line 193, in create_histogram
    ) = self._is_instrument_registered(name, _Histogram, unit, description)
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/opentelemetry/metrics/_internal/__init__.py", line 225, in _is_instrument_registered
    instrument_id = ",".join(
TypeError: sequence item 2: expected str instance, NoneType found

To Reproduce
Steps to reproduce the behavior:

  1. Use the api deep.register_tracepoint to create a metric with just a name a type.
  2. See error

Expected behavior
A metric should be created with default values.

Desktop (please complete the following information):

  • Python Version [e.g. cpython 3.12] cpython 3.10.12

Additional context
Add any other context about the problem here.

Missing tracepoint attribute

Describe the bug
The tracepoint attribute is missing from the snapshots. This affects the search in Deep.

To Reproduce
Steps to reproduce the behavior:

  1. Create a snapshot
  2. Inspect the attributes
  3. See error

Expected behavior
The attribute tracepoint should be attached to the snapshots to connect all snapshots to the tracepoint that triggered them.

Desktop (please complete the following information):

  • Version [e.g. 22] 1.1.0

Additional context
Add any other context about the problem here.

Simplify the usage of plugins in python

Is your feature request related to a problem? Please describe.
When customising the deep agent it is a bit awkward registering plugins.

Describe the solution you'd like
Some way to make it simpler such as:

deep.start({}, plugins=[MyDeepPlugin])

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.