Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
a7928b2a
Commit
a7928b2a
authored
Dec 25, 2018
by
kaanid
Committed by
Lemon
Dec 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asp.net Exclude OPTIONS request && sample asp.net skywalking.json (#118)
parent
53836aac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
7 deletions
+42
-7
SkyWalking.Sample.AspNet.csproj
.../SkyWalking.Sample.AspNet/SkyWalking.Sample.AspNet.csproj
+3
-0
Web.config
sample/SkyWalking.Sample.AspNet/Web.config
+0
-4
skywalking.json
sample/SkyWalking.Sample.AspNet/skywalking.json
+23
-0
SkyWalkingApplicationRequestCallback.cs
...SkyWalking.AspNet/SkyWalkingApplicationRequestCallback.cs
+16
-3
No files found.
sample/SkyWalking.Sample.AspNet/SkyWalking.Sample.AspNet.csproj
View file @
a7928b2a
...
@@ -118,6 +118,9 @@
...
@@ -118,6 +118,9 @@
<Name>
SkyWalking.AspNet
</Name>
<Name>
SkyWalking.AspNet
</Name>
</ProjectReference>
</ProjectReference>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<Content
Include=
"skywalking.json"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<Import
Project=
"..\..\packages\Grpc.Core.1.12.0\build\net45\Grpc.Core.targets"
Condition=
"Exists('..\..\packages\Grpc.Core.1.12.0\build\net45\Grpc.Core.targets')"
/>
<Import
Project=
"..\..\packages\Grpc.Core.1.12.0\build\net45\Grpc.Core.targets"
Condition=
"Exists('..\..\packages\Grpc.Core.1.12.0\build\net45\Grpc.Core.targets')"
/>
<Target
Name=
"EnsureNuGetPackageBuildImports"
BeforeTargets=
"PrepareForBuild"
>
<Target
Name=
"EnsureNuGetPackageBuildImports"
BeforeTargets=
"PrepareForBuild"
>
...
...
sample/SkyWalking.Sample.AspNet/Web.config
View file @
a7928b2a
...
@@ -7,10 +7,6 @@ http://www.mono-project.com/Config_system.web and
...
@@ -7,10 +7,6 @@ http://www.mono-project.com/Config_system.web and
http
://
msdn2
.
microsoft
.
com
/
en
-
us
/
library
/
b5ysx397
.
aspx
http
://
msdn2
.
microsoft
.
com
/
en
-
us
/
library
/
b5ysx397
.
aspx
-->
-->
<
configuration
>
<
configuration
>
<
appSettings
>
<
add
key
=
"ApplicationCode"
value
=
"aspnet-sample"
/>
<
add
key
=
"DirectServers"
value
=
"localhost:11800"
/>
</
appSettings
>
<
system
.
web
>
<
system
.
web
>
<
compilation
debug
=
"true"
targetFramework
=
"4.5"
>
<
compilation
debug
=
"true"
targetFramework
=
"4.5"
>
<
assemblies
/>
<
assemblies
/>
...
...
sample/SkyWalking.Sample.AspNet/skywalking.json
0 → 100644
View file @
a7928b2a
{
"SkyWalking"
:
{
"ApplicationCode"
:
"SkyWalking.Sample.AspNet"
,
"SpanLimitPerSegment"
:
300
,
"Sampling"
:
{
"SamplePer3Secs"
:
-1
},
"Logging"
:
{
"Level"
:
"Information"
,
"FilePath"
:
"logs
\\
SkyWalking-{Date}.log"
},
"Transport"
:
{
"Interval"
:
3000
,
"PendingSegmentLimit"
:
30000
,
"PendingSegmentTimeout"
:
1000
,
"gRPC"
:
{
"Servers"
:
"localhost:11800"
,
"Timeout"
:
2000
,
"ConnectTimeout"
:
10000
}
}
}
}
\ No newline at end of file
src/SkyWalking.AspNet/SkyWalkingApplicationRequestCallback.cs
View file @
a7928b2a
...
@@ -42,6 +42,13 @@ namespace SkyWalking.AspNet
...
@@ -42,6 +42,13 @@ namespace SkyWalking.AspNet
{
{
var
httpApplication
=
sender
as
HttpApplication
;
var
httpApplication
=
sender
as
HttpApplication
;
var
httpContext
=
httpApplication
.
Context
;
var
httpContext
=
httpApplication
.
Context
;
if
(
httpContext
.
Request
.
HttpMethod
==
"OPTIONS"
)
{
//asp.net Exclude OPTIONS request
return
;
}
var
carrier
=
_contextCarrierFactory
.
Create
();
var
carrier
=
_contextCarrierFactory
.
Create
();
foreach
(
var
item
in
carrier
.
Items
)
foreach
(
var
item
in
carrier
.
Items
)
item
.
HeadValue
=
httpContext
.
Request
.
Headers
[
item
.
HeadKey
];
item
.
HeadValue
=
httpContext
.
Request
.
Headers
[
item
.
HeadKey
];
...
@@ -60,15 +67,21 @@ namespace SkyWalking.AspNet
...
@@ -60,15 +67,21 @@ namespace SkyWalking.AspNet
public
void
ApplicationOnEndRequest
(
object
sender
,
EventArgs
e
)
public
void
ApplicationOnEndRequest
(
object
sender
,
EventArgs
e
)
{
{
var
httpApplication
=
sender
as
HttpApplication
;
var
httpContext
=
httpApplication
.
Context
;
if
(
httpContext
.
Request
.
HttpMethod
==
"OPTIONS"
)
{
//asp.net Exclude OPTIONS request
return
;
}
var
httpRequestSpan
=
ContextManager
.
ActiveSpan
;
var
httpRequestSpan
=
ContextManager
.
ActiveSpan
;
if
(
httpRequestSpan
==
null
)
if
(
httpRequestSpan
==
null
)
{
{
return
;
return
;
}
}
var
httpApplication
=
sender
as
HttpApplication
;
var
httpContext
=
httpApplication
.
Context
;
var
statusCode
=
httpContext
.
Response
.
StatusCode
;
var
statusCode
=
httpContext
.
Response
.
StatusCode
;
if
(
statusCode
>=
400
)
if
(
statusCode
>=
400
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment