Skip to content

Commit

Permalink
log out HoneycombOptions if debug is set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
pkanal committed Sep 27, 2022
1 parent b075f6e commit b745799
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions smoke-tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
version: '3.0'

x-env-base: &env_base
HONEYCOMB_API_ENDPOINT: http://collector:4317
HONEYCOMB_API_KEY: bogus_key
HONEYCOMB_DATASET: bogus_dataset
HONEYCOMB_METRICS_DATASET: bogus_dataset
OTEL_METRIC_EXPORT_INTERVAL: 1000
OTEL_SERVICE_NAME: "aspnetcore-example"
DEBUG: "true"

x-app-base: &app_base
build:
Expand Down Expand Up @@ -37,7 +38,6 @@ services:
<<: *env_base
HONEYCOMB_API_ENDPOINT: http://collector:4318
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
DEBUG: "true"
ports:
- "127.0.0.1:5001:5001"

Expand Down
2 changes: 0 additions & 2 deletions src/Honeycomb.OpenTelemetry/EnvironmentOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ internal class EnvironmentOptions
private const string MetricsEndpointKey = "HONEYCOMB_METRICS_ENDPOINT";
private const string SampleRateKey = "HONEYCOMB_SAMPLE_RATE";
private const string ServiceNameKey = "OTEL_SERVICE_NAME";

private const string ServiceVersionKey = "SERVICE_VERSION";
private const string EnableLocalVisualizationsKey = "ENABLE_LOCAL_VISUALIZATIONS";
private const string DebugKey = "DEBUG";
private const string OtelExporterOtlpProtocolKey = "OTEL_EXPORTER_OTLP_PROTOCOL";
private const uint DefaultSampleRate = 1;
private const string DefaultApiEndpoint = "https://api.honeycomb.io:443";

private readonly IDictionary _environmentService;

internal EnvironmentOptions() => new EnvironmentOptions(new Dictionary<string, string>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using System;
using System.Text.Json;

#if NET462
using System.Collections.Generic;
Expand Down Expand Up @@ -106,6 +107,8 @@ public static TracerProviderBuilder AddHoneycomb(this TracerProviderBuilder buil
{
builder.AddConsoleExporter();
// TODO: add debug with JSON serializer for options
Console.WriteLine("DEBUG: HoneycombOptions");
Console.WriteLine(JsonSerializer.Serialize(options, new JsonSerializerOptions { WriteIndented = true }));
}

// heads up: even if dataset is set, it will be ignored
Expand Down

0 comments on commit b745799

Please sign in to comment.