mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-25 19:15:18 +02:00
feat(env): add SURFSENSE_ENV variable for deployment environment and update observability resource attributes
This commit is contained in:
parent
df698e0216
commit
4c8d47617d
4 changed files with 26 additions and 9 deletions
|
|
@ -114,8 +114,20 @@ class TestBootstrapConfig:
|
|||
attrs = dict(resource.attributes)
|
||||
assert attrs["service.name"] == "custom-backend"
|
||||
assert attrs["deployment.environment.name"] == "test"
|
||||
assert attrs["deployment.environment"] == "test"
|
||||
assert attrs["service.instance.id"]
|
||||
|
||||
def test_deployment_environment_uses_surfsense_env_only(
|
||||
self, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
monkeypatch.delenv("SURFSENSE_ENV", raising=False)
|
||||
|
||||
assert bootstrap._deployment_environment() == "dev"
|
||||
|
||||
monkeypatch.setenv("SURFSENSE_ENV", "production")
|
||||
|
||||
assert bootstrap._deployment_environment() == "production"
|
||||
|
||||
def test_shutdown_is_safe_without_providers(self) -> None:
|
||||
bootstrap.shutdown_otel()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue