Skip to content

Commit

Permalink
BREAKING CHANGE: Refactor to use OTEL messages directly (#10)
Browse files Browse the repository at this point in the history
* Pulling in specific branch of OddDotProto.

* Imported latest proto.
Fixed build errors.
Adjusted tests.

* Removing submodule to place in separate 'submodule' directory

* Update submodule directory.

* Pulled in updates to proto files.

* Updated OddDotProto submodule back to main.

* Bumped GitVersion.yml
  • Loading branch information
DoubleTK authored Oct 11, 2024
1 parent 85b57db commit 57fc325
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "src/OddDotCSharp/OddDotProto"]
path = src/OddDotCSharp/OddDotProto
[submodule "src/OddDotCSharp/submodules/OddDotProto"]
path = src/OddDotCSharp/submodules/OddDotProto
url = https://github.com/OddDotNet/OddDotProto.git
8 changes: 8 additions & 0 deletions .idea/.idea.OddDotCSharp/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.OddDotCSharp/.idea/protoeditor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/.idea.OddDotCSharp/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
workflow: GitHubFlow/v1
next-version: 0.0.2
next-version: 0.1.0
5 changes: 3 additions & 2 deletions src/OddDotCSharp/OddDotCSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
</PackageReference>
</ItemGroup>

<!-- Internal proto definitions -->
<!-- Proto definitions -->
<ItemGroup>
<Protobuf Include="OddDotProto/**/*.proto" GrpcServices="Client" ProtoRoot="OddDotProto/"/>
<Protobuf Include="submodules/OddDotProto/submodules/opentelemetry/**/*.proto" GrpcServices="None" ProtoRoot="submodules/OddDotProto/submodules"/>
<Protobuf Include="submodules/OddDotProto/odddotproto/**/*.proto" GrpcServices="Client" ProtoRoot="submodules/OddDotProto/odddotproto/proto/trace/v1" AdditionalImportDirs="submodules/OddDotProto/submodules"/>
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/OddDotCSharp/OddDotProto
Submodule OddDotProto deleted from 02d312
2 changes: 1 addition & 1 deletion src/OddDotCSharp/SpanQueryRequestBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using OddDotNet.Proto.Spans.V1;
using OddDotNet.Proto.Trace.V1;

namespace OddDotCSharp
{
Expand Down
10 changes: 6 additions & 4 deletions src/OddDotCSharp/WhereSpanFilterConfigurator.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using Google.Protobuf;
using OddDotNet.Proto.Spans.V1;
using OddDotNet.Proto.Trace.V1;
using OpenTelemetry.Proto.Trace.V1;


namespace OddDotCSharp
{
Expand Down Expand Up @@ -84,7 +86,7 @@ public WhereSpanFilterConfigurator AddFilter(WhereSpanPropertyFilter.ValueOneofC
/// <param name="compare">The <see cref="SpanStatusCode"/> to compare the property against.</param>
/// <param name="compareAs">The type of comparison to do. See <see cref="EnumCompareAsType"/> for more details.</param>
/// <returns>this <see cref="WhereSpanFilterConfigurator"/>.</returns>
public WhereSpanFilterConfigurator AddSpanStatusCodeFilter(SpanStatusCode compare,
public WhereSpanFilterConfigurator AddSpanStatusCodeFilter(Status.Types.StatusCode compare,
EnumCompareAsType compareAs)
{
var spanStatusCodeProperty = new SpanStatusCodeProperty
Expand All @@ -100,10 +102,10 @@ public WhereSpanFilterConfigurator AddSpanStatusCodeFilter(SpanStatusCode compar
/// <summary>
/// Adds a <see cref="SpanKindProperty"/> filter to the list of filters.
/// </summary>
/// <param name="compare">The <see cref="SpanKind"/> to compare the property against.</param>
/// <param name="compare">The <see cref="Span.Types.SpanKind"/> to compare the property against.</param>
/// <param name="compareAs">The type of comparison to do. See <see cref="EnumCompareAsType"/> for more details.</param>
/// <returns>this <see cref="WhereSpanFilterConfigurator"/>.</returns>
public WhereSpanFilterConfigurator AddSpanKindFilter(SpanKind compare,
public WhereSpanFilterConfigurator AddSpanKindFilter(Span.Types.SpanKind compare,
EnumCompareAsType compareAs)
{
var spanKindProperty = new SpanKindProperty
Expand Down
1 change: 1 addition & 0 deletions src/OddDotCSharp/submodules/OddDotProto
Submodule OddDotProto added at c7dd04
7 changes: 4 additions & 3 deletions tests/OddDotCSharp.Tests/SpanQueryRequestBuilderTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using OddDotNet.Proto.Spans.V1;
using OddDotNet.Proto.Trace.V1;
using OpenTelemetry.Proto.Trace.V1;

namespace OddDotCSharp.Tests;

Expand Down Expand Up @@ -176,7 +177,7 @@ public void AddUInt64PropertyFilter()
public void AddSpanStatusCodePropertyFilter()
{
var builder = new SpanQueryRequestBuilder();
SpanStatusCode code = SpanStatusCode.Ok;
Status.Types.StatusCode code = Status.Types.StatusCode.Ok;
builder.Where(filters =>
{
filters.AddSpanStatusCodeFilter(code, EnumCompareAsType.Equals);
Expand All @@ -197,7 +198,7 @@ public void AddSpanStatusCodePropertyFilter()
public void AddSpanKindPropertyFilter()
{
var builder = new SpanQueryRequestBuilder();
SpanKind kind = SpanKind.Internal;
Span.Types.SpanKind kind = Span.Types.SpanKind.Internal;
builder.Where(filters =>
{
filters.AddSpanKindFilter(kind, EnumCompareAsType.Equals);
Expand Down

0 comments on commit 57fc325

Please sign in to comment.