Coder Social home page Coder Social logo

perl-redis-opentracing's Introduction

Redis::OpenTracing

Wrap Redis inside OpenTracing

Synopsis

package My::Awesome::Module;

use strict;
use warnings;

use Redis;
use Redis::OpenTracing;

my $redis = Redis::OpenTracing->new(
    redis => Redis->new( ... )
);

my $value = $redis->get 'my-key';

1;

Description

The example above will use the default Redis server (from $ENV{REDIS_SERVER}) and the Global Tracer (from $ENV{OPENTRACING_IMPLEMENTATION}. It will create span with the name Redis::GET, enriched with package / subroutine name and line number for easy debugging.

Author

Theo van Hoesel [email protected]

Copyright and License

'Redis::OpenTracing' is Copyright (C) 2021, Perceptyx Inc

This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. This library is distributed in the hope that it will be useful, but it is provided "as is" and without any express or implied warranties. For details, see the full text of the license in the file LICENSE.

perl-redis-opentracing's People

Contributors

s-nez avatar vanhoesel avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

s-nez vanhoesel

perl-redis-opentracing's Issues

Make `redis` attribute required

Lazy building is nice for 'lazy' developers, but would postpone errors to show up at runtime, rather than compile time for missing Redis clients.

On could hope that some Redis client would be lately build, but what if the needed Redis (or Fast) module would not be installed.

Making redis a required attribute, at least makes it clear in the caller application/module what to use/inject and not hope for magic to happen.

build `peer_address` is not working as expected

The following does not work for Redis::Fast

    return "@{[ $self->redis->{ server } ]}"
        if exists $self->redis->{ server };
    # currently, we're fine with any stringification of a blessed hashref too
    # but for Redis, Redis::Fast, Test::Mock::Redis, this is just a string

The 'thing' stored in redis is not always a hash (although it should be an Object).

Possibly check what Redis client is really use and make separate logic for each known client ?

Error on calling `quit` with `Redis::Fast`

We have a weird error, but not entirely sure where it is exactly coming from:

Error message: 
Usage: Redis::Fast::__quit(self) at /opt/perl/perls/perl-5.28.1/lib/site_perl/5.28.1/amd64-freebsd-thread-multi/Redis/Fast.pm line 319.

Add support for caller data

It would be nice to see where the Redis calls are made from, what file / package / subroutine / line-number.

Although, it may be very likely that in larger applications, Redis calls are obfuscated away in a more generic package.

Add 'Hit/Miss' tag

It would be great to see if a Redis call was a hit, or if the key/value pair did result in nothing at all.

This would of course only work for GET and alike commands.

CPAN tester run older versions of dependencies

Test do fail at some smoke testing environments. This is due to a outdated version of Test::MockObject. Our mocked Test::Mock::Redis::NoOp Redis client uses a feature to mock several methods with one single mock call.

We can approach this two ways:

  1. set the dependency minimal version
  2. change the code to do multiple calls

My personal preference is changing the code to allow it to run on platforms with older dependencies, unless there are buck in one of those (like we had with some releases of OpenTracing)

Add `resources` to MetaCPAN

Being publicly available, it should be more easy to find resources, where the git-repository can be found and where issues can be reported etc.

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.