Giter Site home page Giter Site logo

Comments (9)

mabead avatar mabead commented on May 27, 2024

I find it weird that we see:

  • number of Attemps = 8: this implies that _backo._attempt = 8
  • Has Backed reached max = true : this implies that _currentAttemptTime >= _max which is the same as _currentAttemptTime >= 10000.
    I am not sure that I understand the code correctly but it lets me think that you will wait/retry for at most 10 seconds. This may be a little short if you eventually hit an http timeout.

from analytics.net.

mabead avatar mabead commented on May 27, 2024

In case it can help, I have attached somme logs coming from Analytics.Net before/after the error.

loggly_grid_2021-03-30 12_20_25.408029.log

from analytics.net.

mabead avatar mabead commented on May 27, 2024

The batch that failed to be sent is the one with id 44eb04cb-3947-4c35-b817-ba91f28ac983. I searched in my logs for this specific ID and I only found this:

image

It therefore looks to me like it was only retried once and not 8 times.

from analytics.net.

mabead avatar mabead commented on May 27, 2024

Once again, I suggest that you add logs here.

image

This is probably hidding something.

from analytics.net.

juliette-ruchel avatar juliette-ruchel commented on May 27, 2024

@mabead May I ask if you have any custom settings for the configuration of the client or are you just using the default values of the configuration?

from analytics.net.

mabead avatar mabead commented on May 27, 2024

@juliette-ruchel Here's how we initialize the segment client:

using SegmentSdk = Segment;
// ...
private void Initialize()
{
    var segmentConfig = new SegmentSdk.Config()
        .SetAsync(_configuration.SendMessagesAsynchronously); // SendMessagesAsynchronously = true

    if (!string.IsNullOrEmpty(_configuration.DotNetBackEndSourceKey))
    {
        LandrMusicClient = new SegmentSdk.Client(_configuration.DotNetBackEndSourceKey, segmentConfig);
        LandrMusicClient.Failed += LogFailure;
    }

    SegmentSdk.Logger.Handlers += LogSegmentEvent;
}

private void LogFailure(SegmentSdk.Model.BaseAction action, Exception e)
{
    string details = null;
    if (e != null)
    {
        details = e.Message;
    }

    _logger.LogError(LoggingEvents.SegmentFailure, e, $"Failed to send analytic event {action.Type} for user {action.UserId} and message {action.MessageId} to segment.io server. Details: {details}");
}

private void LogSegmentEvent(SegmentSdk.Logger.Level level, string message, IDictionary<string, object> args)
{
    var fullMessage = message;

    if (args != null)
    {
        fullMessage += " " + string.Join(", ", args.Select(x => $"{x.Key}: {x.Value}"));
    }

    switch (level)
    {
        case SegmentSdk.Logger.Level.DEBUG:
            _logger.LogDebug(LoggingEvents.SegmentLog, fullMessage);
            break;
        case SegmentSdk.Logger.Level.INFO:
            _logger.LogInformation(LoggingEvents.SegmentLog, fullMessage);
            break;
        case SegmentSdk.Logger.Level.WARN:
            _logger.LogWarning(LoggingEvents.SegmentLog, fullMessage);
            break;
        case SegmentSdk.Logger.Level.ERROR:
            _logger.LogError(LoggingEvents.SegmentLog, fullMessage);
            break;
        default:
            _logger.LogError(LoggingEvents.SegmentLog, $"Unknown segment logging level {level} => {fullMessage}");
            break;
    }
}

We are therefore using the default values.

from analytics.net.

juliette-ruchel avatar juliette-ruchel commented on May 27, 2024

Thanks for the information!
I believe the issue may be related to the response being null thus the status code is returned is 0.
This may mean that we are entering either the HttpRequestException o TaskCancelledException catch. We are working on adding a few more logs to determine the exact issue.

from analytics.net.

pooyaj avatar pooyaj commented on May 27, 2024

hey @mabead, would you mind doing a quick sanity check of this #164 to confirm it solves this issue?

from analytics.net.

mabead avatar mabead commented on May 27, 2024

@pooyaj I could give it a try but I don't see a new version of Analytics.net available on nuget. As soon as you have a new version, I will be able to try it out.

from analytics.net.

Related Issues (20)

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.