Skip to content

Commit

Permalink
remove unused internal helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
quartzmo committed Dec 6, 2024
1 parent f88afd3 commit b9ee06b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
34 changes: 0 additions & 34 deletions internal/trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,6 @@ const (
OpenTelemetryTracerName = "cloud.google.com/go"
)

// Deprecated: The default experimental tracing support for OpenCensus is
// now deprecated in the Google Cloud client libraries for Go.
//
// SetOpenTelemetryTracingEnabledField programmatically sets the value provided
// by GOOGLE_API_GO_EXPERIMENTAL_TELEMETRY_PLATFORM_TRACING for the purpose of
// unit testing. Do not invoke it directly. Intended for use only in unit tests.
// Restore original value after each test.
//
// The default experimental tracing support for OpenCensus is now deprecated in
// the Google Cloud client libraries for Go.
func SetOpenTelemetryTracingEnabledField(enabled bool) {
// no-op
}

// Deprecated: The default experimental tracing support for OpenCensus is now
// deprecated in the Google Cloud client libraries for Go.
//
// IsOpenCensusTracingEnabled returns true if the environment variable
// GOOGLE_API_GO_EXPERIMENTAL_TELEMETRY_PLATFORM_TRACING is set to the
// case-insensitive value "opencensus".
func IsOpenCensusTracingEnabled() bool {
return false
}

// Deprecated: The default experimental tracing support for OpenCensus is now
// deprecated in the Google Cloud client libraries for Go.
//
// IsOpenTelemetryTracingEnabled returns true if the environment variable
// GOOGLE_API_GO_EXPERIMENTAL_TELEMETRY_PLATFORM_TRACING is NOT set to the
// case-insensitive value "opencensus".
func IsOpenTelemetryTracingEnabled() bool {
return true
}

// StartSpan adds an OpenTelemetry span to the trace with the given name.
//
// The default experimental tracing support for OpenCensus is now deprecated in
Expand Down
10 changes: 0 additions & 10 deletions internal/trace/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ var (
ignoreValueFields = cmpopts.IgnoreFields(attribute.Value{}, "vtype", "numeric", "stringly", "slice")
)

func TestDeprecatedFunctions(t *testing.T) {
SetOpenTelemetryTracingEnabledField(true) // no-op
if IsOpenCensusTracingEnabled() {
t.Errorf("got true, want false")
}
if !IsOpenTelemetryTracingEnabled() {
t.Errorf("got false, want true")
}
}

func TestStartSpan(t *testing.T) {
ctx := context.Background()
te := testutil.NewOpenTelemetryTestExporter()
Expand Down

0 comments on commit b9ee06b

Please sign in to comment.