Commit Graph

385 Commits

Author SHA1 Message Date
Łukasz Pyrzyk 6ea1238117
New using syntax (#528)
Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-03-06 10:07:19 -08:00
Mikel Blanchard 1420a100ce
JaegerExporter: Performance Improvements 2 (#524)
* Fixed boxing of Link & SpanContext structs in Jaeger.

* Enumerations in Jaeger are now allocation free.

* Removed a few spots where allocations were happening for no reason.

* Refactoring.

* Refactor.

* Turned off TieredCompilation for benchmarks because it can lead to false-positives when running through VS.

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-03-05 21:51:02 -08:00
Sergey Kanzhelev d966b19d00
removing unused variables in zipkin DoPostAsync method (#521)
* removing unused variables in zipkin DoPostAsync method

* Removing unused variable

* removing unused using

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-03-05 12:47:13 -08:00
Sergey Kanzhelev d48aad6290
Enabled C# 8 (#527) 2020-03-05 09:52:32 -08:00
Sergey Kanzhelev 3138d14613
rename samplers and Decision to SamplingResult (#523)
* rename samplers and Decision to SamplingResult

* forgotten rename to make tests pass
2020-03-05 09:30:48 -08:00
Sergey Kanzhelev e71d37dc16
updating version of dotnet in the azure pipeline (#522)
adding package type property in yml

updating task type

updating linux and windows pipelines
2020-03-04 14:48:28 -08:00
Sergey Kanzhelev a6c7876cab
fixed timeout issue (#520) 2020-03-04 11:40:42 -08:00
Sergey Kanzhelev 9b24562c90
Removed redundant casts and comparisons from PutHttpStatusCode (#515)
* Removed redundant casts

* Setting status to Unknown by default

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-03-04 11:12:22 -08:00
Sergey Kanzhelev 771f744682
Rename Handles to Bound Instruments (OTEP 70) (#519) 2020-03-04 10:06:51 -08:00
Mike Goldsmith cfd198429c
Remove binary format (#513)
* remove binary format

* remove redundnt assert in TracerShimTests

* add null tracer and text format assertion

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-03-03 10:31:07 -08:00
Łukasz Pyrzyk f0a0b07ffb
Adjusted UseZipkin to new signature (#514)
Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-03-02 09:52:33 -08:00
Timothy Mothra 988984a7fa
fix typo in readme (#510)
I was asked to fix spelling errors when found. :)
2020-03-02 09:29:11 -08:00
Mikel Blanchard d5b4248261
JaegerExporter: Performance Improvements (#494)
* Initial work.

* First complete version of Jaeger with perf improvements.

* Added JaegerExporter benchmarks.

* More performance revisions.

* ValueTask perf improvements.

* Missed a couple tasks.

* Removed null check against struct.

* Tweaked how structs are used.

* Figured out why the structs were eating more memory. Fixed up unit tests.

* Reverted change to ToJaegerSpan extension signature.

* Fixed JaegerUdpBatcher not calling CloseAsync in dispose, fixed SpanExporters not being disposed.

* Reference System.Threading.Tasks.Extensions for net46 & netstandard2.0 builds of Thirft to add in ValueTask.

* Removed the fork of Thrift in favor of the official package.

* Increased number of spans per iteration in jaeger benchmarks. Switched ApacheThrift to PrivateAssets=all in jaeger exporter project.

* New algorithm for memory management.

* Fixed double-allocation of tags.

* Immutable structs. Added cancellationToken to IJaegerClient interface.

* Added lists that can be backed be pooled buffers.

* Everything in implementation folder is now internal.

* Return ref from PooledList indexer.

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-02-26 14:49:39 -08:00
Mike Goldsmith 677c5ae558
Remove guage & add Observer metric instrument (#498)
* remove guage instrument

* add observer metric insrument

* update aggregator when observing value in ObserverHandle

* add observer test, enable measure and counter tests

* fix metric tests

* suffix instruments with Metric

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-02-26 14:18:25 -08:00
Mike Goldsmith f0633396bc
increase time tolerance in EventTests (#505) 2020-02-25 15:25:57 -08:00
Mike Goldsmith faafd05d3f
Add support for array attributes (#500)
* add support for array attributes

* add support for IEnumerable

* use ToString() for unsupported attribute types

* use try/catch when iterating attribute value

* add note enumerations may be iterabled more than once

* move enumeration note to parameter description

* fix typo in SetAttribute param description

Co-Authored-By: Liudmila Molkova <lmolkova@microsoft.com>

* remove null check for attribute value

Co-Authored-By: Liudmila Molkova <lmolkova@microsoft.com>

* add missing using statement for IEnumerable

* fix build warnings from new arrayy tests

* revert calling ToString() for invalod attribute value types

Co-authored-by: Liudmila Molkova <lmolkova@microsoft.com>
Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-02-21 10:41:29 -08:00
Vu Tran 7ecb080108
Keys with digits are still accepted (#499)
* Keys with digits are still accepted

* add a test

* Update TracestateUtilsTests.cs

no need to test with a value ending with a white space

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-02-20 21:49:47 -08:00
Mikel Blanchard 4031bd2b87
JaegerExporter: Send a batch for each remote service (#486)
* Updated JaegerExporter to send a batch per remote service so that the UI can correctly detect dependencies for non-instrumented external calls.

* Code review.

* Fixed broken batch size calculation.

* Moved lock above try.

* Fixed failing unit test.

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-02-20 21:42:24 -08:00
Mikel Blanchard a7206200a5
Zipkin Exporter: Specify RemoteEndpoint (#483)
* Switched to System.Text.Json for .NET Standard 2.0 target. Added caching of ZipkinEndpoints. Added support for sending RemoteEndpoint to Zipkin API.

* Code review feedback.

* Code review.

* Zipkin performance improvements.

* Made json header static.

* Removed debug code.

* Bumped up the numbers of spans in benchmark to get more consistent results.

* Code review.

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-02-18 15:16:15 -08:00
Mike Goldsmith 3cba598345
Fix build warnings (#495)
* use correct type suffix instead of casting (SA1139) in spanTest

* fix comparison of strings in TracerFactoryTest
2020-02-17 12:12:24 -08:00
Mikel Blanchard 0c92b3e054
OpenTelemetry.Collector.Dependencies: HttpHandlerDiagnosticListener error description lost (#487)
* Fixed HttpHandlerDiagnosticListener so it doesn't clear status description after it sets it. Updated JaegerExporter to send ot.status_code & ot.status_description.

* Code review.

* Code review.
2020-02-17 11:22:03 -08:00
Mike Goldsmith 66c778fc77
Add converters for ActivitySpanId and ActivityTraceId (#490)
* add converters for ActivitySpanId and ActivityTraceId

* make converts internal

Co-authored-by: Austin Parker <austin@lightstep.com>
2020-02-12 15:43:30 -05:00
Mikel Blanchard 91d1ef25f7
JaegerExporter: Use LibraryResource or JaegerExporterOptions (#485)
* Modded the Jaeger Exporter to also look at Resources for ServiceName & ProcessTags.

* You can now pass additional attributes to CreateServiceResource helper. Moved "service.*" resource strings into constants.

* Code review feedback.

* Code review feedback.

* Code review feedback.

* Removed nested dictionary.

Co-authored-by: Liudmila Molkova <lmolkova@microsoft.com>
2020-02-12 11:20:09 -08:00
Liudmila Molkova e1d025a0eb
ApplicationInsights exporter: minor improvements for EventHubs and readme (#484)
* ApplicationInsights: minor improvements for EventHubs and readme

* a couple more fixes for EH
2020-02-10 08:07:04 -08:00
HarnidhK 2309be5b2d
Delete Exporters.csproj (#481)
Fix for https://github.com/open-telemetry/opentelemetry-dotnet/issues/480
2020-02-05 12:04:07 -08:00
HarnidhK 07d794012e
Classes scaffolding for zPages (#474)
* Classes scaffolding for zPages

Implemented Http Server to create HTML that displays span count using SimpleSpanProcessor

* incorporating review comments

- made ContentType const in zpages stats builder
- modified return statements in zpages exporter
- removed implementation folder from ZPages.csproj
- changed default uri for zpages test application
- changed data type of spanCount to long, and doing Interlocked.Increment when span starts

* fixing minor error

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-02-04 22:11:40 -08:00
Peter Wiese 4d01c8c932
[JaegerExporter] Periodically flush undelivered Spans (#479)
* [JaegerExporter] Periodically flush undelivered Spans

A Span will never be delivered if the maximum batch size isn't hit or the
component is not torn down. We need to flush these undelivered Spans.

The timer is enabled if a Span is batched up and not sent and then disabled
the next time the batch is flushed.

* Forgot to Dispose the timer

* Switching to SemaphoreSlim for the async aware lock
2020-02-04 13:07:08 -08:00
Liudmila Molkova 184e63c4ab
Set operation name on the request, since UX is sensitive to it (#477) 2020-01-30 16:36:38 -05:00
SychevIgor 63d9bf145c
Asp.net core based sample of ApplicationInsights export (#433)
* Asp.net core based sample of ApplicationInsights export

* links to samples

* update links

* fixed solution

* fix merge issues

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-01-29 12:18:16 -08:00
Mike Goldsmith 66bb5199b1
Add more StackDriver labels (#471)
* update stackdriver user agent label to /http/user_agent

* More SD label replacements (component, http.route, http.url)

Co-authored-by: Nicolai Brogaard <nmb@minserver.dk>
Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-01-29 11:44:29 -08:00
Liudmila Molkova 633dda37bd
Convert ISpan to abstract class and rename to TelemetrySpan (#464) 2020-01-27 15:28:55 -08:00
Nicolai Brogaard 1aee418730 Update github links for http specification (#473) 2020-01-27 13:34:26 -08:00
Mike Goldsmith d97217e445 add ConsoleExporter extension methods (#468)
Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-01-24 09:11:31 -08:00
Liudmila Molkova 56b12f9e31 Minor Fixes for Application Insights EventHub support (#469) 2020-01-23 23:20:24 -08:00
Liudmila Molkova 7424f156cc
Make SpanData tiny again (#465)
* Make SpanData tiny again: add internal SpanSdk ctor from exportable paramters

* add tests
2020-01-23 18:32:37 -08:00
Liudmila Molkova 85e589a6fc
Remove propagators from tracing API (#466) 2020-01-23 11:54:20 -08:00
Mike Goldsmith 9ddcc0adcc Refactor PrometheusExporter not hold internal HttpListener (#428)
* add extension methods to register prometheus exporter

- IApplicationBuilder
- WebHostBuilder

* update http and hosting abstractions packages to 2.2.0

* fix web host extensions

* extract metricHttpServer from PrometheusExporter

* remove moq dependency in promethus tests

* remove IApplicationBuilder and IWebHostBuilder prometheus extensions

* revert changes to prometheus csproj

* rename MetricsHttpServer to PrometheusExporterMetricsHttpServer

* add IDisposeable to PrometheusExporterMetricsHttpServer

* refactor PrometheusExporterMetricsHttpServer to not require PromethusOptions as param

* move CancellationToken from constructor to Start method

* check http servere is both not null and listening before calling stop

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-01-22 22:22:26 -08:00
Peter Wiese e7c004f37a SpanId mismatched endianess in Jaeger UI (#459)
The TraceId translation to High/Low longs handles endianess but the SpanId did not.
I also took the opportunity to switch to Span<byte> and reinterpret cast to eliminate byte array allocations.

Verified speed + 0 allocations using Benchmark

Co-authored-by: Liudmila Molkova <lmolkova@microsoft.com>
2020-01-22 17:53:17 -08:00
Liudmila Molkova 1ba11917e8
Add helper to create service resource (#457)
* Add helper to create service resource

* add tests
2020-01-22 16:48:12 -08:00
Liudmila Molkova cc4665836f move ZPages to src and fix solution (#458) 2020-01-22 12:09:32 -08:00
Mike Goldsmith e605659411 add MyGet links for Console Exporter (#460) 2020-01-22 09:39:35 -08:00
Mike Goldsmith cb0753d077 Replace span labels with StackDriver versions (#453)
* replace span labels with StackDriver versions

* fix typo in SpanExtensions

Co-Authored-By: Nicolai Brogaard <nmb@minserver.dk>

* fix typo in SpanExtensions

Co-Authored-By: Nicolai Brogaard <nmb@minserver.dk>

* add label conversion from http.path to /http/url

Co-authored-by: Nicolai Brogaard <nmb@minserver.dk>
Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-01-21 15:15:30 -08:00
Tarek Mahmoud Sayed 77e8510e61 Introduce DistributedContextBuilder (#444)
* Introduce DistributedContextBuilder

* Fix failing test
2020-01-21 11:13:35 -08:00
Liudmila Molkova 1e6dbb79e1 Add public SpanData constructor with all exportable paramters (#454)
* Add SpanData public constructor for out-of-band spans and testing

* Add span data test

* fix tests

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-01-21 09:18:55 -08:00
Mike Goldsmith bd75ae6bb8 Add simple console exporter (#439)
* add generic logger exporter

* remove string builder entry in ExportAsync

* use logger spans

* add null checking for attriute and events

* rename LoggingExporter to LoggerExporter

* refactor LoggerExporter into ConsoleExporter

reduces potential risk of depending on ILogger and having to maintain / use incorrectly. This exporter is designed during learning / debug scenarios.

* add experimental to package tags

* rename LoggingOptions to ConsoleOptions

* refactor ConsoleExporter to use System.Text.JsonSerializer

- increases minimum framework version to `net461`

* add readme to ConsoleExporter

* update tracer name to be console-test

* write each span JSOM directly to Console instad of using StringBuilder

* update ConsoleExporter to use SpanData

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-01-21 09:01:53 -08:00
Liudmila Molkova b52e787807 fix flaky ExportMoreSpansThanTheMaxBatchSize (#452) 2020-01-17 11:53:56 -08:00
Liudmila Molkova da0d4c7f71
AzureSdk shorten span names (#448)
* AzureSdk shorten span names

* add reference to Azure SDK issue
2020-01-17 11:10:51 -08:00
Liudmila Molkova 67add7a5be
Add support for EventHubs tracing in Application Insights exporter (#447) 2020-01-17 10:58:53 -08:00
Peter Wiese 7b4d0ca992 Add SpanKind to Sampler per specs (#449)
According to the current specification, SpanKind is a required parameter to the samplers.
https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/sdk-tracing.md#sampler
2020-01-17 10:39:08 -08:00
Liudmila Molkova b8f53190ab Use status string instead of int value for non-HTTP calls (#446)
Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2020-01-16 21:14:36 -08:00