Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace_chain must be array #423

Merged
merged 1 commit into from
Jan 3, 2019
Merged

Conversation

flachesis
Copy link
Contributor

@flachesis flachesis commented Nov 28, 2018

<?php
require __DIR__ . '/vendor/autoload.php';

use Rollbar\Rollbar;

function makeException($initLevel = 0, $level = 150)
{
    if ($initLevel >= $level) {
        return null;
    }
    $initLevel += 1;
    return new Exception("$initLevel exception", 0, makeException($initLevel, $level));
}

$exception = makeException();

$rollbar = Rollbar::init([
    'access_token' => '3051774ae88547b5a418ffa2302e8225',
    'environment' => 'development',
], false, false, false);
Rollbar::report_exception($exception);

@jessewgibbs
Copy link
Contributor

@flachesis thanks for the PR.

@ArturMoczulski can you please review?

@ArturMoczulski
Copy link
Contributor

The PR looks good although I'm not exactly sure what's the motivation behind this change. It looks like you might be running into an issue with the current implementation in your particular edge case. Can you describe what it is? From the code, I already see you're trying to use the deprecated report_exception method for some reason. Can you give us some more background?

@ArturMoczulski ArturMoczulski added this to the Spikes milestone Dec 17, 2018
@flachesis
Copy link
Contributor Author

flachesis commented Dec 17, 2018

we use rollbar-agent to report error in background. But the payload size is too large over the api limit, and rollbar-agent not delete the fail large file.

@ArturMoczulski
Copy link
Contributor

I'm still confused on how this PR achieves shrinking the payload.

Besides, truncation strategies have been modified in the latest master to adhere to the new API limit, so this problem shouldn't occur anymore if you update the SDK. The payload will be truncated to respect the API limit automatically. Can you confirm this is the case?

@jessewgibbs jessewgibbs removed this from the Spikes milestone Jan 2, 2019
@flachesis
Copy link
Contributor Author

I'm still confused on how this PR achieves shrinking the payload.

Besides, truncation strategies have been modified in the latest master to adhere to the new API limit, so this problem shouldn't occur anymore if you update the SDK. The payload will be truncated to respect the API limit automatically. Can you confirm this is the case?

Because we have another problem. We use laravel collection as function parameter, but the collection size is too large. StringsStrategy and FramesStrategy not truncate the args payload. I use custom_truncation to add my custom args truncation, and I reference the FramesStrategy class. I read the https://docs.rollbar.com/reference, I find out the trace_chain in the code and document is not match. this pr is not direct relation my problem.

@ArturMoczulski ArturMoczulski merged commit 462676f into rollbar:master Jan 3, 2019
@ArturMoczulski
Copy link
Contributor

I understand now. Thanks for catching this. Great PR. Merged into master and will be included in the upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants