Skip to content

Commit

Permalink
Merge pull request #2 from z1c0/master
Browse files Browse the repository at this point in the history
Sync repository
  • Loading branch information
z1c0 authored Aug 12, 2019
2 parents 7e6e91f + 0900aa9 commit c6ef11b
Show file tree
Hide file tree
Showing 490 changed files with 19,044 additions and 11,969 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.user
*.userosscache
*.sln.docstates
.vscode/solution-explorer

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "Jaeger Exporter Tests (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/test/OpenTelemetry.Exporter.Jaeger.Tests/bin/Debug/netcoreapp2.2/OpenTelemetry.Exporter.Jaeger.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/test/OpenTelemetry.Exporter.Jaeger.Tests",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
Expand Down
6 changes: 5 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
"tasks": [
{
"label": "build",
"command": "dotnet build",
"command": "dotnet",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"args": [
"build",
"/property:GenerateFullPaths=true"
],
"problemMatcher": "$msCompile"
}
]
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ the release.
1. Modified the content of PrometheusExporterOptions from `Uri()` to `string`.
2. `HttpListener()` can support "+" as: hostname which listens on all ports.
3. Modified samples/TestPrometheus.cs to safely use the new implementation.
4. Jaeger exporter implemented

- Copy from
[OpenCensus](http://github.com/census-instrumentation/opencensus-csharp) at
Expand Down
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Reporting bugs is an important contribution. Please make sure to include:
- expected and actual behavior.
- dotnet version that application is compiled on and running with (it may be
different - for instance target framework was set to .NET 4.6 for
compilation, but application is running on .NET 4.7.3).
compilation, but application is running on .NET 4.7.2).
- exception call stack and other artifacts.
- if possible - repro application and steps to reproduce.

Expand Down Expand Up @@ -42,6 +42,12 @@ Remember to always work in a branch of your local copy, as you might otherwise h

Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#github-workflow) section of general project contributing guide.

### Prerequisites

