Skip to content

Commit 5c9c7b4

Browse files
authored
fix: removes mentions to conhos (#36)
1 parent 71c1830 commit 5c9c7b4

11 files changed

Lines changed: 79 additions & 90 deletions

File tree

README.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ The Python SDK offers a clean, type-safe API following Python best practices whi
1010

1111
### Key Features
1212

13-
- 🤖 **AI Core Integration**
14-
- 📋 **Audit Log Service**
15-
- 🌐 **Destination Service**
16-
- 🗂️ **ObjectStore Service**
17-
- 🔐 **Secret Resolver**
18-
- 📊 **Telemetry & Observability**
13+
- **AI Core Integration**
14+
- **Audit Log Service**
15+
- **Destination Service**
16+
- **ObjectStore Service**
17+
- **Secret Resolver**
18+
- **Telemetry & Observability**
1919

2020
## Requirements and Setup
2121

@@ -43,16 +43,6 @@ The SDK automatically resolves configuration from multiple sources with the foll
4343
- For instance names, hyphens (`"-"`) are replaced with underscores (`"_"`) for compatibility with system environment variables.
4444
- You can see examples in our [env_integration_tests.example](.env_integration_tests.example)
4545

46-
### Telemetry Configuration
47-
48-
For production environments (SAP BTP Managed Runtime), no configuration is needed as `OTEL_EXPORTER_OTLP_ENDPOINT` is automatically injected.
49-
50-
For local development:
51-
52-
```bash
53-
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel-collector.example.com"
54-
```
55-
5646
### Usage Guides
5747

5848
Each module has comprehensive usage guides:

src/sap_cloud_sdk/core/secret_resolver/user-guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ print(f"Database: {config.username}@{config.host}:{config.port}")
5252
The Secret Resolver expects mounted secrets to follow this hierarchy:
5353

5454
```
55-
/etc/secrets/
55+
/etc/secrets/appfnd
5656
└── <module_name>/
5757
└── <instance_name>/
5858
├── host
@@ -63,7 +63,7 @@ The Secret Resolver expects mounted secrets to follow this hierarchy:
6363

6464
Example for the above configuration:
6565
```
66-
/etc/secrets/
66+
/etc/secrets/appfnd
6767
└── database/
6868
└── primary/
6969
├── host # Contains: "db.example.com"
@@ -122,7 +122,7 @@ read_from_mount_and_fallback_to_env_var(
122122

123123
**Mounted secrets structure:**
124124
```
125-
/etc/secrets/
125+
/etc/secrets/appfnd
126126
└── objectstore/
127127
└── credentials/
128128
├── access_key_id

src/sap_cloud_sdk/core/telemetry/auto_instrument.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from sap_cloud_sdk.core.telemetry import Module, Operation
88
from sap_cloud_sdk.core.telemetry.config import (
99
create_resource_attributes_from_env,
10-
_get_conhos_app_name,
10+
_get_app_name,
1111
)
1212
from sap_cloud_sdk.core.telemetry.genai_attribute_transformer import (
1313
GenAIAttributeTransformer,
@@ -44,7 +44,7 @@ def auto_instrument():
4444

4545
resource = create_resource_attributes_from_env()
4646
Traceloop.init(
47-
app_name=_get_conhos_app_name(),
47+
app_name=_get_app_name(),
4848
exporter=exporter,
4949
resource_attributes=resource,
5050
should_enrich_metrics=True,

src/sap_cloud_sdk/core/telemetry/config.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@
2222
DEFAULT_UNKNOWN = "unknown"
2323

2424
# Environment variable keys
25-
ENV_CONHOS_REGION = "APPFND_CONHOS_REGION"
26-
ENV_CONHOS_ENVIRONMENT = "APPFND_CONHOS_ENVIRONMENT"
27-
ENV_CONHOS_SUBACCOUNT_ID = "APPFND_CONHOS_SUBACCOUNTID"
28-
ENV_CONHOS_APP_NAME = "APPFND_CONHOS_APP_NAME"
25+
ENV_REGION = "APPFND_CONHOS_REGION"
26+
ENV_ENVIRONMENT = "APPFND_CONHOS_ENVIRONMENT"
27+
ENV_SUBACCOUNT_ID = "APPFND_CONHOS_SUBACCOUNTID"
28+
ENV_APP_NAME = "APPFND_CONHOS_APP_NAME"
2929
ENV_HOSTNAME = "HOSTNAME"
3030
ENV_SYSTEM_ROLE = "APPFND_CONHOS_SYSTEM_ROLE"
3131

3232

33-
def _get_conhos_region() -> str:
34-
"""Get ConHost region from environment or return default."""
35-
return os.getenv(ENV_CONHOS_REGION, DEFAULT_UNKNOWN)
33+
def _get_region() -> str:
34+
"""Get region from environment or return default."""
35+
return os.getenv(ENV_REGION, DEFAULT_UNKNOWN)
3636

3737

38-
def _get_conhos_environment() -> str:
39-
"""Get ConHost environment from environment or return default."""
40-
return os.getenv(ENV_CONHOS_ENVIRONMENT, DEFAULT_UNKNOWN)
38+
def _get_environment() -> str:
39+
"""Get environment from environment or return default."""
40+
return os.getenv(ENV_ENVIRONMENT, DEFAULT_UNKNOWN)
4141

4242

43-
def _get_conhos_subaccount_id() -> str:
44-
"""Get ConHost subaccount ID from environment or return default."""
45-
return os.getenv(ENV_CONHOS_SUBACCOUNT_ID, DEFAULT_UNKNOWN)
43+
def _get_subaccount_id() -> str:
44+
"""Get subaccount ID from environment or return default."""
45+
return os.getenv(ENV_SUBACCOUNT_ID, DEFAULT_UNKNOWN)
4646

4747

48-
def _get_conhos_app_name() -> str:
49-
"""Get ConHost application name from environment or return default."""
50-
return os.getenv(ENV_CONHOS_APP_NAME, DEFAULT_UNKNOWN)
48+
def _get_app_name() -> str:
49+
"""Get application name from environment or return default."""
50+
return os.getenv(ENV_APP_NAME, DEFAULT_UNKNOWN)
5151

5252

5353
def _get_hostname() -> str:
@@ -86,12 +86,12 @@ def create_resource_attributes_from_env() -> dict:
8686
"""
8787

8888
attributes = {
89-
SERVICE_NAME: _get_conhos_app_name(),
89+
SERVICE_NAME: _get_app_name(),
9090
ATTR_SERVICE_INSTANCE_ID: _get_hostname(),
91-
ATTR_SERVICE_NAME: _get_conhos_app_name(),
92-
ATTR_DEPLOYMENT_ENVIRONMENT: _get_conhos_environment(),
93-
ATTR_CLOUD_REGION: _get_conhos_region(),
94-
ATTR_SAP_SUBACCOUNT_ID: _get_conhos_subaccount_id(),
91+
ATTR_SERVICE_NAME: _get_app_name(),
92+
ATTR_DEPLOYMENT_ENVIRONMENT: _get_environment(),
93+
ATTR_CLOUD_REGION: _get_region(),
94+
ATTR_SAP_SUBACCOUNT_ID: _get_subaccount_id(),
9595
ATTR_SAP_SYSTEM_ROLE: _get_system_role(),
9696
ATTR_SAP_SDK_NAME: SDK_NAME,
9797
ATTR_SAP_SDK_LANGUAGE: "python",
@@ -145,7 +145,7 @@ def from_env(cls) -> "InstrumentationConfig":
145145

146146
return cls(
147147
enabled=enabled,
148-
service_name=_get_conhos_app_name(),
148+
service_name=_get_app_name(),
149149
otlp_endpoint=otlp_endpoint,
150150
)
151151

src/sap_cloud_sdk/core/telemetry/user-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ add_span_attribute("request.id", request_id)
133133

134134
## Configuration
135135

136-
### Production (SAP BTP Managed Runtime)
136+
### Production
137137

138-
No configuration needed. `OTEL_EXPORTER_OTLP_ENDPOINT` is automatically injected.
138+
For production environments, you should ensure that `OTEL_EXPORTER_OTLP_ENDPOINT` is configured and points to the expected OTLP endpoint. This variable is a standard environment variable from the OpenTelemetry libraries.
139139

140140
### Local Development
141141

src/sap_cloud_sdk/destination/user-guide.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,9 @@ The environment variable `APPFND_CONHOS_TRANSP_PROXY` should be set with the for
154154

155155
```bash
156156
export APPFND_CONHOS_TRANSP_PROXY="connectivity-proxy.my-namespace"
157-
export APPFND_CONHOS_TRANSP_PROXY="connectivity-proxy.my-namespace"
158157
```
159158

160-
This setting is automatically configured when running with container hosting (managed runtime).
159+
**This setting might be automatically configured depending on the runtime**
161160

162161
#### 2. Explicit Proxy Configuration
163162

src/sap_cloud_sdk/objectstore/user-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ This module automatically resolves credentials and configuration from the enviro
218218

219219
### Cloud Mode
220220

221-
- Reads secrets from mounted files or environment variables (via Application Foundation container hosting)
222-
- **Kubernetes-mounted secret** at `/etc/secrets/<module>/<instance>/`
223-
- Fallback to environment variables with pattern `<PREFIX>_<MODULE>_<INSTANCE>_<FIELD>`
221+
- Reads secrets from mounted files or environment variables
222+
- **Kubernetes-mounted secret** at `/etc/secrets/appfnd/<module>/<instance>/`
223+
- Fallback to environment variables with pattern `CLOUD_SDK_CFG_<MODULE>_<INSTANCE>_<FIELD>`
224224
- Uses the configured S3-compatible host (e.g., AWS S3, MinIO in cloud)
225225
- No manual setup required when deployed in Application Foundation
226226

@@ -237,7 +237,7 @@ export OBJECTSTORE_CREDENTIALS_HOST="s3.amazonaws.com"
237237
#### Mounted Secrets (Kubernetes)
238238

239239
```
240-
/etc/secrets/objectstore/credentials/
240+
/etc/secrets/appfnd/objectstore/credentials/
241241
├── access_key_id
242242
├── secret_access_key
243243
├── bucket

tests/core/integration/auditlog/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def auditlog_client():
1919
load_dotenv(env_file, override=True)
2020

2121
try:
22-
# Secret resolver handles configuration automatically from /etc/secrets/appfnd or APPFND_CFG
22+
# Secret resolver handles configuration automatically from /etc/secrets/appfnd or CLOUD_SDK_CFG
2323
client = create_client()
2424
return client
2525
except Exception as e:

tests/core/unit/telemetry/test_auto_instrument.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def mock_traceloop_components():
1616
'exporter': stack.enter_context(patch('sap_cloud_sdk.core.telemetry.auto_instrument.OTLPSpanExporter')),
1717
'transformer': stack.enter_context(patch('sap_cloud_sdk.core.telemetry.auto_instrument.GenAIAttributeTransformer')),
1818
'create_resource': stack.enter_context(patch('sap_cloud_sdk.core.telemetry.auto_instrument.create_resource_attributes_from_env')),
19-
'get_conhos_app_name': stack.enter_context(patch('sap_cloud_sdk.core.telemetry.auto_instrument._get_conhos_app_name')),
19+
'get_app_name': stack.enter_context(patch('sap_cloud_sdk.core.telemetry.auto_instrument._get_app_name')),
2020
}
2121
yield mocks
2222

@@ -37,7 +37,7 @@ def test_auto_instrument_without_endpoint(self):
3737

3838
def test_auto_instrument_with_endpoint_success(self, mock_traceloop_components):
3939
"""Test successful auto-instrumentation with valid endpoint."""
40-
mock_traceloop_components['get_conhos_app_name'].return_value = 'test-app'
40+
mock_traceloop_components['get_app_name'].return_value = 'test-app'
4141
mock_traceloop_components['create_resource'].return_value = {'service.name': 'test-app'}
4242

4343
with patch.dict('os.environ', {'OTEL_EXPORTER_OTLP_ENDPOINT': 'http://localhost:4317'}, clear=True):
@@ -52,7 +52,7 @@ def test_auto_instrument_with_endpoint_success(self, mock_traceloop_components):
5252

5353
def test_auto_instrument_appends_v1_traces_to_endpoint(self, mock_traceloop_components):
5454
"""Test that auto_instrument appends /v1/traces to endpoint if not present."""
55-
mock_traceloop_components['get_conhos_app_name'].return_value = 'test-app'
55+
mock_traceloop_components['get_app_name'].return_value = 'test-app'
5656
mock_traceloop_components['create_resource'].return_value = {}
5757

5858
with patch.dict('os.environ', {'OTEL_EXPORTER_OTLP_ENDPOINT': 'http://localhost:4317'}, clear=True):
@@ -65,7 +65,7 @@ def test_auto_instrument_appends_v1_traces_to_endpoint(self, mock_traceloop_comp
6565

6666
def test_auto_instrument_preserves_existing_v1_traces(self, mock_traceloop_components):
6767
"""Test that auto_instrument doesn't duplicate /v1/traces if already present."""
68-
mock_traceloop_components['get_conhos_app_name'].return_value = 'test-app'
68+
mock_traceloop_components['get_app_name'].return_value = 'test-app'
6969
mock_traceloop_components['create_resource'].return_value = {}
7070

7171
with patch.dict('os.environ', {'OTEL_EXPORTER_OTLP_ENDPOINT': 'http://localhost:4317/v1/traces'}, clear=True):
@@ -78,7 +78,7 @@ def test_auto_instrument_preserves_existing_v1_traces(self, mock_traceloop_compo
7878

7979
def test_auto_instrument_creates_resource_with_attributes(self, mock_traceloop_components):
8080
"""Test that auto_instrument creates resource with correct attributes."""
81-
mock_traceloop_components['get_conhos_app_name'].return_value = 'test-app'
81+
mock_traceloop_components['get_app_name'].return_value = 'test-app'
8282
mock_traceloop_components['create_resource'].return_value = {
8383
'service.name': 'test-app',
8484
'sap.telemetry.sdk.language': 'python'
@@ -99,7 +99,7 @@ def test_auto_instrument_creates_resource_with_attributes(self, mock_traceloop_c
9999

100100
def test_auto_instrument_logs_initialization(self, mock_traceloop_components):
101101
"""Test that auto_instrument logs initialization messages."""
102-
mock_traceloop_components['get_conhos_app_name'].return_value = 'test-app'
102+
mock_traceloop_components['get_app_name'].return_value = 'test-app'
103103
mock_traceloop_components['create_resource'].return_value = {}
104104

105105
with patch.dict('os.environ', {'OTEL_EXPORTER_OTLP_ENDPOINT': 'http://localhost:4317'}, clear=True):
@@ -114,7 +114,7 @@ def test_auto_instrument_logs_initialization(self, mock_traceloop_components):
114114

115115
def test_auto_instrument_with_trailing_slash(self, mock_traceloop_components):
116116
"""Test that auto_instrument handles endpoint with trailing slash."""
117-
mock_traceloop_components['get_conhos_app_name'].return_value = 'test-app'
117+
mock_traceloop_components['get_app_name'].return_value = 'test-app'
118118
mock_traceloop_components['create_resource'].return_value = {}
119119

120120
with patch.dict('os.environ', {'OTEL_EXPORTER_OTLP_ENDPOINT': 'http://localhost:4317/'}, clear=True):
@@ -127,7 +127,7 @@ def test_auto_instrument_with_trailing_slash(self, mock_traceloop_components):
127127

128128
def test_auto_instrument_passes_transformer_to_traceloop(self, mock_traceloop_components):
129129
"""Test that auto_instrument passes the GenAIAttributeTransformer as exporter to Traceloop."""
130-
mock_traceloop_components['get_conhos_app_name'].return_value = 'test-app'
130+
mock_traceloop_components['get_app_name'].return_value = 'test-app'
131131
mock_traceloop_components['create_resource'].return_value = {}
132132
mock_transformer_instance = MagicMock()
133133
mock_traceloop_components['transformer'].return_value = mock_transformer_instance
@@ -144,7 +144,7 @@ def test_auto_instrument_passes_transformer_to_traceloop(self, mock_traceloop_co
144144

145145
def test_auto_instrument_legacy_schema_parameter_ignored(self, mock_traceloop_components):
146146
"""Test that legacy_schema parameter is accepted but doesn't affect behavior."""
147-
mock_traceloop_components['get_conhos_app_name'].return_value = 'test-app'
147+
mock_traceloop_components['get_app_name'].return_value = 'test-app'
148148
mock_traceloop_components['create_resource'].return_value = {}
149149

150150
with patch.dict('os.environ', {'OTEL_EXPORTER_OTLP_ENDPOINT': 'http://localhost:4317'}, clear=True):

tests/core/unit/telemetry/test_telemetry.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from unittest.mock import patch, MagicMock
44

55
from sap_cloud_sdk.core.telemetry.config import (
6-
_get_conhos_region,
7-
_get_conhos_environment,
8-
_get_conhos_subaccount_id,
9-
_get_conhos_app_name,
6+
_get_region,
7+
_get_environment,
8+
_get_subaccount_id,
9+
_get_app_name,
1010
_get_hostname,
1111
DEFAULT_UNKNOWN,
1212
)
@@ -35,45 +35,45 @@
3535
class TestEnvironmentHelpers:
3636
"""Test suite for environment variable helper functions."""
3737

38-
def test_get_conhos_region_with_value(self):
39-
"""Test getting ConHost region from environment."""
38+
def test_get_region_with_value(self):
39+
"""Test getting region from environment."""
4040
with patch.dict('os.environ', {'APPFND_CONHOS_REGION': 'eu10'}, clear=True):
41-
assert _get_conhos_region() == 'eu10'
41+
assert _get_region() == 'eu10'
4242

43-
def test_get_conhos_region_default(self):
44-
"""Test getting ConHost region default when not set."""
43+
def test_get_region_default(self):
44+
"""Test getting region default when not set."""
4545
with patch.dict('os.environ', {}, clear=True):
46-
assert _get_conhos_region() == DEFAULT_UNKNOWN
46+
assert _get_region() == DEFAULT_UNKNOWN
4747

48-
def test_get_conhos_environment_with_value(self):
49-
"""Test getting ConHost environment from environment."""
48+
def test_get_environment_with_value(self):
49+
"""Test getting environment from environment."""
5050
with patch.dict('os.environ', {'APPFND_CONHOS_ENVIRONMENT': 'prod'}, clear=True):
51-
assert _get_conhos_environment() == 'prod'
51+
assert _get_environment() == 'prod'
5252

53-
def test_get_conhos_environment_default(self):
54-
"""Test getting ConHost environment default when not set."""
53+
def test_get_environment_default(self):
54+
"""Test getting environment default when not set."""
5555
with patch.dict('os.environ', {}, clear=True):
56-
assert _get_conhos_environment() == DEFAULT_UNKNOWN
56+
assert _get_environment() == DEFAULT_UNKNOWN
5757

58-
def test_get_conhos_subaccount_id_with_value(self):
59-
"""Test getting ConHost subaccount ID from environment."""
58+
def test_get_subaccount_id_with_value(self):
59+
"""Test getting subaccount ID from environment."""
6060
with patch.dict('os.environ', {'APPFND_CONHOS_SUBACCOUNTID': 'sub-123'}, clear=True):
61-
assert _get_conhos_subaccount_id() == 'sub-123'
61+
assert _get_subaccount_id() == 'sub-123'
6262

63-
def test_get_conhos_subaccount_id_default(self):
64-
"""Test getting ConHost subaccount ID default when not set."""
63+
def test_get_subaccount_id_default(self):
64+
"""Test getting subaccount ID default when not set."""
6565
with patch.dict('os.environ', {}, clear=True):
66-
assert _get_conhos_subaccount_id() == DEFAULT_UNKNOWN
66+
assert _get_subaccount_id() == DEFAULT_UNKNOWN
6767

68-
def test_get_conhos_app_name_with_value(self):
69-
"""Test getting ConHost app name from environment."""
68+
def test_get_app_name_with_value(self):
69+
"""Test getting app name from environment."""
7070
with patch.dict('os.environ', {'APPFND_CONHOS_APP_NAME': 'my-app'}, clear=True):
71-
assert _get_conhos_app_name() == 'my-app'
71+
assert _get_app_name() == 'my-app'
7272

73-
def test_get_conhos_app_name_default(self):
74-
"""Test getting ConHost app name default when not set."""
73+
def test_get_app_name_default(self):
74+
"""Test getting app name default when not set."""
7575
with patch.dict('os.environ', {}, clear=True):
76-
assert _get_conhos_app_name() == DEFAULT_UNKNOWN
76+
assert _get_app_name() == DEFAULT_UNKNOWN
7777

7878
def test_get_hostname_with_value(self):
7979
"""Test getting hostname from environment."""

0 commit comments

Comments
 (0)