Commit 36d7ff5c authored by linkinshi's avatar linkinshi Committed by Lemon

新增对于mysql.data组件的监控功能 (#114)

parent d503cb84
......@@ -12,6 +12,18 @@
<AssemblyName>SkyWalking.Sample.AspNet</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>4.0</OldToolsVersion>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
......@@ -114,6 +126,25 @@
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Grpc.Core.1.12.0\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Grpc.Core.1.12.0\build\net45\Grpc.Core.targets'))" />
</Target>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349C5851-65DF-11DA-9384-00065B846F21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:6768/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
......
......@@ -7,81 +7,83 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{05BF0D4E-C82
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{E38F0F6E-6E10-491D-8786-650F6A4B6698}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
generate_protos.bat = generate_protos.bat
generate_protos_linux.sh = generate_protos_linux.sh
generate_protos_macos.sh = generate_protos_macos.sh
appveyor.yml = appveyor.yml
NuGet.config = NuGet.config
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Abstractions", "src\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj", "{C3860B5F-21D0-429F-8A00-B0C0F4573DF7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Core", "src\SkyWalking.Core\SkyWalking.Core.csproj", "{FD84A10C-C962-4AEA-BA06-86F08EB048E6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{613F0980-91ED-4064-8E8C-168582EF4AD7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Core.Tests", "test\SkyWalking.Core.Tests\SkyWalking.Core.Tests.csproj", "{3915A2C2-7174-4651-A4F1-D45CD109916A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Components", "Components", "{79ED86A5-E9B9-49B2-9354-C911C079D03E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{844CEACD-4C85-4B15-9E2B-892B01FDA4BB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Sample.Backend", "sample\SkyWalking.Sample.Backend\SkyWalking.Sample.Backend.csproj", "{80A67B09-83F2-477F-907F-95FFF5B8FEAF}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{A4E67E09-3156-4D30-B451-F24F706E96C4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Sample.Frontend", "sample\SkyWalking.Sample.Frontend\SkyWalking.Sample.Frontend.csproj", "{2B4E350E-A1E5-4B4A-A642-BCA6D3887E5A}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{88AEFE60-F743-4AF3-8F55-B4B7B8079D95}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.HttpClient", "src\SkyWalking.Diagnostics.HttpClient\SkyWalking.Diagnostics.HttpClient.csproj", "{49DEFCA8-4289-4875-B6A5-35D84B3D2290}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{4BD917BC-D579-4C75-9939-41BF012A4EE2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.CAP", "src\SkyWalking.Diagnostics.CAP\SkyWalking.Diagnostics.CAP.csproj", "{55621423-19C3-4928-8B45-666FA87BF6A2}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{F0B43114-3BA9-4098-952D-0FB2241691A9}"
ProjectSection(SolutionItems) = preProject
build\common.props = build\common.props
build\index.cake = build\index.cake
build\util.cake = build\util.cake
build\version.cake = build\version.cake
build\version.props = build\version.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Diagnostics.EntityFrameworkCore", "src\SkyWalking.Diagnostics.EntityFrameworkCore\SkyWalking.Diagnostics.EntityFrameworkCore.csproj", "{CD334460-8E61-41EB-9762-62C6A342CACB}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Agent", "Agent", "{EF6194B2-9ACB-49B9-8049-DD6AFAEB0399}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Diagnostics.SqlClient", "src\SkyWalking.Diagnostics.SqlClient\SkyWalking.Diagnostics.SqlClient.csproj", "{44DFFDF7-5935-475A-825F-2C0298464117}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cli", "cli", "{A238D227-433B-461E-8C57-73B147E0F672}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{A4E67E09-3156-4D30-B451-F24F706E96C4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Abstractions", "src\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj", "{C3860B5F-21D0-429F-8A00-B0C0F4573DF7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite", "src\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite.csproj", "{F5C529C9-23C4-46B7-84FF-E86C6D17EB3E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Core", "src\SkyWalking.Core\SkyWalking.Core.csproj", "{FD84A10C-C962-4AEA-BA06-86F08EB048E6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql", "src\SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql\SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj", "{7BD880F3-2886-4EE6-9569-114613AFFCBC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Core.Tests", "test\SkyWalking.Core.Tests\SkyWalking.Core.Tests.csproj", "{3915A2C2-7174-4651-A4F1-D45CD109916A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql", "src\SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql\SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql.csproj", "{F8D96C30-369C-4FCB-B5B2-02EAA74199C9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Sample.Backend", "sample\SkyWalking.Sample.Backend\SkyWalking.Sample.Backend.csproj", "{80A67B09-83F2-477F-907F-95FFF5B8FEAF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.AspNet", "src\SkyWalking.AspNet\SkyWalking.AspNet.csproj", "{3A454A8A-A1B7-4C6D-BE08-52D956F95CC1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Sample.Frontend", "sample\SkyWalking.Sample.Frontend\SkyWalking.Sample.Frontend.csproj", "{2B4E350E-A1E5-4B4A-A642-BCA6D3887E5A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Sample.AspNet", "sample\SkyWalking.Sample.AspNet\SkyWalking.Sample.AspNet.csproj", "{C3649845-E458-448D-B97D-C7E231E1D040}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.HttpClient", "src\SkyWalking.Diagnostics.HttpClient\SkyWalking.Diagnostics.HttpClient.csproj", "{49DEFCA8-4289-4875-B6A5-35D84B3D2290}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Transport.Grpc", "src\SkyWalking.Transport.Grpc\SkyWalking.Transport.Grpc.csproj", "{FF2FC3FB-D112-45C1-AF34-1FE37D55F682}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.CAP", "src\SkyWalking.Diagnostics.CAP\SkyWalking.Diagnostics.CAP.csproj", "{55621423-19C3-4928-8B45-666FA87BF6A2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Diagnostics.AspNetCore", "src\SkyWalking.Diagnostics.AspNetCore\SkyWalking.Diagnostics.AspNetCore.csproj", "{CFBB522D-495F-40F9-B68F-DA25E48D9F6A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.EntityFrameworkCore", "src\SkyWalking.Diagnostics.EntityFrameworkCore\SkyWalking.Diagnostics.EntityFrameworkCore.csproj", "{CD334460-8E61-41EB-9762-62C6A342CACB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{88AEFE60-F743-4AF3-8F55-B4B7B8079D95}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.SqlClient", "src\SkyWalking.Diagnostics.SqlClient\SkyWalking.Diagnostics.SqlClient.csproj", "{44DFFDF7-5935-475A-825F-2C0298464117}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{4BD917BC-D579-4C75-9939-41BF012A4EE2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite", "src\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite.csproj", "{F5C529C9-23C4-46B7-84FF-E86C6D17EB3E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Utilities.Configuration", "src\SkyWalking.Utilities.Configuration\SkyWalking.Utilities.Configuration.csproj", "{0B87C4B8-3F4F-456A-B588-28D8E9E3395A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql", "src\SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql\SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj", "{7BD880F3-2886-4EE6-9569-114613AFFCBC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Utilities.DependencyInjection", "src\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj", "{1812A19C-729C-410B-A90D-D5AF1404DD60}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql", "src\SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql\SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql.csproj", "{F8D96C30-369C-4FCB-B5B2-02EAA74199C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Utilities.Logging", "src\SkyWalking.Utilities.Logging\SkyWalking.Utilities.Logging.csproj", "{AEB61F19-3DBB-411E-A67E-93007B96E160}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.AspNet", "src\SkyWalking.AspNet\SkyWalking.AspNet.csproj", "{3A454A8A-A1B7-4C6D-BE08-52D956F95CC1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{F0B43114-3BA9-4098-952D-0FB2241691A9}"
ProjectSection(SolutionItems) = preProject
build\common.props = build\common.props
build\index.cake = build\index.cake
build\util.cake = build\util.cake
build\version.cake = build\version.cake
build\version.props = build\version.props
EndProjectSection
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Sample.AspNet", "sample\SkyWalking.Sample.AspNet\SkyWalking.Sample.AspNet.csproj", "{C3649845-E458-448D-B97D-C7E231E1D040}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Agent", "Agent", "{EF6194B2-9ACB-49B9-8049-DD6AFAEB0399}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Transport.Grpc", "src\SkyWalking.Transport.Grpc\SkyWalking.Transport.Grpc.csproj", "{FF2FC3FB-D112-45C1-AF34-1FE37D55F682}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Agent.AspNetCore", "src\SkyWalking.Agent.AspNetCore\SkyWalking.Agent.AspNetCore.csproj", "{5CB2889E-33DD-4326-9403-4977849E065D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.AspNetCore", "src\SkyWalking.Diagnostics.AspNetCore\SkyWalking.Diagnostics.AspNetCore.csproj", "{CFBB522D-495F-40F9-B68F-DA25E48D9F6A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.DotNet.CLI", "cli\SkyWalking.DotNet.CLI\SkyWalking.DotNet.CLI.csproj", "{412E5D7D-9448-4C65-8EC7-26F6D5C49865}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Utilities.Configuration", "src\SkyWalking.Utilities.Configuration\SkyWalking.Utilities.Configuration.csproj", "{0B87C4B8-3F4F-456A-B588-28D8E9E3395A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cli", "cli", "{A238D227-433B-461E-8C57-73B147E0F672}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Utilities.DependencyInjection", "src\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj", "{1812A19C-729C-410B-A90D-D5AF1404DD60}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Utilities.Logging", "src\SkyWalking.Utilities.Logging\SkyWalking.Utilities.Logging.csproj", "{AEB61F19-3DBB-411E-A67E-93007B96E160}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Agent.AspNetCore", "src\SkyWalking.Agent.AspNetCore\SkyWalking.Agent.AspNetCore.csproj", "{5CB2889E-33DD-4326-9403-4977849E065D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.DotNet.CLI", "cli\SkyWalking.DotNet.CLI\SkyWalking.DotNet.CLI.csproj", "{412E5D7D-9448-4C65-8EC7-26F6D5C49865}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.Diagnostics.MySqlData", "src\SkyWalking.Diagnostics.MySqlData\SkyWalking.Diagnostics.MySqlData.csproj", "{A66B2179-9F35-4B52-9457-F60ED257BA60}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -173,23 +175,31 @@ Global
{412E5D7D-9448-4C65-8EC7-26F6D5C49865}.Debug|Any CPU.Build.0 = Debug|Any CPU
{412E5D7D-9448-4C65-8EC7-26F6D5C49865}.Release|Any CPU.ActiveCfg = Release|Any CPU
{412E5D7D-9448-4C65-8EC7-26F6D5C49865}.Release|Any CPU.Build.0 = Release|Any CPU
{A66B2179-9F35-4B52-9457-F60ED257BA60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A66B2179-9F35-4B52-9457-F60ED257BA60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A66B2179-9F35-4B52-9457-F60ED257BA60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A66B2179-9F35-4B52-9457-F60ED257BA60}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{79ED86A5-E9B9-49B2-9354-C911C079D03E} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{A4E67E09-3156-4D30-B451-F24F706E96C4} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{88AEFE60-F743-4AF3-8F55-B4B7B8079D95} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{4BD917BC-D579-4C75-9939-41BF012A4EE2} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{F0B43114-3BA9-4098-952D-0FB2241691A9} = {E38F0F6E-6E10-491D-8786-650F6A4B6698}
{EF6194B2-9ACB-49B9-8049-DD6AFAEB0399} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{C3860B5F-21D0-429F-8A00-B0C0F4573DF7} = {CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}
{FD84A10C-C962-4AEA-BA06-86F08EB048E6} = {CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}
{3915A2C2-7174-4651-A4F1-D45CD109916A} = {613F0980-91ED-4064-8E8C-168582EF4AD7}
{79ED86A5-E9B9-49B2-9354-C911C079D03E} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{80A67B09-83F2-477F-907F-95FFF5B8FEAF} = {844CEACD-4C85-4B15-9E2B-892B01FDA4BB}
{2B4E350E-A1E5-4B4A-A642-BCA6D3887E5A} = {844CEACD-4C85-4B15-9E2B-892B01FDA4BB}
{49DEFCA8-4289-4875-B6A5-35D84B3D2290} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{55621423-19C3-4928-8B45-666FA87BF6A2} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{44DFFDF7-5935-475A-825F-2C0298464117} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{A4E67E09-3156-4D30-B451-F24F706E96C4} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{CD334460-8E61-41EB-9762-62C6A342CACB} = {A4E67E09-3156-4D30-B451-F24F706E96C4}
{44DFFDF7-5935-475A-825F-2C0298464117} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{F5C529C9-23C4-46B7-84FF-E86C6D17EB3E} = {A4E67E09-3156-4D30-B451-F24F706E96C4}
{7BD880F3-2886-4EE6-9569-114613AFFCBC} = {A4E67E09-3156-4D30-B451-F24F706E96C4}
{F8D96C30-369C-4FCB-B5B2-02EAA74199C9} = {A4E67E09-3156-4D30-B451-F24F706E96C4}
......@@ -197,15 +207,12 @@ Global
{C3649845-E458-448D-B97D-C7E231E1D040} = {844CEACD-4C85-4B15-9E2B-892B01FDA4BB}
{FF2FC3FB-D112-45C1-AF34-1FE37D55F682} = {CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}
{CFBB522D-495F-40F9-B68F-DA25E48D9F6A} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{88AEFE60-F743-4AF3-8F55-B4B7B8079D95} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{4BD917BC-D579-4C75-9939-41BF012A4EE2} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{0B87C4B8-3F4F-456A-B588-28D8E9E3395A} = {4BD917BC-D579-4C75-9939-41BF012A4EE2}
{1812A19C-729C-410B-A90D-D5AF1404DD60} = {4BD917BC-D579-4C75-9939-41BF012A4EE2}
{AEB61F19-3DBB-411E-A67E-93007B96E160} = {4BD917BC-D579-4C75-9939-41BF012A4EE2}
{F0B43114-3BA9-4098-952D-0FB2241691A9} = {E38F0F6E-6E10-491D-8786-650F6A4B6698}
{EF6194B2-9ACB-49B9-8049-DD6AFAEB0399} = {05BF0D4E-C824-4EC8-8330-36C1FC49910E}
{5CB2889E-33DD-4326-9403-4977849E065D} = {EF6194B2-9ACB-49B9-8049-DD6AFAEB0399}
{412E5D7D-9448-4C65-8EC7-26F6D5C49865} = {A238D227-433B-461E-8C57-73B147E0F672}
{A66B2179-9F35-4B52-9457-F60ED257BA60} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94C0DA2C-CCCB-4314-93A2-9809B5DD0583}
......
......@@ -53,5 +53,7 @@ namespace SkyWalking.Components
public static readonly IComponent InMemoryDatabase = new OfficialComponent(3014, "InMemoryDatabase");
public static readonly IComponent AspNet = new OfficialComponent(3015, "AspNet");
public static readonly IComponent MySqlData = new OfficialComponent(3016, "MySql.Data");
}
}
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using MySql.Data.MySqlClient;
using SkyWalking.Components;
using SkyWalking.Context;
using SkyWalking.Context.Tag;
using SkyWalking.Context.Trace;
namespace SkyWalking.Diagnostics.MySqlData
{
public class MySqlDataDiagnosticProcessor : DefaultTraceListener, ITracingDiagnosticProcessor
{
private Dictionary<long, MySqlConnectionStringBuilder> _dbConn =
new Dictionary<long, MySqlConnectionStringBuilder>();
public MySqlDataDiagnosticProcessor()
{
MySqlTrace.Listeners.Clear();
MySqlTrace.Listeners.Add(this);
MySqlTrace.Switch.Level = SourceLevels.Information;
MySqlTrace.QueryAnalysisEnabled = true;
}
private static string ResolveOperationName(MySqlDataTraceCommand sqlCommand)
{
var commandType = sqlCommand.SqlText?.Split(' ');
return $"{MySqlDataDiagnosticStrings.MySqlDataPrefix}{commandType?.FirstOrDefault()}";
}
public string ListenerName { get; } = MySqlDataDiagnosticStrings.DiagnosticListenerName;
public void BeforeExecuteCommand(MySqlDataTraceCommand sqlCommand)
{
var peer = sqlCommand.DbServer;
var span = ContextManager.CreateExitSpan(ResolveOperationName(sqlCommand), peer);
span.SetLayer(SpanLayer.DB);
span.SetComponent(ComponentsDefine.MySqlData);
Tags.DbType.Set(span, "MySql");
Tags.DbInstance.Set(span, sqlCommand.Database);
Tags.DbStatement.Set(span, sqlCommand.SqlText);
}
public void AfterExecuteCommand()
{
ContextManager.StopSpan();
}
public void ErrorExecuteCommand(Exception ex)
{
var span = ContextManager.ActiveSpan;
span?.ErrorOccurred();
span?.Log(ex);
span?.Log(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), new Dictionary<string, object>()
{
{ "event", "error"},
{ "error.kind", "MySqlException"},
{ "message", ex.Message}
});
}
/// <summary>
///
/// </summary>
/// <param name="eventCache"></param>
/// <param name="source"></param>
/// <param name="eventType"></param>
/// <param name="id"></param>
/// <param name="format"></param>
/// <param name="args"></param>
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id,
string format, params object[] args)
{
switch ((MySqlTraceEventType)id)
{
case MySqlTraceEventType.ConnectionOpened:
var driverId = (long)args[0];
var connStr = args[1].ToString();
_dbConn[driverId] = new MySqlConnectionStringBuilder(connStr);
break;
case MySqlTraceEventType.ConnectionClosed:
//TODO
break;
case MySqlTraceEventType.QueryOpened:
BeforeExecuteCommand(GetCommand(args[0], args[2]));
break;
case MySqlTraceEventType.ResultOpened:
//TODO
break;
case MySqlTraceEventType.ResultClosed:
//TODO
break;
case MySqlTraceEventType.QueryClosed:
AfterExecuteCommand();
break;
case MySqlTraceEventType.StatementPrepared:
//TODO
break;
case MySqlTraceEventType.StatementExecuted:
//TODO
break;
case MySqlTraceEventType.StatementClosed:
//TODO
break;
case MySqlTraceEventType.NonQuery:
//TODO
break;
case MySqlTraceEventType.UsageAdvisorWarning:
//TODO
break;
case MySqlTraceEventType.Warning:
//TODO
break;
case MySqlTraceEventType.Error:
ErrorExecuteCommand(GetMySqlErrorException(args[1], args[2]));
break;
case MySqlTraceEventType.QueryNormalized:
//TODO
break;
}
}
private MySqlDataTraceCommand GetCommand(object driverIdObj, object cmd)
{
var command = new MySqlDataTraceCommand();
if (_dbConn.TryGetValue((long)driverIdObj, out var database))
{
command.Database = database.Database;
command.DbServer = database.Server;
}
command.SqlText = (cmd == null ? "" : cmd.ToString());
return command;
}
private Exception GetMySqlErrorException(object errorCode, object errorMsg)
{
//TODO handle errorcode
return new Exception($"{errorMsg}");
}
}
}
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
namespace SkyWalking.Diagnostics.MySqlData
{
internal static class MySqlDataDiagnosticStrings
{
public const string DiagnosticListenerName = "MySqlDiagnosticListener";
public const string MySqlDataPrefix = "mySqlData ";
}
}
\ No newline at end of file
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace SkyWalking.Diagnostics.MySqlData
{
public class MySqlDataTraceCommand
{
public string Database { get; set; }
public string SqlText { get; set; }
public string DbServer { get; set; }
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MySql.Data" Version="6.10.7" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
<ProjectReference Include="..\SkyWalking.Core\SkyWalking.Core.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
</ItemGroup>
</Project>
/*
* Licensed to the OpenSkywalking under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using SkyWalking.Utilities.DependencyInjection;
namespace SkyWalking.Diagnostics.MySqlData
{
public static class SkyWalkingBuilderExtensions
{
public static SkyWalkingExtensions AddMySqlData(this SkyWalkingExtensions builder)
{
if (builder == null)
{
throw new ArgumentNullException(nameof(builder));
}
builder.Services.AddSingleton<ITracingDiagnosticProcessor, MySqlDataDiagnosticProcessor>();
return builder;
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment