-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GlobalOpenTelemetry usage (#33678)
* Fix sample * Add copyright * Fix banned dependencies * Fix banned dependencies * Upgrade to 1.23 across all libraries * Fix nullpointerexception * Wait longer * Remove debug code for enabling fiddler * Remove since it will get overwritten by the script * Address comments
- Loading branch information
Showing
12 changed files
with
209 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...telemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/NoopTracer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.monitor.opentelemetry.exporter; | ||
|
||
import com.azure.core.util.Context; | ||
import com.azure.core.util.tracing.Tracer; | ||
|
||
import java.util.Objects; | ||
|
||
class NoopTracer implements Tracer { | ||
|
||
static final AutoCloseable NOOP_CLOSEABLE = () -> { | ||
}; | ||
|
||
static final Tracer INSTANCE = new NoopTracer(); | ||
|
||
NoopTracer() { | ||
} | ||
|
||
@Override | ||
public Context start(String spanName, Context context) { | ||
Objects.requireNonNull(spanName, "'spanName' cannot be null"); | ||
return context; | ||
} | ||
|
||
@Override | ||
public void end(String statusMessage, Throwable error, Context context) { | ||
} | ||
|
||
@Override | ||
public void setAttribute(String key, String value, Context context) { | ||
Objects.requireNonNull(key, "'key' cannot be null"); | ||
Objects.requireNonNull(value, "'value' cannot be null"); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public AutoCloseable makeSpanCurrent(Context context) { | ||
return NOOP_CLOSEABLE; | ||
} | ||
} |
Oops, something went wrong.