Azure ServiceFabric Samples not registered with ETW

I am launching the first sample ServiceFabric (Preview version 1.4.87): https://azure.microsoft.com/en-us/documentation/articles/service-fabric-create-your-first-application-in-visual-studio/ , to create a stateful service, and although the sample works correctly, I do not see the ETW output log information in the diagnostic window.

The log call is recorded in ServiceEventSource.Current.ServiceMessage(...) , but when this method (implemented in ServiceEventSource.cs) is launched, the call to this.IsEnabled() returns false, so no diagnostics are recorded. If I disconnect the IsEnabled() call in the debug state, nothing is still written to the diagnostics window, which simply contains messages about the application launching.

Diagnostic-configured providers are standard:

 Microsoft-ServiceFabric-Actors Microsoft-ServiceFabric-Services cbd93bc2-71e5-4566-b3a7-595d8eeca6e8:5:0x4000000000000000 

I added Microsoft-ServiceFabric to this list, but it just makes me register a lot more, but still not my output messages.

I also run PerfView, and then, looking at the available providers, the first two above do not exist: Microsoft-ServiceFabric-Actors and Microsoft-ServiceFabric-Services.

Any idea? It seems that this is either a pure problem with ETW, or some ServiceFabric configuration error, possibly a wrong vendor specification in the diagnostic window.

I am running Win10, VS2015 Enterprise x64.

[change] Calling ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(MyStatefulService).Name) also does not write anything to Program.cs. The only posts I have:

 Service Created: Service fabric:/MyApplication/MyStatefulService partition 9505f2b3-dee5-4ea7-96b7-c861407b5283 of ServiceType MyStatefulServiceType created in Application fabric:/MyApplication ApplicationType MyApplicationType. RunAsync has been invoked for a stateful service replica. Application Type Name: MyApplicationType, Application Name: fabric:/MyApplication, Service Type Name: MyStatefulServiceType, Service Name: fabric:/MyApplication/MyStatefulService, Partition Id: 9505f2b3-dee5-4ea7-96b7-c861407b5283, Replica Id: 130996049833056865", The Resource Balancer completed the Creation phase and consequently issued the action -- Add on Service -- fabric:/MyApplication/MyStatefulService Partition -- 9505f2b3-dee5-4ea7-96b7-c861407b5283 with (if relevant) SourceNode -- N/A and TargetNode -- Node.2. 

(repeat for other nodes)

+8
etw azure-service-fabric
source share
2 answers

To view events from your EventSource, you need to add its name to the list of suppliers in the diagnostics window. Look at the definition of ServiceEventSource, it will have the attribute [EventSource (Name = "xxx")]. This is the name ("xxx") that you need to include in the list of providers.

Visual Studio will usually take care of automatically detecting EventSources in your solution when starting Windows Diagnostics; not sure why it doesn't work for you, but adding it manually should do the trick.

+14
source share

I ran into this problem after I reorganized my solution. I moved my maintenance projects to the solutions folder. And just when the diagnostic event viewer stopped having messages from my services.

After the projects are transferred to the root level of the solution, Visual Studio will automatically add the names of the event sources to the list of ETW providers.

Now this error has been fixed with VS 2017 and / or Azure Service Fabric SDK 2.5.216.0.

0
source share

All Articles