* Git client and command line tools. You may use Visual Studio to clone the repo, but we use [SourceLink](https://github.com/dotnet/sourcelink) to build and it needs git.
* Visual Studio 2017+ or VS Code
* .NET Framework 4.6+ and .NET Core 2.1+

### Build

You can use Visual Studio 2017+ or VS Code to contribute. Just open root folder
Expand Down
6 changes: 6 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@
<PropertyGroup>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl>https://github.com/open-telemetry/opentelemetry-dotnet</PackageProjectUrl>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2" PrivateAssets="All" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" Condition="'$(SkipAnalysis)'!='true'">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion OpenTelemetry.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project=".\build\Version.props" />

<ItemGroup>
<Solution Include="OpenTelemetry.sln" />
Expand Down
53 changes: 50 additions & 3 deletions OpenTelemetry.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28407.52
# Visual Studio 15
VisualStudioVersion = 15.0.28307.705
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry", "src\OpenTelemetry\OpenTelemetry.csproj", "{AE3E3DF5-4083-4C6E-A840-8271B0ACDE7E}"
EndProject
Expand Down Expand Up @@ -69,6 +69,25 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E359
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exporters", "samples\Exporters\Exporters.csproj", "{6EC9DEC9-086F-4F29-BF3F-5FC7253829D5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LoggingTracer", "LoggingTracer", "{D9C14CDA-5182-4DEA-8606-98FF1A388BD3}"
ProjectSection(SolutionItems) = preProject
samples\LoggingTracer\readme.md = samples\LoggingTracer\readme.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoggingTracer", "samples\LoggingTracer\LoggingTracer\LoggingTracer.csproj", "{1EEF77DF-7552-4265-B64C-FA13BC40C256}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoggingTracer.Demo.ConsoleApp", "samples\LoggingTracer\LoggingTracer.Demo.ConsoleApp\LoggingTracer.Demo.ConsoleApp.csproj", "{607B3861-4D69-43EF-84CE-19F18CD5339A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LoggingTracer.Demo.AspNetCore", "samples\LoggingTracer\LoggingTracer.Demo.AspNetCore\LoggingTracer.Demo.AspNetCore.csproj", "{1EB74FCE-55C5-476A-8BB0-C46B77FE1070}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Jaeger", "src\OpenTelemetry.Exporter.Jaeger\OpenTelemetry.Exporter.Jaeger.csproj", "{8D47E3CF-9AE3-42FE-9084-FEB72D9AD769}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Jaeger.Tests", "test\OpenTelemetry.Exporter.Jaeger.Tests\OpenTelemetry.Exporter.Jaeger.Tests.csproj", "{21E69213-72D5-453F-BD00-75EF36AC4965}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Thrift", "lib\Thrift\Thrift.csproj", "{ED179037-DDB3-4780-A24F-F56278623EBB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lib", "lib", "{9D2D6933-C28C-4541-9A25-FDAE0DA5A5D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -147,14 +166,42 @@ Global
{6EC9DEC9-086F-4F29-BF3F-5FC7253829D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6EC9DEC9-086F-4F29-BF3F-5FC7253829D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6EC9DEC9-086F-4F29-BF3F-5FC7253829D5}.Release|Any CPU.Build.0 = Release|Any CPU
{1EEF77DF-7552-4265-B64C-FA13BC40C256}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1EEF77DF-7552-4265-B64C-FA13BC40C256}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1EEF77DF-7552-4265-B64C-FA13BC40C256}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EEF77DF-7552-4265-B64C-FA13BC40C256}.Release|Any CPU.Build.0 = Release|Any CPU
{607B3861-4D69-43EF-84CE-19F18CD5339A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{607B3861-4D69-43EF-84CE-19F18CD5339A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{607B3861-4D69-43EF-84CE-19F18CD5339A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{607B3861-4D69-43EF-84CE-19F18CD5339A}.Release|Any CPU.Build.0 = Release|Any CPU
{1EB74FCE-55C5-476A-8BB0-C46B77FE1070}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1EB74FCE-55C5-476A-8BB0-C46B77FE1070}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1EB74FCE-55C5-476A-8BB0-C46B77FE1070}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EB74FCE-55C5-476A-8BB0-C46B77FE1070}.Release|Any CPU.Build.0 = Release|Any CPU
{8D47E3CF-9AE3-42FE-9084-FEB72D9AD769}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D47E3CF-9AE3-42FE-9084-FEB72D9AD769}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D47E3CF-9AE3-42FE-9084-FEB72D9AD769}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D47E3CF-9AE3-42FE-9084-FEB72D9AD769}.Release|Any CPU.Build.0 = Release|Any CPU
{21E69213-72D5-453F-BD00-75EF36AC4965}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21E69213-72D5-453F-BD00-75EF36AC4965}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21E69213-72D5-453F-BD00-75EF36AC4965}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21E69213-72D5-453F-BD00-75EF36AC4965}.Release|Any CPU.Build.0 = Release|Any CPU
{ED179037-DDB3-4780-A24F-F56278623EBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED179037-DDB3-4780-A24F-F56278623EBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED179037-DDB3-4780-A24F-F56278623EBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED179037-DDB3-4780-A24F-F56278623EBB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7CB2F02E-03FA-4FFF-89A5-C51F107623FD} = {61188153-47FB-4567-AC9B-79B2435853EB}
{F2F81E76-6A0E-466B-B673-EBBF1A9ED075} = {77C7929A-2EED-4AA6-8705-B5C443C8AA0F}
{6EC9DEC9-086F-4F29-BF3F-5FC7253829D5} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E}
{D9C14CDA-5182-4DEA-8606-98FF1A388BD3} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E}
{1EEF77DF-7552-4265-B64C-FA13BC40C256} = {D9C14CDA-5182-4DEA-8606-98FF1A388BD3}
{607B3861-4D69-43EF-84CE-19F18CD5339A} = {D9C14CDA-5182-4DEA-8606-98FF1A388BD3}
{1EB74FCE-55C5-476A-8BB0-C46B77FE1070} = {D9C14CDA-5182-4DEA-8606-98FF1A388BD3}
{ED179037-DDB3-4780-A24F-F56278623EBB} = {9D2D6933-C28C-4541-9A25-FDAE0DA5A5D4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {55639B5C-0770-4A22-AB56-859604650521}
Expand Down
56 changes: 50 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ We encourage contributions. Use tags [up-for-grabs][up-for-grabs-issues] and

## Packages

### Nightly builds:
Myget feeds:
- NuGet V3 feed: https://www.myget.org/F/opentelemetry/api/v3/index.json
- NuGet V2 feed: https://www.myget.org/F/opentelemetry/api/v2

### API and implementation

| Package | MyGet (CI) | NuGet (releases) |
Expand All @@ -49,7 +54,7 @@ We encourage contributions. Use tags [up-for-grabs][up-for-grabs-issues] and

## OpenTelemetry QuickStart: collecting data

You can use Open Census API to instrument code and report data. Or use one of
You can use OpenTelemetry API to instrument code and report data. Or use one of
automatic data collection modules.

### Using ASP.NET Core incoming requests collector
Expand Down Expand Up @@ -161,6 +166,42 @@ Outgoing http calls to Redis made usign StackExchange.Redis library can be autom

## OpenTelemetry QuickStart: exporting data

### Using the Jaeger exporter

The Jaeger exporter communicates to a Jaeger Agent through the compact thrift protocol on
the Compact Thrift API port. You can configure the Jaeger exporter by following the directions below:

1. [Get Jaeger][jaeger-get-started].
2. Configure the `JaegerExporter`
- `ServiceName`: The name of your application or service.
- `AgengHost`: Usually `localhost` since an agent should
usually be running on the same machine as your application or service.
- `AgentPort`: The compact thrift protocol port of the Jaeger Agent (default `6831`)
- `MaxPacketSize`: The maximum size of each UDP packet that gets sent to the agent. (default `65000`)
3. See the [sample][jaeger-sample] for an example of how to use the exporter.

``` csharp
var exporter = new JaegerExporter(
new JaegerExporterOptions
{
ServiceName = "tracing-to-jaeger-service",
AgentHost = host,
AgentPort = port,
},
Tracing.ExportComponent);

exporter.Start();

var span = tracer
.SpanBuilder("incoming request")
.SetSampler(Samplers.AlwaysSample)
.StartSpan();

Thread.Sleep(TimeSpan.FromSeconds(1));
span.End();
```


### Using Zipkin exporter

Configure Zipkin exporter to see traces in Zipkin UI.
Expand Down Expand Up @@ -199,7 +240,7 @@ Configure Prometheus exporter to have stats collected by Prometheus.
var exporter = new PrometheusExporter(
new PrometheusExporterOptions()
{
Url = new Uri("http://localhost:9184/metrics/")
Url = "http://+:9184/metrics/"
},
Stats.ViewManager);

Expand Down Expand Up @@ -316,15 +357,18 @@ deprecate it for 18 months before removing it, if possible.
[up-for-grabs-issues]: https://github.com/open-telemetry/OpenTelemetry-dotnet/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs
[good-first-issues]: https://github.com/open-telemetry/OpenTelemetry-dotnet/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[zipkin-get-started]: https://zipkin.io/pages/quickstart.html
[jaeger-get-started]: https://www.jaegertracing.io/docs/1.13/getting-started/
[ai-get-started]: https://docs.microsoft.com/azure/application-insights
[stackdriver-trace-setup]: https://cloud.google.com/trace/docs/setup/
[stackdriver-monitoring-setup]: https://cloud.google.com/monitoring/api/enable-api
[GAE]: https://cloud.google.com/appengine/docs/flexible/dotnet/quickstart
[GKE]: https://codelabs.developers.google.com/codelabs/cloud-kubernetes-aspnetcore/index.html?index=..%2F..index#0
[gcp-auth]: https://cloud.google.com/docs/authentication/getting-started
[semver]: http://semver.org/
[ai-sample]: https://github.com/open-telemetry/OpenTelemetry-dotnet/blob/master/src/Samples/TestApplicationInsights.cs
[stackdriver-sample]: https://github.com/open-telemetry/OpenTelemetry-dotnet/blob/master/src/Samples/TestStackdriver.cs
[zipkin-sample]: https://github.com/open-telemetry/OpenTelemetry-dotnet/blob/master/src/Samples/TestZipkin.cs
[ai-sample]: https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/samples/Exporters/TestApplicationInsights.cs
[stackdriver-sample]: https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/samples/Exporters/TestStackdriver.cs
[zipkin-sample]: https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/samples/Exporters/TestZipkin.cs
[jaeger-sample]: https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/samples/Exporters/TestJaeger.cs
[prometheus-get-started]: https://prometheus.io/docs/introduction/first_steps/
[prometheus-sample]: https://github.com/open-telemetry/OpenTelemetry-dotnet/blob/master/src/Samples/TestPrometheus.cs
[prometheus-sample]: https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/samples/Exporters/TestPrometheus.cs
10 changes: 9 additions & 1 deletion build/Common.prod.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Version.props" />

<ItemGroup>
<PackageReference Include="MinVer" Version="1.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/OpenTelemetry.prod.ruleset</CodeAnalysisRuleSet>
<NoWarn>$(NoWarn),1573,1591,1712</NoWarn>
<PackageOutputPath Condition="$(Build_ArtifactStagingDirectory) != ''">$(Build_ArtifactStagingDirectory)</PackageOutputPath>
<GenerateDocumentationFile Condition="$(OS) == 'Windows_NT'">true</GenerateDocumentationFile>
</PropertyGroup>
Expand All @@ -13,6 +20,7 @@
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)/debug.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion build/Common.test.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">
<IsTestProject>true</IsTestProject>
<CollectCoverage Condition="$(CollectCoverage) == ''">true</CollectCoverage>
<!--CollectCoverage Condition="$(CollectCoverage) == ''">true</CollectCoverage-->
</PropertyGroup>

<PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions build/OpenTelemetry.prod.loose.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,6 @@
<Rule Id="SA1649" Action="Warning" />
<Rule Id="SA1651" Action="Warning" />
<Rule Id="SA1652" Action="Warning" />
<Rule Id="CS1591" Action="None" />
</Rules>
</RuleSet>
30 changes: 0 additions & 30 deletions build/Version.props

This file was deleted.

8 changes: 8 additions & 0 deletions lib/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Import Project="..\Directory.Build.props" Condition="Exists('..\Directory.Build.props')" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenTelemetry.sln'))\build\Common.prod.props" />

<PropertyGroup>
<SkipAnalysis>True</SkipAnalysis>
</PropertyGroup>
</Project>
10 changes: 10 additions & 0 deletions lib/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<Import Project="..\Directory.Build.targets" Condition="Exists('..\Directory.Build.targets')" />

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
Loading

0 comments on commit c6ef11b

Please sign in to comment.