-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(traces): configurable endpoint for the exporter (#1795)
* feat(traces): configurable endpoint for the exporter * rename env var * remove none
- Loading branch information
1 parent
2db0c2a
commit 8515763
Showing
3 changed files
with
36 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import pytest | ||
from phoenix.trace.exporter import HttpExporter | ||
|
||
|
||
def test_exporter(monkeypatch: pytest.MonkeyPatch): | ||
# Test that it defaults to local | ||
exporter = HttpExporter() | ||
assert exporter._base_url == "http://127.0.0.1:6006" | ||
|
||
# Test that you can configure an endpoint | ||
exporter = HttpExporter(endpoint="https://my-phoenix-server.com/") | ||
assert exporter._base_url == "https://my-phoenix-server.com" | ||
|
||
# Test that it supports environment variables | ||
monkeypatch.setenv("PHOENIX_COLLECTOR_ENDPOINT", "https://my-phoenix-server.com/") | ||
exporter = HttpExporter() | ||
assert exporter._base_url == "https://my-phoenix-server.com" |