Code Monkey home page Code Monkey logo

nameko-tracer's Introduction

Nameko

[nah-meh-koh]

A microservices framework for Python that lets service developers concentrate on application logic and encourages testability.

A nameko service is just a class:

# helloworld.py

from nameko.rpc import rpc

class GreetingService:
    name = "greeting_service"

    @rpc
    def hello(self, name):
        return "Hello, {}!".format(name)

You can run it in a shell:

$ nameko run helloworld
starting services: greeting_service
...

And play with it from another:

$ nameko shell
>>> n.rpc.greeting_service.hello(name="ナメコ")
'Hello, ナメコ!'

Features

  • AMQP RPC and Events (pub-sub)
  • HTTP GET, POST & websockets
  • CLI for easy and rapid development
  • Utilities for unit and integration testing

Getting Started

Support

For help, comments or questions, please go to https://discourse.nameko.io/.

For enterprise

Available as part of the Tidelift Subscription.

The maintainers of Nameko and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Contribute

  • Fork the repository
  • Raise an issue or make a feature request

License

Apache 2.0. See LICENSE for details.

nameko-tracer's People

Contributors

fobiols avatar gianchub avatar iky avatar juliotrigo avatar kooba avatar kylesome avatar mattbennett avatar stephenc-pace avatar timbu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nameko-tracer's Issues

Suggest to loosen the dependency on nameko

Hi, your project nameko-tracer(commit id: 0f9e321) requires "nameko==2.8.5" in its dependency. After analyzing the source code, we found that the following versions of nameko can also be suitable, i.e., nameko 2.8.3, 2.8.4, since all functions that you directly (16 APIs: nameko.utils.init.get_redacted_args, nameko.extensions.DependencyProvider.init, nameko.testing.utils.get_extension, nameko.testing.services.entrypoint_hook, nameko.messaging.Consumer.init, nameko.extensions.Entrypoint.decorator, nameko.rpc.Rpc.init, nameko.exceptions.get_module_path, nameko.extensions.Entrypoint.decorator, nameko.testing.utils.DummyProvider.init, nameko.events.EventHandler.init, nameko.containers.WorkerContext.init, nameko.extensions.Entrypoint.decorator, nameko.web.handlers.HttpRequestHandler.init, nameko.extensions.Entrypoint.decorator, nameko.extensions.Entrypoint.decorator) or indirectly (propagate to 0 nameko's internal APIs and 15 outsider APIs) used from the package have not been changed in these versions, thus not affecting your usage.

Therefore, we believe that it is quite safe to loose your dependency on nameko from "nameko==2.8.5" to "nameko>=2.8.3,<=2.8.5". This will improve the applicability of nameko-tracer and reduce the possibility of any further dependency conflict with other projects.

May I pull a request to further loosen the dependency on nameko?

By the way, could you please tell us whether such an automatic tool for dependency analysis may be potentially helpful for maintaining dependencies easier during your development?

JSONFormatter: Object of type 'Stage' is not JSON serializable

Hi,

When using nameko_tracer.formatters.JSONFormatter, logging fails with the following trace:

--- Logging error ---
Traceback (most recent call last):
  File "c:\Users\chris.platts\AppData\Local\Programs\Python\Python36-32\lib\logging\handlers.py", line 633, in emit
    s = self.makePickle(record)
  File "c:\Users\chris.platts\Dropbox\platform-tool-svc\process-service\env\lib\site-packages\graypy\rabbitmq.py", line 74, in makePickle
    return json.dumps(message_dict)
  File "c:\Users\chris.platts\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "c:\Users\chris.platts\AppData\Local\Programs\Python\Python36-32\lib\json\encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "c:\Users\chris.platts\AppData\Local\Programs\Python\Python36-32\lib\json\encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "c:\Users\chris.platts\AppData\Local\Programs\Python\Python36-32\lib\json\encoder.py", line 180, in default
    o.__class__.__name__)
TypeError: Object of type 'Stage' is not JSON serializable
Call stack:
  File "c:\Users\chris.platts\Dropbox\platform-tool-svc\process-service\env\lib\site-packages\eventlet\greenthread.py", line 219, in main
    result = function(*args, **kwargs)
  File "c:\Users\chris.platts\Dropbox\platform-tool-svc\process-service\env\lib\site-packages\nameko\containers.py", line 411, in _run_worker
    self._worker_result(worker_ctx, result, exc_info)
  File "c:\Users\chris.platts\Dropbox\platform-tool-svc\process-service\env\lib\site-packages\nameko\containers.py", line 432, in _worker_result
    provider.worker_result(worker_ctx, result, exc_info)
  File "c:\Users\chris.platts\Dropbox\platform-tool-svc\process-service\env\lib\site-packages\nameko_tracer\dependency.py", line 95, in worker_result
    extra=extra)
Message: '[%s] entrypoint result trace'
Arguments: ('process_service.start_job.97879a32-41db-4bed-a6c8-9db1cdf82242',)

Environment is:

  • Windows 10
  • Python v3.6.3
  • nameko_tracer v 1.2.0

A quick fix appears to be to use 'stage': constants.Stage.request.value rather than 'stage': constants.Stage.request

Use local timestamp instead of UTC

Hi,
While generating trace logs, timestamp generated is in UTC time. How can I use local timestamp instead of UTC time.

Environment:

  • Ubuntu 20.04
  • Python 3.8.10
  • nameko_tracer 1.3.0

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.