Code Monkey home page Code Monkey logo

diagnostics-eventflow's People

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

diagnostics-eventflow's Issues

ServiceFabric + ETW : behavior issue

Hello,

Based on your documentation, the code with service fabric is :

        using (var diagnosticsPipeline = ServiceFabricDiagnosticPipelineFactory.CreatePipeline("MyApplication-MyService-DiagnosticsPipeline"))
        {
            ServiceRuntime.RegisterServiceAsync("MyServiceType", ctx => new MyService(ctx)).Wait();

            ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(MyService).Name);

            Thread.Sleep(Timeout.Infinite);
        }

I use the ETW input but each time the service starts, a new TraceEventSession is created by this code in StandardTraceEventSession.cs :

this.inner = new TraceEventSession($"EventFlow-{nameof(EtwInput)}-{Guid.NewGuid().ToString()}", TraceEventSessionOptions.Create);

But when i request a stop to the service, Service Fabric engine should force the program exit : the DiagnosticPipeline Dispose seems to be never called. So the TraceEventSession stays running. After several restarts I have a system resource error because of the limit of maximum running TraceEventSession allowed by Windows.
I did a workaround with an event in my Stateless service which is triggered on OnClose and OnAbort methods to be able to call the DiagnosticPipeline Dispose method to free the running TraceEventSession.

        using (var diagnosticsPipeline = ServiceFabricDiagnosticPipelineFactory.CreatePipeline("MyApplication-MyService-DiagnosticsPipeline"))
        {
            ServiceRuntime.RegisterServiceAsync("MyServiceType", ctx => {
                    var service = new MyService(ctx);
                    service.OnStopping += diagnosticsPipeline.Dispose();
                    return service;
            }).Wait();

            ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(MyService).Name);

            Thread.Sleep(Timeout.Infinite);
            // Code here never called
        }

Is there a better way to Dispose the TraceEventSession ? Maybe it is a question for ServiceFabric team.

Shutdown of DataPipeline may lead to data loss

Repro:

bool cont = true;

            Console.WriteLine("String Logger!");

            while (cont)
            {
                Console.WriteLine();
                Console.WriteLine("Enter any text to log. Entering 'X' will exit.");
                string input = Console.ReadLine().Trim();

                if (input.Equals("X", StringComparison.InvariantCultureIgnoreCase))
                {
                    cont = false;
                }
                else
                {
                    using (var pipeline = DiagnosticPipelineFactory.CreatePipeline("eventFlowConfig.json"))
                    {
                        
                        System.Diagnostics.Trace.TraceWarning($"TraceWarning: {input}");
                        Console.WriteLine($"{input} logged.");
                    }
                }
            }

Expected -- if you run the program above with Trace input and StdOutput you should see the logs

Actual -- because the pipeline is destroyed immediately after the trace is submitted, no logs show up in the output

Need an operator for the "is keyword set" test

In the current implementation none of the operators supported by expression allow for easy testing of individual keywords. We need an operator for that (to test that all bits in the keyword mask are set)

Something like this:

  "filters" : [
    {
      "type": "drop",
      "include": "Keywords &== 0x4"
    }
  ]

We probably also need an operator that checks whether none of the bits in the keyword mask are set (perhaps !== makes sense as a symbol for this operation)

ElasticSearchOutput failed to send health data

Trying to send logs from service fabric to elasticsearch (setup using the documentation from: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-diagnostic-how-to-use-elasticsearch). Followed through the instruction and try to send log from service fabric. Got the following exceptions:

