Commit 4ad292c8 authored by Lemon's avatar Lemon Committed by 吴晟 Wu Sheng

[SkyWalking DotNet CLI]Manage the SkyWalking .NET Core Agent in your computer (#87)

* Set up CI with Azure Pipelines

* Clean up solution structure

* Delete SkyWalking.NetworkProtocol

* remove HostingStartup

* Rename "SkyWalking.AspNetCore" to "SkyWalking.Agent.AspNetCore"

* Add SkyWalking.DotNet.CLI for SkyWalking dotnet global tool

* Fix CI:  DotnetTool does not support target framework lower than netcoreapp2.1.

* Add SkyWalking.DotNet.CLI.Command parser

* Implement the "dotnet sw install" command to install the SkyWalking .NET Core Agent.

* Add SkyWalking additonalDeps

* Generate config file for SkyWalking .NET Core Agent

* Update DirectoryProvider.cs

* Fix : Access to the path is denied in windows

* Fix : Access to the path is denied in windows

* Change tmp directory log

* Fix Information log level

* Rename SkyWalking.DotNet.CLI tool command

* Update README.md

* Fix : An assembly specified in the application dependencies manifest was not found

* Update README.md

* Fix install SkyWalking DotNet CLI
parent fc346491
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="skywalking-netcore-vnext" value="https://www.myget.org/F/skywalking/api/v3/index.json" />
</packageSources>
</configuration>
\ No newline at end of file
......@@ -10,7 +10,7 @@ SkyWalking C#/.NET instrument agent
[![Build status](https://ci.appveyor.com/api/projects/status/fl6vucwfn1vu94dv/branch/master?svg=true)](https://ci.appveyor.com/project/wu-sheng/skywalking-csharp/branch/master)
# Supported
- This project currently supports apps targeting netstandard2.0 or higher.
- This project currently supports apps targeting netcoreapp2.1 or higher.
- [Supported middlewares, frameworks and libraries.](docs/Supported-list.md)
# Features
......@@ -18,40 +18,78 @@ A quick list of SkyWalking .NET Core Agent's capabilities
- Application Topology
- Distributed Tracing
- ASP.NET Core Diagnostics
- HttpClientFactory Diagnostics
- HttpClient Diagnostics
- EntityFrameworkCore Diagnostics
# Getting Started
### Deploy SkyWalking Collector
## Deploy SkyWalking Collector
#### Requirements
- SkyWalking Collector 5.0.0-beta or higher. [Download](https://github.com/apache/incubator-skywalking/releases)
- SkyWalking Collector 5.0.0-beta or higher. See SkyWalking backend deploy [docs](https://github.com/apache/incubator-skywalking/blob/5.x/docs/en/Deploy-backend-in-standalone-mode.md).
### Install SkyWalking .NET Core Agent
## Install SkyWalking .NET Core Agent
You can run the following command to install the SkyWalking .NET Core Agent in your project.
You can run the following command to install the SkyWalking .NET Core Agent in your computer.
```
PM> Install-Package SkyWalking.AspNetCore
// install SkyWalking DotNet CLI
dotnet tool install -g SkyWalking.DotNet.CLI
```
On windows, run as Administrator
```
dotnet skywalking install
```
On macOS/Linux
```
sudo dotnet skywalking install
```
### Configuration
First,You need to config SkyWalking in your Startup.cs:
## How to use
Set the `ASPNETCORE_HOSTINGSTARTUPASSEMBLIES` and `DOTNET_ADDITIONAL_DEPS` environment variables to support the activation of the SkyWalking .NET Core Agent.
- Add the assembly name of `SkyWalking.Agent.AspNetCore` to the `ASPNETCORE_HOSTINGSTARTUPASSEMBLIES` environment variable.
- On Windows, set the `DOTNET_ADDITIONAL_DEPS` environment variable to `%PROGRAMFILES%\dotnet\additionalDeps\skywalking.agent.aspnetcore`. On macOS/Linux, set the `DOTNET_ADDITIONAL_DEPS` environment variable to `/usr/local/share/dotnet/x64/additionalDeps/skywalking.agent.aspnetcore`.
### Examples
- On windows
```
public void ConfigureServices(IServiceCollection services)
{
//......
dotnet new mvc -n sampleapp
cd sampleapp
services.AddSkyWalking(option =>
{
// Application code is showed in sky-walking-ui
option.ApplicationCode = "Your_ApplicationName";
// enable SkyWalking.Agent.AspNetCore
set ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=SkyWalking.Agent.AspNetCore
set DOTNET_ADDITIONAL_DEPS=%PROGRAMFILES%\dotnet\additionalDeps\skywalking.agent.aspnetcore
//Collector agent_gRPC/grpc service addresses.
option.DirectServers = "localhost:11800";
// set Application_Code
set SKYWALKING__APPLICATIONCODE=sample_app
dotnet run
```
});
}
- On macOS/Linux
```
dotnet new mvc -n sampleapp
cd sampleapp
// enable SkyWalking.Agent.AspNetCore
export ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=SkyWalking.Agent.AspNetCore
export DOTNET_ADDITIONAL_DEPS=/usr/local/share/dotnet/x64/additionalDeps/skywalking.agent.aspnetcore
// set Application_Code
export SKYWALKING__APPLICATIONCODE=sample_app
dotnet run
```
## Configuration
Use `dotnet skywalking config [your_application_code] [your_collector_server]` to generate config file. Example
```
dotnet skywalking config sample_app 192.168.0.1:11800
```
# Contributing
......
......@@ -3,6 +3,7 @@ os: Visual Studio 2017
branches:
only:
- master
- develop
environment:
BUILDING_ON_PLATFORM: win
BuildEnvironment: appveyor
......@@ -15,6 +16,14 @@ test: off
artifacts:
- path: artifacts/packages/*.nupkg
deploy:
- provider: NuGet
server: https://www.myget.org/F/skywalking/api/v2/package
api_key:
secure: y93uJrdiEYaeVTFxeCduQSlCussOUF4UztOyhkxyZxFnIco73J/K2rdA2QShoEuh
skip_symbols: true
artifact: /artifacts\/packages\/.+\.nupkg/
on:
branch: develop
- provider: NuGet
server: https://www.myget.org/F/skywalking/api/v2/package
api_key:
......
......@@ -9,10 +9,10 @@
<PackageLicenseUrl>https://github.com/OpenSkywalking/skywalking-netcore/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/OpenSkywalking/skywalking-netcore</RepositoryUrl>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyConfigurationAttribute>True</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>True</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>True</GenerateAssemblyProductAttribute>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -37,9 +37,9 @@ public class BuildParameters
private void InitializeCore()
{
Projects = Context.GetDirectories("./src/*");
Projects = Context.GetDirectories("./src/*") + Context.GetDirectories("./cli/*");
TestProjects = Context.GetDirectories("./test/*");
ProjectFiles = Context.GetFiles("./src/*/*.csproj");
ProjectFiles = Context.GetFiles("./src/*/*.csproj") + Context.GetFiles("./cli/*/*.csproj");
TestProjectFiles = Context.GetFiles("./test/*/*.csproj");
var buildSystem = Context.BuildSystem();
......
/*
* 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.Collections.Generic;
using Microsoft.Extensions.CommandLineUtils;
namespace SkyWalking.DotNet.CLI
{
public class AppCommandResolver: IAppCommandResolver
{
private readonly IEnumerable<IAppCommand> _appCommands;
public AppCommandResolver(IEnumerable<IAppCommand> appCommands)
{
_appCommands = appCommands;
}
public void Resolve(CommandLineApplication application)
{
foreach (var command in _appCommands)
{
application.Command(command.Name, command.Execute);
}
}
}
}
\ 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.IO;
using Microsoft.Extensions.CommandLineUtils;
using Newtonsoft.Json;
using SkyWalking.DotNet.CLI.Extensions;
// ReSharper disable ConvertToLocalFunction
// ReSharper disable StringLiteralTypo
namespace SkyWalking.DotNet.CLI.Command
{
public class ConfigCommand : IAppCommand
{
public string Name { get; } = "config";
public void Execute(CommandLineApplication command)
{
command.Description = "Generate config file for SkyWalking .NET Core Agent";
command.HelpOption();
var applicationCodeArgument = command.Argument(
"Application Code", "[Required]The application name in SkyWalking");
var gRPCServerArgument = command.Argument(
"gRPC collector", "[Optional]The gRPC collector address, default 'localhost:11800'");
var environmentOption = command.Option("-e|--Environment", "Follow the app's environment.Framework-defined values include Development, Staging, and Production",
CommandOptionType.SingleValue);
command.OnExecute(() =>
{
if (string.IsNullOrEmpty(applicationCodeArgument.Value))
{
Console.WriteLine("Invalid ApplicationCode");
return 1;
}
Generate(applicationCodeArgument.Value, gRPCServerArgument.Value, environmentOption.Value());
return 0;
});
}
private void Generate(string applicationCode, string gRPCServer, string environment)
{
Func<string, string> configFileName = env => string.IsNullOrEmpty(env) ? "skywalking.json" : $"skywalking.{env}.json";
var configFilePath = Path.Combine(Directory.GetCurrentDirectory(), configFileName(environment));
var configFile = new FileInfo(configFilePath);
if (configFile.Exists)
{
Console.WriteLine("Already exist config file in {0}", configFilePath);
return;
}
gRPCServer = gRPCServer ?? "localhost:11800";
var gRPCConfig = new Dictionary<string, dynamic>
{
{"Servers", gRPCServer},
{"Timeout", 2000},
{"ConnectTimeout", 10000}
};
var transportConfig = new Dictionary<string, dynamic>
{
{"Interval", 3000},
{"PendingSegmentLimit", 30000},
{"PendingSegmentTimeout", 1000},
{"gRPC", gRPCConfig}
};
var loggingConfig = new Dictionary<string, dynamic>
{
{"Level", "Information"},
{"FilePath", Path.Combine("logs", "SkyWalking-{Date}.log")}
};
var samplingConfig = new Dictionary<string, dynamic>
{
{"SamplePer3Secs", -1}
};
var swConfig = new Dictionary<string, dynamic>
{
{"ApplicationCode", applicationCode},
{"SpanLimitPerSegment", 300},
{"Sampling", samplingConfig},
{"Logging", loggingConfig},
{"Transport", transportConfig}
};
var rootConfig = new Dictionary<string, dynamic>
{
{"SkyWalking", swConfig}
};
using (var writer = configFile.CreateText())
writer.Write(JsonConvert.SerializeObject(rootConfig, Formatting.Indented));
Console.WriteLine("Generate config file to {0}", configFilePath);
}
}
}
\ 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.IO;
using Microsoft.Extensions.CommandLineUtils;
using Newtonsoft.Json;
using SkyWalking.DotNet.CLI.Extensions;
using SkyWalking.DotNet.CLI.Utils;
// ReSharper disable CommentTypo
// ReSharper disable IdentifierTypo
// ReSharper disable StringLiteralTypo
namespace SkyWalking.DotNet.CLI.Command
{
public class InstallCommand : IAppCommand
{
private const string git_hosting_startup = "https://github.com/OpenSkywalking/skywalking-netcore-hosting-startup.git";
private const string manifest_proj = "SkyWalking.Runtime.Store.csproj";
private const string invalid_node_name = "SkyWalking.Runtime.Store/1.0.0";
private readonly DirectoryProvider _directoryProvider;
private readonly ShellProcessFactory _processFactory;
private readonly PlatformInformationArbiter _platformInformation;
public InstallCommand(DirectoryProvider directoryProvider, ShellProcessFactory processFactory, PlatformInformationArbiter platformInformation)
{
_directoryProvider = directoryProvider;
_processFactory = processFactory;
_platformInformation = platformInformation;
}
public string Name { get; } = "install";
public void Execute(CommandLineApplication command)
{
command.Description = "Install SkyWalking .NET Core Agent";
command.HelpOption();
var upgradeOption = command.Option("-u|--upgrade", "Upgrade SkyWalking .NET Core Agent", CommandOptionType.NoValue);
command.OnExecute(() =>
{
ConsoleUtils.WriteWelcome();
Console.WriteLine(upgradeOption.HasValue() ? "Upgrading SkyWalking .NET Core Agent ..." : "Installing SkyWalking .NET Core Agent ...");
Console.WriteLine();
var workDir = Path.Combine(_directoryProvider.TmpDirectory, _directoryProvider.AgentPath);
var workDirInfo = new DirectoryInfo(workDir);
if (workDirInfo.Exists)
workDirInfo.Delete(true);
workDirInfo.Create();
Console.WriteLine("Create tmp directory '{0}'", workDir);
var hostingStartupDir = Path.Combine(workDir, "repo");
var shell = _processFactory.Create(Shell);
shell.Exec($"git clone {git_hosting_startup} {hostingStartupDir}");
shell.Exec($"cd {Path.Combine(hostingStartupDir, "manifest")}");
shell.Exec("dotnet build --configuration Release -nowarn:NU1701");
shell.Exec($"dotnet store --manifest {manifest_proj} --framework netcoreapp2.1 --output {_directoryProvider.StoreDirectory} --runtime {Runtime} -nowarn:NU1701");
var code = _processFactory.Release(shell);
if (code != 0)
{
return code;
}
//add dotnet additonalDeps
var additonalDepsPath = _directoryProvider.GetAdditonalDepsPath(_directoryProvider.AgentPath, "2.1.0");
var additonalDepsDirInfo = new DirectoryInfo(additonalDepsPath);
if (!additonalDepsDirInfo.Exists)
{
additonalDepsDirInfo.Create();
Console.WriteLine("Create dotnet additonalDeps directory '{0}'", additonalDepsPath);
}
var depsJsonFilePath = Path.Combine(hostingStartupDir, "manifest", "bin", "Release", "netcoreapp2.1", "SkyWalking.Runtime.Store.deps.json");
var depsContent = File.ReadAllText(depsJsonFilePath);
var depsObject = JsonConvert.DeserializeObject<DepsObject>(depsContent);
foreach (var target in depsObject.Targets)
target.Value?.Remove(invalid_node_name);
depsObject.Libraries.Remove(invalid_node_name);
var depsFile = new FileInfo(Path.Combine(additonalDepsPath, $"{_directoryProvider.AgentPath}.deps.json"));
using (var writer = depsFile.CreateText())
writer.Write(JsonConvert.SerializeObject(depsObject, Formatting.Indented));
Console.WriteLine("Create deps config to {0}", depsFile.FullName);
_platformInformation.Invoke(rmWorkDir_Win, rmWorkDir, rmWorkDir, rmWorkDir);
Console.WriteLine("Clean tmp directory '{0}'", workDir);
Console.WriteLine();
Console.WriteLine("SkyWalking .NET Core Agent was successfully installed.");
return 0;
void rmWorkDir_Win()
{
var cmd = _processFactory.Create("cmd.exe");
cmd.Exec($"rmdir /s/q {workDir}");
_processFactory.Release(cmd);
}
void rmWorkDir() => workDirInfo.Delete(true);
});
}
private string Shell => _platformInformation.GetValue(() => "cmd.exe", () => "sh", () => "bash", () => "sh");
private string Runtime => _platformInformation.GetValue(() => "win-x64", () => "linux-x64", () => "osx-x64", () => "linux-x64");
}
public class DepsObject
{
[JsonProperty(PropertyName = "runtimeTarget")]
public dynamic RuntimeTarget { get; set; }
[JsonProperty(PropertyName = "compilationOptions")]
public dynamic CompilationOptions { get; set; }
[JsonProperty(PropertyName = "targets")]
public Dictionary<string, Dictionary<string, dynamic>> Targets { get; set; } = new Dictionary<string, Dictionary<string, dynamic>>();
[JsonProperty(PropertyName = "libraries")]
public Dictionary<string, dynamic> Libraries { get; set; } = new Dictionary<string, dynamic>();
}
}
\ 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 Microsoft.Extensions.CommandLineUtils;
using SkyWalking.DotNet.CLI.Extensions;
namespace SkyWalking.DotNet.CLI
{
public class CommandLineApplicationFactory
{
private readonly IAppCommandResolver _appCommandResolver;
public CommandLineApplicationFactory(IAppCommandResolver appCommandResolver)
{
_appCommandResolver = appCommandResolver;
}
public CommandLineApplication Create()
{
var app = new CommandLineApplication
{
Name = "dotnet skywalking",
FullName = "Apache SkyWalking .NET Core Agent Command Line Tool",
Description =
"Install SkyWalking .NET Core Agent and generate config file."
};
app.HelpOption();
app.VersionOptionFromAssemblyAttributes(typeof(Program).Assembly);
app.OnExecute(() =>
{
app.ShowHelp();
return 2;
});
_appCommandResolver.Resolve(app);
return app;
}
}
}
\ 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.Reflection;
using Microsoft.Extensions.CommandLineUtils;
namespace SkyWalking.DotNet.CLI.Extensions
{
internal static class CommandLineApplicationExtensions
{
public static CommandOption HelpOption(this CommandLineApplication app)
=> app.HelpOption("-?|-h|--help");
public static CommandOption VerboseOption(this CommandLineApplication app)
=> app.Option("-v|--verbose", "Show verbose output", CommandOptionType.NoValue, inherited: true);
public static void OnExecute(this CommandLineApplication app, Action action)
=> app.OnExecute(() =>
{
action();
return 0;
});
public static void VersionOptionFromAssemblyAttributes(this CommandLineApplication app, Assembly assembly)
=> app.VersionOption("--version", GetInformationalVersion(assembly));
private static string GetInformationalVersion(Assembly assembly)
{
var attribute = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
var versionAttribute = attribute == null
? assembly.GetName().Version.ToString()
: attribute.InformationalVersion;
return versionAttribute;
}
}
}
\ 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.Diagnostics;
namespace SkyWalking.DotNet.CLI.Extensions
{
public static class ProcessExtensions
{
public static void Exec(this Process process, string command)
{
if (!process.HasExited)
process.StandardInput.WriteLine(command);
}
}
}
\ 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 Microsoft.Extensions.CommandLineUtils;
namespace SkyWalking.DotNet
{
public interface IAppCommand
{
string Name { get; }
void Execute(CommandLineApplication command);
}
}
\ 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 Microsoft.Extensions.CommandLineUtils;
namespace SkyWalking.DotNet.CLI
{
public interface IAppCommandResolver
{
void Resolve(CommandLineApplication application);
}
}
\ 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 Microsoft.Extensions.CommandLineUtils;
using Microsoft.Extensions.DependencyInjection;
using SkyWalking.DotNet.CLI.Command;
using SkyWalking.DotNet.CLI.Utils;
namespace SkyWalking.DotNet.CLI
{
class Program
{
static int Main(string[] args)
{
return new Program().Run(args);
}
private readonly IServiceProvider _serviceProvider;
public Program()
{
_serviceProvider = ConfigureServices();
}
private int Run(string[] args)
{
try
{
var app = _serviceProvider.GetRequiredService<CommandLineApplication>();
return app.Execute(args);
}
catch (Exception e)
{
Console.WriteLine($"An error occurred. {e.Message}");
return 1;
}
}
private IServiceProvider ConfigureServices()
{
var services = new ServiceCollection();
services.AddSingleton<CommandLineApplicationFactory>();
services.AddSingleton(p => p.GetRequiredService<CommandLineApplicationFactory>().Create());
services.AddSingleton<IAppCommandResolver, AppCommandResolver>();
services.AddSingleton<PlatformInformationArbiter>();
services.AddSingleton<DirectoryProvider>();
services.AddSingleton<ShellProcessFactory>();
services.AddSingleton<IAppCommand, InstallCommand>();
services.AddSingleton<IAppCommand, ConfigCommand>();
return services.BuildServiceProvider();
}
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<Description>SkyWalking dotnet global tool.</Description>
<AssemblyTitle>SkyWalking.DotNet.CLI</AssemblyTitle>
<AssemblyName>SkyWalking.DotNet.CLI</AssemblyName>
<PackageId>SkyWalking.DotNet.CLI</PackageId>
<PackageTags>SkyWalking;APM;CLI</PackageTags>
<RootNamespace>SkyWalking.DotNet.CLI</RootNamespace>
<OutputType>Exe</OutputType>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dotnet-skywalking</ToolCommandName>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</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;
namespace SkyWalking.DotNet.CLI.Utils
{
public static class ConsoleUtils
{
public static void WriteLine(string message, ConsoleColor foregroundColor)
{
var currentForegroundColor = Console.ForegroundColor;
Console.ForegroundColor = foregroundColor;
Console.WriteLine(message);
Console.ForegroundColor = currentForegroundColor;
}
public static void WriteWelcome()
{
Console.WriteLine("*********************************************************************");
Console.WriteLine("* *");
Console.WriteLine("* Welcome to Apache SkyWalking *");
Console.WriteLine("* *");
Console.WriteLine("*********************************************************************");
}
}
}
\ 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.IO;
// ReSharper disable IdentifierTypo
// ReSharper disable MemberCanBePrivate.Global
namespace SkyWalking.DotNet.CLI.Utils
{
public class DirectoryProvider
{
private readonly PlatformInformationArbiter _platformInformation;
public string TmpDirectory => _platformInformation.GetValue(
() => Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), "AppData\\Local\\Temp"),
() => "/tmp",
() => "/tmp",
() => "/tmp");
public string DotnetDirectory => _platformInformation.GetValue(
() => Path.Combine(Environment.GetEnvironmentVariable("PROGRAMFILES"), "dotnet"),
() => Path.Combine("/usr/local/share", "dotnet"),
() => Path.Combine("/usr/local/share", "dotnet"),
() => Path.Combine("/usr/local/share", "dotnet"));
public string AgentPath => "skywalking.agent.aspnetcore";
public string AdditonalDepsRootDirectory => Path.Combine(DotnetDirectory, "x64", "additionalDeps");
public string StoreDirectory => Path.Combine(DotnetDirectory, "store");
public DirectoryProvider(PlatformInformationArbiter platformInformation)
{
_platformInformation = platformInformation;
}
public string GetAdditonalDepsPath(string additonalName, string frameworkVersion)
{
return Path.Combine(GetAdditonalDepsDirectory(additonalName), "shared", "Microsoft.NETCore.App", frameworkVersion);
}
public string GetAdditonalDepsDirectory(string additonalName)
{
return Path.Combine(AdditonalDepsRootDirectory, additonalName);
}
}
}
\ 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.Runtime.InteropServices;
namespace SkyWalking.DotNet.CLI.Utils
{
public class PlatformInformationArbiter
{
public T GetValue<T>(Func<T> windowsValueProvider, Func<T> linuxValueProvider, Func<T> osxValueProvider, Func<T> defaultValueProvider)
{
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
? windowsValueProvider()
: RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
? linuxValueProvider()
: RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
? osxValueProvider()
: defaultValueProvider();
}
public void Invoke(Action windowsValueProvider, Action linuxValueProvider, Action osxValueProvider, Action defaultValueProvider)
{
var invoker = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
? windowsValueProvider
: RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
? linuxValueProvider
: RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
? osxValueProvider
: defaultValueProvider;
invoker();
}
}
}
\ 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.Diagnostics;
namespace SkyWalking.DotNet.CLI.Utils
{
public class ShellProcess
{
private readonly object _lock = new object();
private readonly Process _process;
private bool _isError;
private int _exitCode;
public int ExitCode
{
get
{
lock (_lock)
{
return _isError ? 1 : _exitCode;
}
}
}
public ShellProcess(string name, string argument)
{
var processStartInfo = new ProcessStartInfo
{
FileName = name,
CreateNoWindow = true,
ErrorDialog = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardInput = true,
RedirectStandardOutput = true
};
if (!string.IsNullOrEmpty(argument))
{
processStartInfo.Arguments = argument;
}
_process = new Process {StartInfo = processStartInfo};
}
public void Exec(string command)
{
if (!_isError)
{
_process.StandardInput.WriteLine(command);
}
}
public ShellProcess Start()
{
_process.Start();
_process.OutputDataReceived += ProcessOnOutputDataReceived;
_process.ErrorDataReceived += ProcessOnErrorDataReceived;
_process.BeginOutputReadLine();
_process.BeginErrorReadLine();
return this;
}
public void Close()
{
_process.StandardInput.WriteLine("exit");
_process.WaitForExit();
_exitCode = _process.ExitCode;
_process.OutputDataReceived -= ProcessOnOutputDataReceived;
_process.ErrorDataReceived -= ProcessOnErrorDataReceived;
_process.Dispose();
}
private void ProcessOnErrorDataReceived(object sender, DataReceivedEventArgs e)
{
if (string.IsNullOrEmpty(e.Data))
{
return;
}
if (e.Data.StartsWith("Cloning into"))
{
Console.WriteLine(e.Data);
return;
}
ConsoleUtils.WriteLine(e.Data, ConsoleColor.Yellow);
lock (_lock)
{
_isError = true;
}
}
private void ProcessOnOutputDataReceived(object sender, DataReceivedEventArgs e)
{
if (!string.IsNullOrEmpty(e.Data))
Console.WriteLine(e.Data);
}
}
}
\ 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.
*
*/
namespace SkyWalking.DotNet.CLI.Utils
{
public class ShellProcessFactory
{
public ShellProcess Create(string name, string argument = null)
{
return new ShellProcess(name, argument).Start();
}
public int Release(ShellProcess process)
{
process.Close();
return process.ExitCode;
}
}
}
\ No newline at end of file
......@@ -6,14 +6,14 @@ cd /d %~dp0
set PROTOC=%UserProfile%\.nuget\packages\google.protobuf.tools\3.5.1\tools\windows_x64\protoc.exe
set PLUGIN=%UserProfile%\.nuget\packages\grpc.tools\1.9.0\tools\windows_x64\grpc_csharp_plugin.exe
dotnet restore
@rem dotnet restore
%PROTOC% -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/ApplicationRegisterService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/Common.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/DiscoveryService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/Downstream.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/JVMMetricsService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/KeyWithIntegerValue.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/KeyWithStringValue.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/NetworkAddressRegisterService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/TraceSegmentService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
\ No newline at end of file
%PROTOC% -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/ApplicationRegisterService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/Common.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/DiscoveryService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/Downstream.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/JVMMetricsService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/KeyWithIntegerValue.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/KeyWithStringValue.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/NetworkAddressRegisterService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
%PROTOC% -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/TraceSegmentService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=%PLUGIN%
\ No newline at end of file
#!/usr/bin/env bash
dotnet restore
PROTOC=~/.nuget/packages/google.protobuf.tools/3.5.1/tools/linux_x64/protoc
PLUGIN=~/.nuget/packages/grpc.tools/1.9.0/tools/linux_x64/grpc_csharp_plugin
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/ApplicationRegisterService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/Common.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/DiscoveryService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/Downstream.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/JVMMetricsService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/KeyWithIntegerValue.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/KeyWithStringValue.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/NetworkAddressRegisterService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/TraceSegmentService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/ApplicationRegisterService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/Common.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/DiscoveryService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/Downstream.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/JVMMetricsService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/KeyWithIntegerValue.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/KeyWithStringValue.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/NetworkAddressRegisterService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/TraceSegmentService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
\ No newline at end of file
PROTOC=~/.nuget/packages/google.protobuf.tools/3.5.1/tools/macosx_x64/protoc
PLUGIN=~/.nuget/packages/grpc.tools/1.9.0/tools/macosx_x64/grpc_csharp_plugin
#!/usr/bin/env bash
PROTOC=~/.nuget/packages/google.protobuf.tools/3.6.1/tools/macosx_x64/protoc
PLUGIN=~/.nuget/packages/grpc.tools/1.15.0/tools/macosx_x64/grpc_csharp_plugin
dotnet restore
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/ApplicationRegisterService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/Common.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/DiscoveryService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/Downstream.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/JVMMetricsService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/KeyWithIntegerValue.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/KeyWithStringValue.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/NetworkAddressRegisterService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.NetworkProtocol protos/TraceSegmentService.proto --grpc_out src/SkyWalking.NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/ApplicationRegisterService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/Common.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/DiscoveryService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/Downstream.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/JVMMetricsService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/KeyWithIntegerValue.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/KeyWithStringValue.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/NetworkAddressRegisterService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
$PROTOC -I protos --csharp_out src/SkyWalking.Transport.Grpc/NetworkProtocol protos/TraceSegmentService.proto --grpc_out src/SkyWalking.Transport.Grpc/NetworkProtocol --plugin=protoc-gen-grpc=$PLUGIN
\ No newline at end of file
......@@ -6,7 +6,7 @@
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\SkyWalking.AspNetCore\SkyWalking.AspNetCore.csproj" />
<ProjectReference Include="..\..\src\SkyWalking.Agent.AspNetCore\SkyWalking.Agent.AspNetCore.csproj" />
<ProjectReference Include="..\..\src\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite.csproj" />
</ItemGroup>
<ItemGroup>
......@@ -22,7 +22,4 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="logs" />
</ItemGroup>
</Project>
\ No newline at end of file
using System.Data.SqlClient;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SkyWalking.AspNetCore;
using SkyWalking.Diagnostics.EntityFrameworkCore;
using SkyWalking.Sample.Backend.Models;
namespace SkyWalking.Sample.Backend
......
......@@ -5,9 +5,6 @@
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\SkyWalking.AspNetCore\SkyWalking.AspNetCore.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
</ItemGroup>
......@@ -17,4 +14,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\SkyWalking.Agent.AspNetCore\SkyWalking.Agent.AspNetCore.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -2,7 +2,6 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SkyWalking.AspNetCore;
namespace SkyWalking.Sample.Frontend
{
......
......@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2024
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.NetworkProtocol", "src\SkyWalking.NetworkProtocol\SkyWalking.NetworkProtocol.csproj", "{54B9183A-928B-43E1-9851-10E2F1CCE61C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{05BF0D4E-C824-4EC8-8330-36C1FC49910E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{E38F0F6E-6E10-491D-8786-650F6A4B6698}"
......@@ -12,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution
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}"
......@@ -26,8 +26,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Components", "Components",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkyWalking.AspNetCore", "src\SkyWalking.AspNetCore\SkyWalking.AspNetCore.csproj", "{D75B68C5-6788-4871-A63F-F6EB48FB0DC5}"
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}"
......@@ -68,16 +66,29 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Utilities.Depend
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Utilities.Logging", "src\SkyWalking.Utilities.Logging\SkyWalking.Utilities.Logging.csproj", "{AEB61F19-3DBB-411E-A67E-93007B96E160}"
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
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Agent", "Agent", "{EF6194B2-9ACB-49B9-8049-DD6AFAEB0399}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Agent.AspNetCore", "src\SkyWalking.Agent.AspNetCore\SkyWalking.Agent.AspNetCore.csproj", "{5CB2889E-33DD-4326-9403-4977849E065D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.DotNet.CLI", "cli\SkyWalking.DotNet.CLI\SkyWalking.DotNet.CLI.csproj", "{412E5D7D-9448-4C65-8EC7-26F6D5C49865}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cli", "cli", "{A238D227-433B-461E-8C57-73B147E0F672}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{54B9183A-928B-43E1-9851-10E2F1CCE61C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54B9183A-928B-43E1-9851-10E2F1CCE61C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54B9183A-928B-43E1-9851-10E2F1CCE61C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54B9183A-928B-43E1-9851-10E2F1CCE61C}.Release|Any CPU.Build.0 = Release|Any CPU
{C3860B5F-21D0-429F-8A00-B0C0F4573DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3860B5F-21D0-429F-8A00-B0C0F4573DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3860B5F-21D0-429F-8A00-B0C0F4573DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
......@@ -90,10 +101,6 @@ Global
{3915A2C2-7174-4651-A4F1-D45CD109916A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3915A2C2-7174-4651-A4F1-D45CD109916A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3915A2C2-7174-4651-A4F1-D45CD109916A}.Release|Any CPU.Build.0 = Release|Any CPU
{D75B68C5-6788-4871-A63F-F6EB48FB0DC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D75B68C5-6788-4871-A63F-F6EB48FB0DC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D75B68C5-6788-4871-A63F-F6EB48FB0DC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D75B68C5-6788-4871-A63F-F6EB48FB0DC5}.Release|Any CPU.Build.0 = Release|Any CPU
{80A67B09-83F2-477F-907F-95FFF5B8FEAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80A67B09-83F2-477F-907F-95FFF5B8FEAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80A67B09-83F2-477F-907F-95FFF5B8FEAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
......@@ -158,18 +165,24 @@ Global
{AEB61F19-3DBB-411E-A67E-93007B96E160}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEB61F19-3DBB-411E-A67E-93007B96E160}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEB61F19-3DBB-411E-A67E-93007B96E160}.Release|Any CPU.Build.0 = Release|Any CPU
{5CB2889E-33DD-4326-9403-4977849E065D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CB2889E-33DD-4326-9403-4977849E065D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5CB2889E-33DD-4326-9403-4977849E065D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5CB2889E-33DD-4326-9403-4977849E065D}.Release|Any CPU.Build.0 = Release|Any CPU
{412E5D7D-9448-4C65-8EC7-26F6D5C49865}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{54B9183A-928B-43E1-9851-10E2F1CCE61C} = {CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}
{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}
{D75B68C5-6788-4871-A63F-F6EB48FB0DC5} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{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}
......@@ -189,6 +202,10 @@ Global
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94C0DA2C-CCCB-4314-93A2-9809B5DD0583}
......
......@@ -34,7 +34,7 @@ using SkyWalking.Service;
using SkyWalking.Transport;
using SkyWalking.Transport.Grpc;
namespace SkyWalking.AspNetCore
namespace SkyWalking.Agent.AspNetCore
{
internal static class ServiceCollectionExtensions
{
......
using Microsoft.AspNetCore.Hosting;
namespace SkyWalking.AspNetCore
namespace SkyWalking.Agent.AspNetCore
{
internal class HostingEnvironmentProvider : IEnvironmentProvider
{
......
......@@ -20,9 +20,9 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
namespace SkyWalking.AspNetCore
namespace SkyWalking.Agent.AspNetCore
{
public class InstrumentationHostedService : IHostedService
internal class InstrumentationHostedService : IHostedService
{
private readonly ISkyWalkingAgentStartup _startup;
......
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<Description>SkyWalking ASP.NET Core Agent.</Description>
<AssemblyTitle>SkyWalking.Agent.AspNetCore</AssemblyTitle>
<PackageId>SkyWalking.Agent.AspNetCore</PackageId>
<PackageTags>SkyWalking;APM</PackageTags>
<PackageReleaseNotes>
</PackageReleaseNotes>
<RootNamespace>SkyWalking.Agent.AspNetCore</RootNamespace>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
<ProjectReference Include="..\SkyWalking.Core\SkyWalking.Core.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.AspNetCore\SkyWalking.Diagnostics.AspNetCore.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql\SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql\SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.EntityFrameworkCore\SkyWalking.Diagnostics.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.HttpClient\SkyWalking.Diagnostics.HttpClient.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.SqlClient\SkyWalking.Diagnostics.SqlClient.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.Configuration\SkyWalking.Utilities.Configuration.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.Logging\SkyWalking.Utilities.Logging.csproj" />
<ProjectReference Include="..\SkyWalking.Transport.Grpc\SkyWalking.Transport.Grpc.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
using Microsoft.AspNetCore.Hosting;
using SkyWalking.AspNetCore;
using SkyWalking.Agent.AspNetCore;
[assembly: HostingStartup(typeof(SkyWalkingHostingStartup))]
namespace SkyWalking.AspNetCore
namespace SkyWalking.Agent.AspNetCore
{
public class SkyWalkingHostingStartup : IHostingStartup
internal class SkyWalkingHostingStartup : IHostingStartup
{
public void Configure(IWebHostBuilder builder)
{
......
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<Description>SkyWalking ASP.NET Core Agent.</Description>
<AssemblyTitle>SkyWalking.AspNetCore</AssemblyTitle>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>SkyWalking_AspNetCore</AssemblyName>
<PackageId>SkyWalking.AspNetCore</PackageId>
<PackageTags>SkyWalking;APM</PackageTags>
<PackageReleaseNotes>
</PackageReleaseNotes>
<RootNamespace>SkyWalking.AspNetCore</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
<ProjectReference Include="..\SkyWalking.Core\SkyWalking.Core.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.AspNetCore\SkyWalking.Diagnostics.AspNetCore.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql\SkyWalking.Diagnostics.EntityFrameworkCore.Npgsql.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql\SkyWalking.Diagnostics.EntityFrameworkCore.Pomelo.MySql.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite\SkyWalking.Diagnostics.EntityFrameworkCore.Sqlite.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.EntityFrameworkCore\SkyWalking.Diagnostics.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.HttpClient\SkyWalking.Diagnostics.HttpClient.csproj" />
<ProjectReference Include="..\SkyWalking.Diagnostics.SqlClient\SkyWalking.Diagnostics.SqlClient.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.Configuration\SkyWalking.Utilities.Configuration.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.DependencyInjection\SkyWalking.Utilities.DependencyInjection.csproj" />
<ProjectReference Include="..\SkyWalking.Utilities.Logging\SkyWalking.Utilities.Logging.csproj" />
<ProjectReference Include="..\SkyWalking.Transport.Grpc\SkyWalking.Transport.Grpc.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<Description>SkyWalking gRPC protocol and generated codes.</Description>
<AssemblyTitle>SkyWalking.NetworkProtocol</AssemblyTitle>
<AssemblyName>SkyWalking.NetworkProtocol</AssemblyName>
<PackageId>SkyWalking.NetworkProtocol</PackageId>
<PackageTags>SkyWalking</PackageTags>
<PackageReleaseNotes>
</PackageReleaseNotes>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.6.1" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.6.1" />
<PackageReference Include="Grpc" Version="1.15.0-pre1" />
<PackageReference Include="Grpc.Tools" Version="1.15.0-pre1" />
<PackageReference Include="System.Runtime" Version="4.3.0" />
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -197,7 +197,7 @@ namespace SkyWalking.NetworkProtocol {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ApplicationMapping(ApplicationMapping other) : this() {
Application = other.application_ != null ? other.Application.Clone() : null;
application_ = other.application_ != null ? other.application_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......
......@@ -2,12 +2,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ApplicationRegisterService.proto
// </auto-generated>
#pragma warning disable 1591
#pragma warning disable 0414, 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
......@@ -67,7 +64,7 @@ namespace SkyWalking.NetworkProtocol {
{
}
public virtual global::SkyWalking.NetworkProtocol.ApplicationMapping applicationCodeRegister(global::SkyWalking.NetworkProtocol.Application request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual global::SkyWalking.NetworkProtocol.ApplicationMapping applicationCodeRegister(global::SkyWalking.NetworkProtocol.Application request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return applicationCodeRegister(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......@@ -75,7 +72,7 @@ namespace SkyWalking.NetworkProtocol {
{
return CallInvoker.BlockingUnaryCall(__Method_applicationCodeRegister, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ApplicationMapping> applicationCodeRegisterAsync(global::SkyWalking.NetworkProtocol.Application request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ApplicationMapping> applicationCodeRegisterAsync(global::SkyWalking.NetworkProtocol.Application request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return applicationCodeRegisterAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......
......@@ -98,7 +98,7 @@ namespace SkyWalking.NetworkProtocol {
applicationId_ = other.applicationId_;
agentUUID_ = other.agentUUID_;
registerTime_ = other.registerTime_;
Osinfo = other.osinfo_ != null ? other.Osinfo.Clone() : null;
osinfo_ = other.osinfo_ != null ? other.osinfo_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -474,7 +474,7 @@ namespace SkyWalking.NetworkProtocol {
applicationId_ = other.applicationId_;
applicationInstanceId_ = other.applicationInstanceId_;
registerTime_ = other.registerTime_;
Osinfo = other.osinfo_ != null ? other.Osinfo.Clone() : null;
osinfo_ = other.osinfo_ != null ? other.osinfo_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......@@ -1295,7 +1295,7 @@ namespace SkyWalking.NetworkProtocol {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ServiceNameMappingElement(ServiceNameMappingElement other) : this() {
serviceId_ = other.serviceId_;
Element = other.element_ != null ? other.Element.Clone() : null;
element_ = other.element_ != null ? other.element_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
......
......@@ -2,12 +2,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DiscoveryService.proto
// </auto-generated>
#pragma warning disable 1591
#pragma warning disable 0414, 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
......@@ -78,7 +75,7 @@ namespace SkyWalking.NetworkProtocol {
{
}
public virtual global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping registerInstance(global::SkyWalking.NetworkProtocol.ApplicationInstance request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping registerInstance(global::SkyWalking.NetworkProtocol.ApplicationInstance request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return registerInstance(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......@@ -86,7 +83,7 @@ namespace SkyWalking.NetworkProtocol {
{
return CallInvoker.BlockingUnaryCall(__Method_registerInstance, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping> registerInstanceAsync(global::SkyWalking.NetworkProtocol.ApplicationInstance request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ApplicationInstanceMapping> registerInstanceAsync(global::SkyWalking.NetworkProtocol.ApplicationInstance request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return registerInstanceAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......@@ -94,7 +91,7 @@ namespace SkyWalking.NetworkProtocol {
{
return CallInvoker.AsyncUnaryCall(__Method_registerInstance, null, options, request);
}
public virtual global::SkyWalking.NetworkProtocol.Downstream heartbeat(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual global::SkyWalking.NetworkProtocol.Downstream heartbeat(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return heartbeat(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......@@ -102,7 +99,7 @@ namespace SkyWalking.NetworkProtocol {
{
return CallInvoker.BlockingUnaryCall(__Method_heartbeat, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.Downstream> heartbeatAsync(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.Downstream> heartbeatAsync(global::SkyWalking.NetworkProtocol.ApplicationInstanceHeartbeat request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return heartbeatAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......@@ -183,7 +180,7 @@ namespace SkyWalking.NetworkProtocol {
{
}
public virtual global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection discovery(global::SkyWalking.NetworkProtocol.ServiceNameCollection request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection discovery(global::SkyWalking.NetworkProtocol.ServiceNameCollection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return discovery(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......@@ -191,7 +188,7 @@ namespace SkyWalking.NetworkProtocol {
{
return CallInvoker.BlockingUnaryCall(__Method_discovery, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection> discoveryAsync(global::SkyWalking.NetworkProtocol.ServiceNameCollection request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.ServiceNameMappingCollection> discoveryAsync(global::SkyWalking.NetworkProtocol.ServiceNameCollection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return discoveryAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......
......@@ -250,7 +250,7 @@ namespace SkyWalking.NetworkProtocol {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public JVMMetric(JVMMetric other) : this() {
time_ = other.time_;
Cpu = other.cpu_ != null ? other.Cpu.Clone() : null;
cpu_ = other.cpu_ != null ? other.cpu_.Clone() : null;
memory_ = other.memory_.Clone();
memoryPool_ = other.memoryPool_.Clone();
gc_ = other.gc_.Clone();
......
......@@ -2,12 +2,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: JVMMetricsService.proto
// </auto-generated>
#pragma warning disable 1591
#pragma warning disable 0414, 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
......@@ -64,7 +61,7 @@ namespace SkyWalking.NetworkProtocol {
{
}
public virtual global::SkyWalking.NetworkProtocol.Downstream collect(global::SkyWalking.NetworkProtocol.JVMMetrics request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual global::SkyWalking.NetworkProtocol.Downstream collect(global::SkyWalking.NetworkProtocol.JVMMetrics request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return collect(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......@@ -72,7 +69,7 @@ namespace SkyWalking.NetworkProtocol {
{
return CallInvoker.BlockingUnaryCall(__Method_collect, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.Downstream> collectAsync(global::SkyWalking.NetworkProtocol.JVMMetrics request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.Downstream> collectAsync(global::SkyWalking.NetworkProtocol.JVMMetrics request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return collectAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......
......@@ -2,12 +2,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: NetworkAddressRegisterService.proto
// </auto-generated>
#pragma warning disable 1591
#pragma warning disable 0414, 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
......@@ -64,7 +61,7 @@ namespace SkyWalking.NetworkProtocol {
{
}
public virtual global::SkyWalking.NetworkProtocol.NetworkAddressMappings batchRegister(global::SkyWalking.NetworkProtocol.NetworkAddresses request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual global::SkyWalking.NetworkProtocol.NetworkAddressMappings batchRegister(global::SkyWalking.NetworkProtocol.NetworkAddresses request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return batchRegister(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......@@ -72,7 +69,7 @@ namespace SkyWalking.NetworkProtocol {
{
return CallInvoker.BlockingUnaryCall(__Method_batchRegister, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.NetworkAddressMappings> batchRegisterAsync(global::SkyWalking.NetworkProtocol.NetworkAddresses request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncUnaryCall<global::SkyWalking.NetworkProtocol.NetworkAddressMappings> batchRegisterAsync(global::SkyWalking.NetworkProtocol.NetworkAddresses request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return batchRegisterAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
......
......@@ -387,7 +387,7 @@ namespace SkyWalking.NetworkProtocol {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TraceSegmentObject(TraceSegmentObject other) : this() {
TraceSegmentId = other.traceSegmentId_ != null ? other.TraceSegmentId.Clone() : null;
traceSegmentId_ = other.traceSegmentId_ != null ? other.traceSegmentId_.Clone() : null;
spans_ = other.spans_.Clone();
applicationId_ = other.applicationId_;
applicationInstanceId_ = other.applicationInstanceId_;
......@@ -627,7 +627,7 @@ namespace SkyWalking.NetworkProtocol {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TraceSegmentReference(TraceSegmentReference other) : this() {
refType_ = other.refType_;
ParentTraceSegmentId = other.parentTraceSegmentId_ != null ? other.ParentTraceSegmentId.Clone() : null;
parentTraceSegmentId_ = other.parentTraceSegmentId_ != null ? other.parentTraceSegmentId_.Clone() : null;
parentSpanId_ = other.parentSpanId_;
parentApplicationInstanceId_ = other.parentApplicationInstanceId_;
networkAddress_ = other.networkAddress_;
......
......@@ -2,12 +2,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TraceSegmentService.proto
// </auto-generated>
#pragma warning disable 1591
#pragma warning disable 0414, 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace SkyWalking.NetworkProtocol {
......@@ -64,7 +61,7 @@ namespace SkyWalking.NetworkProtocol {
{
}
public virtual grpc::AsyncClientStreamingCall<global::SkyWalking.NetworkProtocol.UpstreamSegment, global::SkyWalking.NetworkProtocol.Downstream> collect(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncClientStreamingCall<global::SkyWalking.NetworkProtocol.UpstreamSegment, global::SkyWalking.NetworkProtocol.Downstream> collect(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return collect(new grpc::CallOptions(headers, deadline, cancellationToken));
}
......
......@@ -14,7 +14,17 @@
<ItemGroup>
<ProjectReference Include="..\SkyWalking.Abstractions\SkyWalking.Abstractions.csproj" />
<ProjectReference Include="..\SkyWalking.NetworkProtocol\SkyWalking.NetworkProtocol.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="NetworkProtocol" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.6.1" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.6.1" />
<PackageReference Include="Grpc" Version="1.15.0" />
<PackageReference Include="Grpc.Tools" Version="1.15.0" />
</ItemGroup>
</Project>
......@@ -33,7 +33,7 @@ namespace SkyWalking.Utilities.Configuration
{"SkyWalking:ApplicationCode", "My_Application"},
{"SkyWalking:SpanLimitPerSegment", "300"},
{"SkyWalking:Sampling:SamplePer3Secs", "-1"},
{"SkyWalking:Logging:Level", "Info"},
{"SkyWalking:Logging:Level", "Information"},
{"SkyWalking:Logging:FilePath", defaultLogFile},
{"SkyWalking:Transport:Interval", "3000"},
{"SkyWalking:Transport:PendingSegmentLimit", "30000"},
......
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