Skip to content

Commit

Permalink
Remove ununsed constants from Resource (#1516)
Browse files Browse the repository at this point in the history
* Remove ununsed constants from Resource

* fix public API
  • Loading branch information
cijothomas authored Nov 12, 2020
1 parent be72b17 commit cb7f421
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 19 deletions.
3 changes: 0 additions & 3 deletions src/OpenTelemetry.Exporter.Jaeger/JaegerExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ internal void SetResource(Resource resource)
case Resource.ServiceNamespaceKey:
serviceNamespace = strVal;
continue;
case Resource.LibraryNameKey:
case Resource.LibraryVersionKey:
continue;
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ internal void SetLocalEndpointFromResource(Resource resource)
case Resource.ServiceNamespaceKey:
serviceNamespace = label.Value as string;
continue;
case Resource.LibraryNameKey:
case Resource.LibraryVersionKey:
continue;
}

if (tags == null)
Expand Down
2 changes: 0 additions & 2 deletions src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collecti
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
const OpenTelemetry.Resources.Resource.LibraryNameKey = "name" -> string
const OpenTelemetry.Resources.Resource.LibraryVersionKey = "version" -> string
const OpenTelemetry.Resources.Resource.ServiceInstanceIdKey = "service.instance.id" -> string
const OpenTelemetry.Resources.Resource.ServiceNameKey = "service.name" -> string
const OpenTelemetry.Resources.Resource.ServiceNamespaceKey = "service.namespace" -> string
Expand Down
2 changes: 0 additions & 2 deletions src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collecti
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
const OpenTelemetry.Resources.Resource.LibraryNameKey = "name" -> string
const OpenTelemetry.Resources.Resource.LibraryVersionKey = "version" -> string
const OpenTelemetry.Resources.Resource.ServiceInstanceIdKey = "service.instance.id" -> string
const OpenTelemetry.Resources.Resource.ServiceNameKey = "service.name" -> string
const OpenTelemetry.Resources.Resource.ServiceNamespaceKey = "service.namespace" -> string
Expand Down
2 changes: 0 additions & 2 deletions src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collecti
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
const OpenTelemetry.Resources.Resource.LibraryNameKey = "name" -> string
const OpenTelemetry.Resources.Resource.LibraryVersionKey = "version" -> string
const OpenTelemetry.Resources.Resource.ServiceInstanceIdKey = "service.instance.id" -> string
const OpenTelemetry.Resources.Resource.ServiceNameKey = "service.name" -> string
const OpenTelemetry.Resources.Resource.ServiceNamespaceKey = "service.namespace" -> string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collecti
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
const OpenTelemetry.Resources.Resource.LibraryNameKey = "name" -> string
const OpenTelemetry.Resources.Resource.LibraryVersionKey = "version" -> string
const OpenTelemetry.Resources.Resource.ServiceInstanceIdKey = "service.instance.id" -> string
const OpenTelemetry.Resources.Resource.ServiceNameKey = "service.name" -> string
const OpenTelemetry.Resources.Resource.ServiceNamespaceKey = "service.namespace" -> string
Expand Down
2 changes: 0 additions & 2 deletions src/OpenTelemetry/Resources/Resource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public class Resource
public const string ServiceNamespaceKey = "service.namespace";
public const string ServiceInstanceIdKey = "service.instance.id";
public const string ServiceVersionKey = "service.version";
public const string LibraryNameKey = "name";
public const string LibraryVersionKey = "version";

// this implementation follows https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/sdk.md

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ public void JaegerTraceExporter_SetResource_CombinesTags()
}

[Fact]
public void JaegerTraceExporter_SetResource_IgnoreLibraryResources()
public void JaegerTraceExporter_SetResource_IgnoreServiceResources()
{
using var jaegerTraceExporter = new JaegerExporter(new JaegerExporterOptions());
var process = jaegerTraceExporter.Process;

jaegerTraceExporter.SetResource(new Resource(new Dictionary<string, object>
{
[Resource.LibraryNameKey] = "libname",
[Resource.LibraryVersionKey] = "libversion",
[Resource.ServiceNameKey] = "servicename",
[Resource.ServiceNamespaceKey] = "servicenamespace",
}));

Assert.Null(process.Tags);
Expand Down

0 comments on commit cb7f421

Please sign in to comment.