...
ElasticSearchOutput: diagnostics data upload has failed.
System.ArgumentException: Value does not fall within the expected range.
at System.Fabric.Interop.NativeClient.IFabricHealthClient3.ReportHealth(IntPtr healthReport)
at System.Fabric.FabricClient.HealthClient.ReportHealthHelper(HealthReport healthReport)
at System.Fabric.Interop.Utility.<>c__DisplayClass13.b__12()
at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func`1 func, String functionTag, String functionArgs)
at System.Fabric.Interop.Utility.RunInMTA(Action action)
at System.Fabric.FabricClient.HealthClient.ReportHealth(HealthReport healthReport)
at Microsoft.Diagnostics.EventFlow.ServiceFabric.ServiceFabricHealthReporter.ReportMessage(HealthState healthState, String description)
at Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearchOutput.ReportEsRequestError(IResponse response, String request)
at Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearchOutput.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearchOutput.d__6.MoveNext()

The same set up works without an issues in an local cluster. ElasticSearch version is 5.1.1. Eventflow is the using the latest version 1.1.0.

Roadmap

Hi there,

can you share what the roadmap is for this library? I've noticed not all input and outputs are supported on .Net Core. Will that change in the (near) future or is there a limitation that causes it to never reach the .Net Core platform?

EventFlow vs. Semantic Logging

Hi, since Semantic Logging is also from Microsoft, I'm wondering what your guidance is on when we should use which.

It seems like the main difference is that Semantic Logging can be used out-of-process, however there hasn't been much activity lately and the new .NET 4.6 features (rich payload, ...) are not yet supported.

Template missing from Serilog input

The template in Serilog messages is a great way to consistently match the source of the message independent of the values in the message. Optionally including the template as part of the output would be very useful.

filter documentation or filter may need to be modified

for the json filtering section it seems like it is looking for EventId instead of id as the documentation indicates. The include statement I used was "include": "ProviderName == MyProvider && EventId == 7", instead of "include": "ProviderName == MyProvider && id == 7",

Output provider for Splunk

We have a need for an output provider for writing events to Splunk indexer. I'm quite surprised that Elasticsearch support is provided whereas Splunk is not.

Given how (relatively) trivial it is to implement an output provider, we can certainly build our own. But given Splunk's market penetration, I'm a bit surprised that there isn't one already implemented.

Is there one planned in the roadmap, and if not, are you folks open to accepting one here, or should we open our own github repo for this?

Using Microsoft.Extensions.Logging as input and logging an exception does not TrackException when using Application Insights as output

I have a test .Net Core application that is setup with the standard .net core logging as an input and application insights as an output.

My issue is that I see a trace message in application insights but not the exception as a tracked exception. Is this a bug?

The Code:

           using (var pipeline = DiagnosticPipelineFactory.CreatePipeline("eventFlowConfig.json"))
            {
                var factory = new LoggerFactory()
                    .AddEventFlow(pipeline);

                var logger = new Logger<Program>(factory);
                
                logger.LogError(new EventId(12345), new Exception("My exception"), "Some exception happened");
            }

The Config: "eventFlowConfig.json"

{
  "inputs": [
    {
      "type": "Trace",
      "traceLevel": "Verbose"
    },
    {
      "type": "Microsoft.Extensions.Logging"
    }

  ],
  "filters": [
  ],
  "outputs": [
    {
      "type": "ApplicationInsights",
      "instrumentationKey": "[MyKey]"
    }
  ],
  "schemaVersion": "2016-08-11",
 "extensions": []
}

Project Dependencies:

<ItemGroup>
    <PackageReference Include="Microsoft.Diagnostics.EventFlow" Version="1.1.0" />
    <PackageReference Include="Microsoft.Diagnostics.EventFlow.Inputs.ApplicationInsights" Version="1.1.0" />
    <PackageReference Include="Microsoft.Diagnostics.EventFlow.Inputs.EventSource" Version="1.1.1" />
    <PackageReference Include="Microsoft.Diagnostics.EventFlow.Inputs.MicrosoftLogging" Version="1.1.2" />
    <PackageReference Include="Microsoft.Diagnostics.EventFlow.Inputs.Trace" Version="1.1.0" />
    <PackageReference Include="Microsoft.Diagnostics.EventFlow.Outputs.ApplicationInsights" Version="1.2.0" />
    <PackageReference Include="Microsoft.Diagnostics.EventFlow.Outputs.StdOutput" Version="1.1.0" />
    <PackageReference Include="System.Diagnostics.Tracing" Version="4.3.0" />
  </ItemGroup>

Microsoft.Diagnostics.EventFlow.Inputs.Serilog Nuget package Dependency

Microsoft.Diagnostics.EventFlow.Inputs.Serilog 1.2.2 is dependent on Microsoft.Diagnostics.EventFlow.Core (>= 1.1.6) which currently can not be met as 1.1.6 is not released yet.

Microsoft.Diagnostics.EventFlow.Inputs.Serilog 1.2.1 was dependent on Microsoft.Diagnostics.EventFlow.Core (>= 1.1.0) maybe it is a possibility to step back to this Version dependency?

Configuration of eventFlowConfig.json in Service Fabric at Application level

I would like to be able to override settings in eventFlowConfig.json when using Service Fabric at the Application level.

This is order that I can have specify a different Application Insights Key in an Application Parameter file i.e. Dev, Pre-Prod and Prod and then have the Service use that key, rather than hard-coding it at the service level.

The ability to add Nested Scopes when using MicrosoftLogging input

Would it be possible to add the ability to add all nested scopes in the payload.

using (logger.BeginScope("Test:{Test}", "Test")) { logger.LogInformation("Test Scoped Info"); using (logger.BeginScope("Test1:{Test1}", "Test1")) { logger.LogInformation("Test Scoped 2 Info"); } logger.LogInformation("Test Scoped Info"); }

Here it would be nice for the payload to have a property of "Test" with value "Test" for log entries before and after the nested scope. Then the log entry in the nested scope would have a payload with properties, "Test" = "Test" and "Test1" = "Test1".

Creating Custom Output Extensions

How does one create a custom output. I've take the code form the standard output sink but when hooking things up it does not work (as in, no breakpoint are hit, no error messages appear.

I think I need more info about what to put into the extensions configuration of the config file.

ServiceFabric + ApplicationInsights - System.NullReferenceException

Hi Team,

I'm currently experiencing an issue where a Microsoft.Diagnostics.EventFlow.Outputs.ApplicationInsightsOutput.AddProperties is throwing a NullReferenceException in a ServiceFabric cluster. I cannot replicate the issue running the applications in my local cluster.

Here is the error I'm seeing in the Service Fabric Explorer:

Error event: SourceId='My-DiagnosticPipeline', Property='Connectivity'.
Diagnostics data upload has failed.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Diagnostics.EventFlow.Outputs.ApplicationInsightsOutput.AddProperties(ISupportProperties item, EventData e)
at Microsoft.Diagnostics.EventFlow.Outputs.ApplicationInsightsOutput.SendEventsAsync(IReadOnlyCollection`1 events, Int64 transmissionSequenceNumber, CancellationToken cancellationToken)

