GithubHelp home page GithubHelp logo

perl-raven's Introduction

Sentry::Raven version 1.14

Sentry::Raven is a module for sending events to a sentry service.

SYNOPSIS

  use Sentry::Raven;
  my $raven = Sentry::Raven->new(sentry_dsn => 'https://<publickey>:<secretkey>@sentry.io/<projectid>' );
  $raven->capture_message('The sky is falling');

INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install

DEPENDENCIES

Perl 5.10 or later.

COPYRIGHT AND LICENSE

Copyright (C) 2020 by Matt Harrington

The full text of this license can be found in the LICENSE file included with this module.

perl-raven's People

Contributors

dakkar avatar dariuszpiwowarski avatar dcramer avatar heytrav avatar jeteve avatar jrubinator avatar mizor avatar mwiencek avatar nowaker avatar querry43 avatar slobo avatar stuartskelton avatar tomhukins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

perl-raven's Issues

Make ->$foo_context behave more like ->capture_$foo

Right now the various ->$foo_context methods (eg. request_context) return only the appropriate context.

Eg. if you do

my %returned_context = Sentry::Raven->request_context(
    %relevant_request_information,
    tags => { foo => 'bar' }
);

then %returned_context will not contain any information about those tags (and there will be no warnings).

This can be surprisingly different than the capture_request call (which does observe non-request context), and besides can lead to slightly over-verbose code like:

    my ($url, %context) = get_sentry_context_from_request($req);
    $sentry->capture_message($message, %context, Sentry::Raven->request_context($url, %context));

(instead of

    my ($url, %context) = get_sentry_context_from_request($req);
    $sentry->capture_message($message, Sentry::Raven->request_context($url, %context));

)

Would you have any interest in a patch to make request_context and company behave more like their capture_ counterparts (and also allow chaining)?

Display source code directly in Sentry?

It'd be nice if Sentry::Raven could also gather partial source code around each line of the stacktrace. This is how it looks out of the box for Python events:

image

Test case 15 failed

I got this when trying cpanm Sentry::Raven:

t/11-generic-event.t ...... ok
t/12-specialized-event.t .. ok
t/13-service-call.t ....... ok
t/14-does-not-die.t ....... ok

    #   Failed test at t/15-error-handler.t line 58.
    #          got: '8'
    #     expected: '7'

    #   Failed test at t/15-error-handler.t line 60.
    #          got: 'Sentry::Raven::__ANON__'
    #     expected: 'main::c'

    #   Failed test at t/15-error-handler.t line 61.
    #          got: 'Sentry::Raven'
    #     expected: 'main'

    #   Failed test at t/15-error-handler.t line 62.
    #          got: '/home/wqmisc/.cpanm/work/1598799198.18017/Sentry-Raven-1.13/blib/lib/Sentry/Raven.pm'
    #     expected: 't/15-error-handler.t'

    #   Failed test at t/15-error-handler.t line 63.
    #          got: 'Raven.pm'
    #     expected: '15-error-handler.t'

    #   Failed test at t/15-error-handler.t line 64.
    #          got: '239'
    #     expected: '34'
    # Looks like you failed 6 tests of 6.

#   Failed test 'stacktrace'
#   at t/15-error-handler.t line 65.
# Looks like you failed 1 test of 5.

Perl version is 5.16.2

Sentry not reporting subsequent events

Hello,

We're having a problem where subsequent events of an exception aren't being reported to sentry.

Basically we created a test file, cause an error it reports to sentry normally. Then we rerun but there's only one recorded event of the exception.

We're using VERSION: 1.10 with Sentry 8.20.0.

test.pl

use Sentry::Raven;
use strict;
use warnings;

sub sentry {
    return Sentry::Raven->new(sentry_dsn => <our-dsn>);
}

1;

We saw this error before in a python backend once, is this a bug in the Sentry::Raven perl module?

Using DSNs without secret key

Environment

Sentry SaaS (sentry.io)
Sentry::Raven 1.13 in Perl 5.26.1 on Ubuntu 18.04.

Steps to Reproduce

Define a SENTRY_DSN environment variable or pass a sentry_dsn attribute without secret key (as defined at The Parts of the DSN) to

Sentry::Raven->new();

Expected Result

The initialization should happen silently.

Actual Result

The initialization fails with the error

unable to parse public and secret keys from: <SENTRY_DSN>

This originates from

die "unable to parse public and secret keys from: $sentry_dsn\n"

Even examples (e.g. at JavaScript configuration) show this type of usage. Since the other client libraries (like Python or JavaScript) can handle it, so should the Perl client. Checking for the colon in the userinfo shouldn't be enforced.

My current workaround: Adding : (ie. an empty secret key) before the @ in the DSN.

Stacktrace Order

Got a support ticket suggesting the stacktrace frame order might be backwards in the Perl SDK.

SDK Docs

I put up some informal docs for the Perl client on our new docs.getsentry.com site:

https://docs.getsentry.com/hosted/clients/perl/

We'd love to move this into the repo to support some various behaviors. If that sounds good, there's a couple of approaches we'd prefer to take:

  1. Add a few of us as collaborators here
  2. Let us move the repo to the getsentry org space (we'll retain the current permissions)

It's unlikely we'll be able to help maintain the SDK itself (as none of us use Perl), but we can help out with some of the community/documentation things.

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.