Skip to content

Commit

Permalink
[Exporter.Instana] File scoped namespace (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek authored Aug 22, 2022
1 parent 2c3d15d commit b645248
Show file tree
Hide file tree
Showing 26 changed files with 1,156 additions and 1,182 deletions.
11 changes: 5 additions & 6 deletions src/OpenTelemetry.Exporter.Instana/IInstanaExporterHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
using System.Diagnostics;
using OpenTelemetry.Resources;

namespace OpenTelemetry.Exporter.Instana
namespace OpenTelemetry.Exporter.Instana;

internal interface IInstanaExporterHelper
{
internal interface IInstanaExporterHelper
{
bool IsWindows();
bool IsWindows();

Resource GetParentProviderResource(BaseExporter<Activity> otelExporter);
}
Resource GetParentProviderResource(BaseExporter<Activity> otelExporter);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
// limitations under the License.
// </copyright>

namespace OpenTelemetry.Exporter.Instana.Implementation
namespace OpenTelemetry.Exporter.Instana.Implementation;

internal interface ISpanSender
{
internal interface ISpanSender
{
void Enqueue(InstanaSpan instanaSpan);
}
void Enqueue(InstanaSpan instanaSpan);
}
81 changes: 40 additions & 41 deletions src/OpenTelemetry.Exporter.Instana/Implementation/InstanaSpan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,83 +16,82 @@

using System.Collections.Generic;

namespace OpenTelemetry.Exporter.Instana.Implementation
namespace OpenTelemetry.Exporter.Instana.Implementation;

internal enum SpanKind
{
internal enum SpanKind
{
#pragma warning disable SA1602 // Enumeration items should be documented
ENTRY,
ENTRY,
#pragma warning restore SA1602 // Enumeration items should be documented
#pragma warning disable SA1602 // Enumeration items should be documented
EXIT,
EXIT,
#pragma warning restore SA1602 // Enumeration items should be documented
#pragma warning disable SA1602 // Enumeration items should be documented
INTERMEDIATE,
INTERMEDIATE,
#pragma warning restore SA1602 // Enumeration items should be documented
#pragma warning disable SA1602 // Enumeration items should be documented
NOT_SET,
NOT_SET,
#pragma warning restore SA1602 // Enumeration items should be documented
}
}

internal class InstanaSpan
{
public InstanaSpanTransformInfo TransformInfo { get; set; }
internal class InstanaSpan
{
public InstanaSpanTransformInfo TransformInfo { get; set; }

public string N { get; internal set; }
public string N { get; internal set; }

public string T { get; internal set; }
public string T { get; internal set; }

public string Lt { get; internal set; }
public string Lt { get; internal set; }

public From F { get; internal set; }
public From F { get; internal set; }

public string P { get; internal set; }
public string P { get; internal set; }

public string S { get; internal set; }
public string S { get; internal set; }

public SpanKind K { get; internal set; }
public SpanKind K { get; internal set; }

public Data Data { get; internal set; }
public Data Data { get; internal set; }

public long Ts { get; internal set; }
public long Ts { get; internal set; }

public long D { get; internal set; }
public long D { get; internal set; }

public bool Tp { get; internal set; }
public bool Tp { get; internal set; }

public int Ec { get; internal set; }
}
public int Ec { get; internal set; }
}

#pragma warning disable SA1402 // File may only contain a single type
internal class From
internal class From
#pragma warning restore SA1402 // File may only contain a single type
{
public string E { get; internal set; }
{
public string E { get; internal set; }

public string H { get; internal set; }
}
public string H { get; internal set; }
}

#pragma warning disable SA1402 // File may only contain a single type
internal class Data
internal class Data
#pragma warning restore SA1402 // File may only contain a single type
{
{
#pragma warning disable SA1300 // Element should begin with upper-case letter
public Dictionary<string, object> data { get; internal set; }
public Dictionary<string, object> data { get; internal set; }

#pragma warning restore SA1300 // Element should begin with upper-case letter
public Dictionary<string, string> Tags { get; internal set; }
public Dictionary<string, string> Tags { get; internal set; }

public List<SpanEvent> Events { get; internal set; }
}
public List<SpanEvent> Events { get; internal set; }
}

#pragma warning disable SA1402 // File may only contain a single type
internal class SpanEvent
internal class SpanEvent
#pragma warning restore SA1402 // File may only contain a single type
{
public string Name { get; internal set; }
{
public string Name { get; internal set; }

public long Ts { get; internal set; }
public long Ts { get; internal set; }

public Dictionary<string, string> Tags { get; internal set; }
}
public Dictionary<string, string> Tags { get; internal set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,24 @@
// </copyright>
using System.Collections.Generic;

namespace OpenTelemetry.Exporter.Instana.Implementation
namespace OpenTelemetry.Exporter.Instana.Implementation;

internal class InstanaSpanFactory
{
internal class InstanaSpanFactory
internal static InstanaSpan CreateSpan()
{
internal static InstanaSpan CreateSpan()
InstanaSpan instanaSpan = new InstanaSpan
{
InstanaSpan instanaSpan = new InstanaSpan
Data = new Data()
{
Data = new Data()
{
data = new Dictionary<string, object>(),
Tags = new Dictionary<string, string>(),
Events = new List<SpanEvent>(8),
},
data = new Dictionary<string, object>(),
Tags = new Dictionary<string, string>(),
Events = new List<SpanEvent>(8),
},

TransformInfo = new InstanaSpanTransformInfo(),
};
TransformInfo = new InstanaSpanTransformInfo(),
};

return instanaSpan;
}
return instanaSpan;
}
}
Loading

0 comments on commit b645248

Please sign in to comment.