Any help would be much appreciated.
Cheers
Keagan

Collecting performance counters from other process into counters of current process

Hi team!

We're trying to collect performance counters from other process and send it via EventFlow of the current process of a console application that will act as an agent (or even in a test).

To achieve this we replace counter and category names before creating diagnostic pipeline. You can find code sample and configuration in the attached archive.

We assume that our attempts fail because performance counters of current process are read only (as per ProcessInstanceNameCache.cs file

Could you please have a look and let me know if our approach is feasible or should we try implementing custom input for this?

EventFlowPOC.zip

P.S. Sorry if this is wrong place to post such questions but didn't find other places to ask.

System.ArgumentException: The key already existed in the dictionary

Hello,

I am using the Application Insights output and the EventSource input with an application that I wrote for Service Fabric. My application itself is heathy, but the EventSource pipeline is throwing this exception (copied from the Service Fabric Explorer window):

Error event: SourceId='WeatherAPI-WeatherAPIService-DiagnosticsPipeline', Property='Connectivity'.
Diagnostics data upload has failed.
System.ArgumentException: The key already existed in the dictionary.
at System.Collections.Concurrent.ConcurrentDictionary2.System.Collections.Generic.IDictionary.Add(TKey key, TValue value) at Microsoft.Diagnostics.EventFlow.Outputs.ApplicationInsightsOutput.AddProperties(ISupportProperties item, EventData e, Boolean setTimestampFromEventData) at Microsoft.Diagnostics.EventFlow.Outputs.ApplicationInsightsOutput.SendEventsAsync(IReadOnlyCollection1 events, Int64 transmissionSequenceNumber, CancellationToken cancellationToken)

What is this error telling me? I'm not sure what dictionary it is keeping, its keys, or what that has to do with connectivity.

Service Fabric overrides don't allow null

In some sections eg the drop filter it seems that null is a valid value for the include property

if (string.IsNullOrWhiteSpace(value))
{
this.Evaluator = PositiveEvaluator.Instance.Value; // Empty condition == include everything
}

However in the service fabric settings overrides, null gets ignored when using replacement

string newValue = configurationRoot[valueReferencePath];
if (string.IsNullOrEmpty(newValue))
{
healthReporter.ReportWarning(
$"Configuration value reference '{kvp.Value}' was encountered but no corresponding configuration value was found using path '{valueReferencePath}'",
EventFlowContextIdentifiers.Configuration);
}

If i am translating the intention here then this flag check should instead trigger if the setting is not available from configurationRoot and not when the returned value is null or empty

eventFlowConfig.json not added when ServiceFabric extension is added from nuget

When I add the service fabric the json config file is not added. Per the current implementation in preview 3, the json file should probably be added and placed in the Config folder so that once packaged the config file will be found in the config package as the Event Flow pipeline for Service Fabric is expecting.

Verify all output types produce UTC timestamps

Currently the EventHub output does not produce the 'time' field using a proper UTC string. It would be prudent to double-check that all the existing outputs use the same DateTime output format.

Cannot add custom output via extensions section

The DiagnosticPipelineFactory ignore extensions for custom outputs specified in the extensions section (following instruction given is #41).

Way to reproduce, Change "StdOutput" to any other name (such as "MyOutput" not of the provided standard outputs in the CanOverrideDefaultPipelineItems unit test. The test will fail.

Debugging through the code, ProcessSection in DiagnosticsPipelineFactory only process predefined outputs keys. Since "MyOutput" is not processed, so it is ignored even though outputFactories already have the entry defined.

Seeing TPL events as traces in AppInsights

When deploying an app with Service Fabric and pushing its diagnostics to Application Insights from EventFlow, TPL event traces show up.

eventflow traces

We were able to use a filter to remove these from showing up, but in general, these should probably be removed anyway.

There is a health event with same SourceId and Property with equal or higher sequence number. ServiceFabric + ApplicationInsights

Hi @karolz-ms,

I'm now seeing this error while upgrading a ServiceFabric application via VSTS release management.
This causes the release to fail, occasionally the release succeeds without any errors, or if the release is rolled back due to the error after 15 - 30 minutes the error disappears and you no longer see it in the ServiceFabric explorer.

Error event: SourceId='My-DiagnosticPipeline', Property='Connectivity'.
Diagnostics data upload has failed.
System.Fabric.FabricException: There is a health event with same SourceId and Property with equal or higher sequence number. Health report versus existing sequence numbers: 131341925004487551, 131341925006674981. ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80071C11
at System.Fabric.Interop.NativeClient.IFabricHealthClient3.ReportHealth(IntPtr healthReport)
at System.Fabric.FabricClient.HealthClient.ReportHealthHelper(HealthReport healthReport)
at System.Fabric.Interop.Utility.<>c__DisplayClass13.b__12()
at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func1 func, String functionTag, String >functionArgs) --- End of inner exception stack trace --- at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func1 func, String functionTag, String >functionArgs)
at System.Fabric.Interop.Utility.RunInMTA(Action action)
at System.Fabric.FabricClient.HealthClient.ReportHealth(HealthReport healthReport)
at >Microsoft.Diagnostics.EventFlow.Outputs.ApplicationInsightsOutput.SendEventsAsync(IReadOnlyCollection`1 events, Int64 transmissionSequenceNumber, CancellationToken cancellationToken)

Any help again would be much appreciated.
Cheers
Keagan

Duplicated properties

Some of the inputs allow additional properties to be passed with message and such properties are added to EventData.Payload.
Such inputs are

  • EventSource
  • Serilog

However, they may have the same key as predefined payload properties such as Message or EventId.
We should make sure inputs handle this case in the same way. See Karol's comment on #18

Agreed that all inputs should behave the same way. Feel free to open an issue about this and we can deal with it as a separate change.

I think whatever the original event carries should take priority over what the input adds. So if there is a "Message" property on the event, we should not overwrite it. We could either skip input additions completely or make the added property name unique, e.g. by appending random number at the end of the name. These are, essentially, variations of the (1) option you have. I have slight preference for the latter.

I do not think using a separate dictionary is a good idea. It will make the output code and, ultimately, consumption of the data much more complicated, for a marginal benefit.

Oh, and I would just report a warning, not an error, if a name collision happens, esp. if you decide to make the added property name unique and include the data, mitigating the conflict.

Application Insights, how can I prevent Exceptions from being recorded as Traces

Hi,

I'm using Event Flow with Service Fabric, SeriLog and Application Insights.

When an Exception is logged by my application, Serilog's Log.Error is called and I can see the Error in Application Insights Traces, however, I was hoping to see the Error recorded as an Exception within Application Insights.

The Custom Data section of the Trace shows that the Level was Error, so I think I've got everything wired up correctly. As is stands, the exceptions will be hard to spot along with all other legitimate Traces.

Is there a way to force the Application Insights output library to do this or is this a responsibility of the Serilog input library?

Thanks

Application Insight Exception metadata type with EvenSource input

I'm using EventSource as the input and AI as an output. Looking at the documentation
here, in the section that relates to applying metadata to AI exception type,

The name of the event property that carries the (unexpected) exception object. Note that (for maximum information fidelity) the expected type of the event property is System.Exception. In other words, the actual exception is expected to be part of event data, and not just a stringified version of it.

However, EventSource does not allow you to supply a System.Exception type, nor even an object as a message argument.

Any ideas on how to get this to work with EventSource? Is this even supported for this output type? I've looked at the tests related to outputs and there isn't anything there for AI exception logging. I'm hopping that I won't have to go down the route of writing a custom output to achieve this.

{ "type": "metadata", "include": "ProviderName == PersonalLoanWebService-ApplicationEvents && EventName == ApplicationError", "metadata": "exception", "exceptionProperty": "exception" }

tools\restore.cmd failed with the error

Have investigated yet. I do not have pre-VS2017 and FW 3.5 on this machine. So all sorts of unexpected failures were happening here...

I'll try to get to it tomorrow on not-that-fresh machine.

Build started 7/10/2017 11:40:41 PM.
Project "C:\src\github\diagnostics-eventflow\src\Microsoft.Diagnostics.EventFlow.FilterParserGenerator\Microsoft.Diagnostics.EventFlow.FilterParserGenera
tor.csproj" on node 1 (CompilePegGrammars target(s)).
C:\src\github\diagnostics-eventflow\src\Microsoft.Diagnostics.EventFlow.FilterParserGenerator\Microsoft.Diagnostics.EventFlow.FilterParserGenerator.cspro
j(1,1): error MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format,
 please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2
format, please convert it to MSBuild 2003 format.
Done Building Project "C:\src\github\diagnostics-eventflow\src\Microsoft.Diagnostics.EventFlow.FilterParserGenerator\Microsoft.Diagnostics.EventFlow.Filt
erParserGenerator.csproj" (CompilePegGrammars target(s)) -- FAILED.


Build FAILED.

"C:\src\github\diagnostics-eventflow\src\Microsoft.Diagnostics.EventFlow.FilterParserGenerator\Microsoft.Diagnostics.EventFlow.FilterParserGenerator.cspr
oj" (CompilePegGrammars target) (1) ->
  C:\src\github\diagnostics-eventflow\src\Microsoft.Diagnostics.EventFlow.FilterParserGenerator\Microsoft.Diagnostics.EventFlow.FilterParserGenerator.csp
roj(1,1): error MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 forma
t, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.
2 format, please convert it to MSBuild 2003 format.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.11
C:\src\github\diagnostics-eventflow [master ≡ +0 ~3 -0 !]>

Microsoft.Extensions.Logging input factory namespace issue.

When trying to use the Microsoft.Extensions.Logging input factory I found that I had to install
"Microsoft.Diagnostics.EventFlow.Inputs.MicrosoftLogging" rather than "Microsoft.Diagnostics.EventFlow.Inputs.Microsoft.Extensions.Logging" as specified in the read me. Then at run time I found that the DiagnosticsPipelineFactory was falling over when trying to reflect on "Microsoft.Diagnostics.EventFlow.Inputs.Microsoft.Extensions.Logging"

DiagnosticPipelineFactory: item of type 'Microsoft.Extensions.Logging' could not be created
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Diagnostics.EventFlow.Inputs.Microsoft.Extensions.Logging, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Diagnostics.EventFlow.Inputs.Microsoft.Extensions.Logging, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at Microsoft.Diagnostics.EventFlow.DiagnosticPipelineFactory.ProcessSection[PipelineItemType,PipelineItemChildType](IConfigurationSection configurationSection, IHealthReporter healthReporter, IDictionary2 itemFactories, IDictionary2 childFactories, String childSectionName)

I have made a change and am happy to raise a pull request, but wanted to check which namespace you were looking to use.

Changes to eventFlowConfig.json at runtime

Are there any plans to support changes to the eventFlowConfig.json file at runtime? I'm thinking a bit into the future of a project that we're starting and how we might want to change the Level of events that EventFlow handles, particularly to enable lower-level messages for troubleshooting. Since the idea is for EventFlow to forward everything to a central logging system, I'd rather not have Verbose messages consuming bandwidth all the time. If we could change a filter or even add a new output (say, local to a file) on demand for scenarios like this one, it would be nice.

I took a quick look at the code and it seems from the DiagnosticPipelineFactory that the configuration file is only loaded once when building the pipeline. Would adding reloadOnChange: true work? Is it even something you'd want to enable?

OMS Connection Issue Unclear

I am implementing EventFlow in a Service Fabric project that is using Serilog for the input and OMS for the output. The Service was failing to start due to a "Bad Request" but no further information was given about the Error Code as "Bad Request" can have 9 different Sub-Codes as listed on https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api. It would be nice if the error message also contained the response.Content data which specifies the Sub-Code so it would be easier to determine the issue.

Warning re. duplicate "scope" keys in Service Fabric

We have set up a Service Fabric application hosted on Azure. In the application we have a ASP.Net Core stateless service configured with Event Flow logging with two input sources (EventSource and Microsoft.Extensions.Logging) and a single output destination (ApplicationInsights). The EventSource input only uses a single providerName (the one for the ServiceEventSource created by Service Fabric).
The diagnostics pipeline is hooked into the logger factory as per the documentation.

Generally it works great, but we are quite often (but not all the time) seeing a warning in the Service Fabric Explorer similar to this:
Unhealthy event: SourceId='...-DiagnosticsPipeline', Property='Connectivity', HealthState='Warning', ConsiderWarningAsError=false.
The property with the key 'Scope' already exist in the event payload. Value was added under key 'Scope_8'

Inspecting the Application Insights traces it seems to be related to the events logged using the ILogger by the ASP.Net Core parts of the code.

Inspecting the issues list it seems others have previously had similar issues, but that these issues should have been fixed in the latest packages. However we are using all of the latest packages (except for the ServiceFabric package, but as far as I know, nothing has changed related to this behavior):
<PackageReference Include="Microsoft.Diagnostics.EventFlow" Version="1.1.0" /> <PackageReference Include="Microsoft.Diagnostics.EventFlow.Inputs.EventSource" Version="1.1.1" /> <PackageReference Include="Microsoft.Diagnostics.EventFlow.Inputs.MicrosoftLogging" Version="1.1.1" /> <PackageReference Include="Microsoft.Diagnostics.EventFlow.Outputs.ApplicationInsights" Version="1.1.5" /> <PackageReference Include="Microsoft.Diagnostics.EventFlow.ServiceFabric" Version="1.1.3" />
Is this a known issue?

Event Reclassification Using Logger Input/Application Insights Output

EventFlow appears to reclassify events. Here is how I logged an error in my code:

   this.logger.LogError($"No response from WebCacheService, which indicates an exception was thrown attempting to open a connection to server hosting the url. Please check the WebCacheService logs for errors related to this url: '{id.ToString()}'");

The logger was injected from the Asp.Net Core startup.cs.

Attached is a screenshot of Application Insights. I see what was originally an error logged instead with Trace status with severity level of verbose.
eventflow

What additional standard metadata items should be included in EventFlow?

The primary reason for attaching metadata to events is to enable outputs to produce various semantically-rich telemetry types. In general, metadata has no fixed schema, but for the sake of standardization and to ease output implementation EventFlow has the notion of "standard metadata". The standard metadata defines property names and types associated with well-known metadata tags. Currently two kinds of standard metadata are defined: "metric" and "request": https://github.com/Azure/diagnostics-eventflow#standard-metadata-types

We are planning to add some more standard metadata types and would appreciate feedback on what additional standard metadata types should be added to EventFlow, either to its core, or as a well-known metadata for one of its outputs?

For example, Microsoft Application Insights has notions of "dependency call", "event" (representing a significant user interaction or significant configuration change), "exception" (unexpected error) and "page view". The dependency call seems like a useful and generic concept that could be added to the core, but the others I am less sure about.

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.