Comments (3)
Did you also add the WCF service behavior to your service that enables it? This can be done in two ways:
- Code: Adding the
[Microsoft.ApplicationInsights.Wcf.ServiceTelemetry]
attribute to your service definition class. - Configuration: Add the
<serviceTelemetry/>
behavior through config. The NuGet package will register the behavior in<behaviorExtensions/>
but it will not modify any existing service behavior definitions automatically at this time.
from applicationinsights-sdk-labs.
I added the ServiceTelemetry attribute to my class. I couldn't figure out how to add it through the config as I have never used a behavior extension before. That attribute fixed it so I am now getting the Request events and they are correctly linked to the Dependency events. Thanks for the quick response!
One last question, which may be more app insights than this library, is how can I set the response code for the request event?
from applicationinsights-sdk-labs.
The NuGet package will register the service behavior by default. You'll see something like this in the <system.serviceModel>
section of your web.config file:
<extensions>
<behaviorExtensions>
<add name="serviceTelemetry"
type="Microsoft.ApplicationInsights.Wcf.ServiceTelemetryExtensionElement, Microsoft.AI.Wcf"/>
</behaviorExtensions>
</extensions>
To add the behavior itself, you need to add the <serviceTelemetry/>
tag to a Service Behavior. If you're using mostly doing the default configuration that Visual Studio generates for WCF services, you should have an unnamed service behavior where you could add it, and it would look something like this:
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
<!-- Enable Application Insights telemetry-->
<serviceTelemetry/>
</behavior>
</serviceBehaviors>
</behaviors>
Of course, if you're using a named behavior, you'll need to add <serviceTelemetry/>
to the right one :).
As for your last question, I'm not quite sure what you mean by "setting the response code for the request event". Can you clarify this?
By default, the library will notice if your service call returns a fault (that is, throws an unhandled exception or throws an exception derived from FaultException) and will mark the request as failed. If your service is exposed over an HTTP-based binding, we'll also include the HTTP response code in the Request telemetry event.
from applicationinsights-sdk-labs.
Related Issues (20)
- When will the official launch of App insights SDK for WCF application will be done HOT 17
- Binding problem with ClientTelemetry HOT 2
- Is hosting app responsible for calling Flush() when ends? HOT 3
- Installing Client Dependency Telemetry Tracking With Code HOT 7
- Add NIC placeholder for custom performance counters HOT 1
- UserAgent Initializer overrides User.Id HOT 1
- Update WCF SDK to AppInsights v2.5.1 HOT 2
- Dependency Error Tracking HOT 1
- Dependency Target Name HOT 3
- Wcf Service calling another Wcf service loose track HOT 4
- Some Telemetry is sent twice (By WCF package and Web?) HOT 2
- Quertion about MyGet repo
- Has this repo been abandoned ? Please communicate + myget issues HOT 4
- Majority of WCF requests missing
- Unable to track any dependencies
- Status: Alive or Dead HOT 1
- Question: Exceptions logging HOT 1
- apply the wcf telemetry on two environments, One is getting the API operation contract logging, but another env didn't log properly HOT 6
- Question: Does this project support framework 4.7.x? HOT 1
- Random ArgumentNullException when invoking operations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from applicationinsights-sdk-labs.