Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moved Stats away to SDK #121

Merged
merged 2 commits into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\OpenTelemetry.Abstractions\OpenTelemetry.Abstractions.csproj" />
<ProjectReference Include="..\OpenTelemetry\OpenTelemetry.csproj" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.8.0-beta1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\OpenTelemetry.Abstractions\OpenTelemetry.Abstractions.csproj" />
<ProjectReference Include="..\OpenTelemetry\OpenTelemetry.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ public static LabelDescriptor ToLabelDescriptor(this TagKey tagKey)
return labelDescriptor;
}

public static Distribution CreateDistribution(
public static Google.Api.Distribution CreateDistribution(
IDistributionData distributionData,
IBucketBoundaries bucketBoundaries)
{
var bucketOptions = bucketBoundaries.ToBucketOptions();
var distribution = new Distribution
var distribution = new Google.Api.Distribution
{
BucketOptions = bucketOptions,
BucketCounts = { CreateBucketCounts(distributionData.BucketCounts) },
Expand Down Expand Up @@ -333,4 +333,4 @@ internal static string GetStackdriverLabelKey(string label)
return label.Replace('/', '_');
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ static class SpanExtensions
/// <param name="spanData">Span in OpenTelemetry format</param>
/// <param name="projectId">Google Cloud Platform Project Id</param>
/// <returns></returns>
public static Span ToSpan(this SpanData spanData, string projectId)
public static Google.Cloud.Trace.V2.Span ToSpan(this SpanData spanData, string projectId)
{
var spanId = spanData.Context.SpanId.ToLowerBase16();

// Base span settings
var span = new Span
var span = new Google.Cloud.Trace.V2.Span
{
SpanName = new SpanName(projectId, spanData.Context.TraceId.ToLowerBase16(), spanId),
SpanId = spanId,
Expand All @@ -63,7 +63,7 @@ public static Span ToSpan(this SpanData spanData, string projectId)
// Span Links
if (spanData.Links != null)
{
span.Links = new Span.Types.Links
span.Links = new Google.Cloud.Trace.V2.Span.Types.Links
{
DroppedLinksCount = spanData.Links.DroppedLinksCount,
Link = { spanData.Links.Links.Select(l => l.ToLink()) }
Expand All @@ -73,7 +73,7 @@ public static Span ToSpan(this SpanData spanData, string projectId)
// Span Attributes
if (spanData.Attributes != null)
{
span.Attributes = new Span.Types.Attributes
span.Attributes = new Google.Cloud.Trace.V2.Span.Types.Attributes
{
DroppedAttributesCount = spanData.Attributes != null ? spanData.Attributes.DroppedAttributesCount : 0,

Expand All @@ -86,15 +86,15 @@ public static Span ToSpan(this SpanData spanData, string projectId)
return span;
}

public static Span.Types.Link ToLink(this ILink link)
public static Google.Cloud.Trace.V2.Span.Types.Link ToLink(this ILink link)
{
var ret = new Span.Types.Link();
var ret = new Google.Cloud.Trace.V2.Span.Types.Link();
ret.SpanId = link.Context.SpanId.ToLowerBase16();
ret.TraceId = link.Context.TraceId.ToLowerBase16();

if (link.Attributes != null)
{
ret.Attributes = new Span.Types.Attributes
ret.Attributes = new Google.Cloud.Trace.V2.Span.Types.Attributes
{

DroppedAttributesCount = OpenTelemetry.Trace.Config.TraceParams.Default.MaxNumberOfAttributes - link.Attributes.Count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\OpenTelemetry.Abstractions\OpenTelemetry.Abstractions.csproj" />
<ProjectReference Include="..\OpenTelemetry\OpenTelemetry.csproj" />
</ItemGroup>
</Project>