Giter VIP home page Giter VIP logo

nlog-targets-azureeventhub's People

Contributors

rajcheval avatar rajinders avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

nlog-targets-azureeventhub's Issues

Disposing target does not close client

AzureEventHubTarget implements IDisposable, but does not do anything when the object is disposed. It should be freeing up the resources related to the event hub client.

Serialization Format?

What format is this serializing the events with? It looks like it's not JSON? Trying to apply stream analytics and as best I can tell the code is just taking the raw rendered layout string and not parsing it.

PartitionKey is not distributed in a round robin manner

According to this comment for the PartitionKey property the key should be distributed evenly using round robin if no partition key is set.

        /// <summary>
        /// PartitionKey is optional. If no partition key is supplied the log messages are sent to eventhub
        /// and distributed to various partitions in a round robin manner.
        /// </summary>
        public string PartitionKey { get; set; }

From what I can see there is, no code doing anything with the key if it is not set?

using (var eventHubData = new EventData(Encoding.UTF8.GetBytes(logMessage)) { PartitionKey = partitionKey })
 {
                foreach (var key in logEvent.Properties.Keys)
                {
                    eventHubData.Properties.Add(key.ToString(), logEvent.Properties[key]);
                }

                await _eventHubClient.SendAsync(eventHubData);
                return true;
} 

As such the behaviour defaults back to whatever the SendAsync method does with a blank partition key.

According to the MSDN documentation it must have the partitionkey set.

Remarks
Any EventData instance send operation using this method must have the PartitionKey set.

In our case this leads to that we are only writing to one of the partitions all the time since the partitionkey is not changing and thus all scale advantages with the eventhub is gone.

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.