azpaddypy 0.5.8__py3-none-any.whl → 0.5.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- azpaddypy/mgmt/logging.py +9 -3
- {azpaddypy-0.5.8.dist-info → azpaddypy-0.5.9.dist-info}/METADATA +1 -1
- {azpaddypy-0.5.8.dist-info → azpaddypy-0.5.9.dist-info}/RECORD +6 -6
- {azpaddypy-0.5.8.dist-info → azpaddypy-0.5.9.dist-info}/WHEEL +0 -0
- {azpaddypy-0.5.8.dist-info → azpaddypy-0.5.9.dist-info}/licenses/LICENSE +0 -0
- {azpaddypy-0.5.8.dist-info → azpaddypy-0.5.9.dist-info}/top_level.txt +0 -0
azpaddypy/mgmt/logging.py
CHANGED
@@ -11,6 +11,7 @@ from opentelemetry import trace
|
|
11
11
|
from opentelemetry.trace import Status, StatusCode, Span
|
12
12
|
from opentelemetry import baggage
|
13
13
|
from opentelemetry.context import Context
|
14
|
+
from opentelemetry.sdk.resources import Resource
|
14
15
|
|
15
16
|
|
16
17
|
class AzureLogger:
|
@@ -81,8 +82,9 @@ class AzureLogger:
|
|
81
82
|
effective_cloud_role_name = cloud_role_name or service_name
|
82
83
|
self.cloud_role_name = effective_cloud_role_name
|
83
84
|
|
84
|
-
# Configure resource attributes
|
85
|
-
# NOTE:
|
85
|
+
# Configure resource attributes according to Azure Monitor OpenTelemetry best practices
|
86
|
+
# NOTE: Azure Monitor cloud role name uses service.namespace + service.name,
|
87
|
+
# or falls back to service.name if service.namespace isn't set
|
86
88
|
resource_attributes = {
|
87
89
|
"service.name": effective_cloud_role_name,
|
88
90
|
"service.version": service_version,
|
@@ -94,9 +96,13 @@ class AzureLogger:
|
|
94
96
|
# Configure Azure Monitor if connection string available
|
95
97
|
if self.connection_string:
|
96
98
|
try:
|
99
|
+
# Create a Resource with the attributes to ensure they're properly applied
|
100
|
+
# This ensures Azure Monitor correctly maps service.name to cloud role name
|
101
|
+
resource = Resource.create(resource_attributes)
|
102
|
+
|
97
103
|
configure_azure_monitor(
|
98
104
|
connection_string=self.connection_string,
|
99
|
-
|
105
|
+
resource=resource,
|
100
106
|
enable_live_metrics=True,
|
101
107
|
instrumentation_options=instrumentation_options,
|
102
108
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: azpaddypy
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.9
|
4
4
|
Summary: Comprehensive Python logger for Azure, integrating OpenTelemetry for advanced, structured, and distributed tracing.
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
6
6
|
Classifier: Operating System :: OS Independent
|
@@ -2,11 +2,11 @@ azpaddypy/__init__.py,sha256=hrWNAh4OHZOvm3Pbhq5eUjO-pSRYn0h0W0J87tc-lNI,45
|
|
2
2
|
azpaddypy/mgmt/__init__.py,sha256=waW9EAnTFDh2530ieQX1Z0r0Z-ZKHRwabVDfapjfN58,441
|
3
3
|
azpaddypy/mgmt/identity.py,sha256=mA_krQslMsK_sDob-z-QA0B9khK_JUO2way7xwPopR8,12001
|
4
4
|
azpaddypy/mgmt/local_env_manager.py,sha256=WHXJXHQFGwkgr96YkEtqpgFUxmCjBa5pArbNxZUSKQk,7762
|
5
|
-
azpaddypy/mgmt/logging.py,sha256=
|
5
|
+
azpaddypy/mgmt/logging.py,sha256=iuoYxwliBFmHKEZh30FYlGBFwlhic_yFmOi18gFjTEE,36962
|
6
6
|
azpaddypy/resources/__init__.py,sha256=Bvt3VK4RqwoxYpoh6EbLXIR18RuFPKaLP6zLL-icyFk,314
|
7
7
|
azpaddypy/resources/keyvault.py,sha256=4J08vLqoLFd1_UUDBji2oG2fatZaPkgnRyT_Z6wHAOc,20312
|
8
|
-
azpaddypy-0.5.
|
9
|
-
azpaddypy-0.5.
|
10
|
-
azpaddypy-0.5.
|
11
|
-
azpaddypy-0.5.
|
12
|
-
azpaddypy-0.5.
|
8
|
+
azpaddypy-0.5.9.dist-info/licenses/LICENSE,sha256=hQ6t0g2QaewGCQICHqTckBFbMVakGmoyTAzDpmEYV4c,1089
|
9
|
+
azpaddypy-0.5.9.dist-info/METADATA,sha256=5PkaGLqbgBlFbaVjAt6hokzh1n6FtyGjnXhF5bsfx-I,665
|
10
|
+
azpaddypy-0.5.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
11
|
+
azpaddypy-0.5.9.dist-info/top_level.txt,sha256=hsDuboDhT61320ML8X479ezSTwT3rrlDWz1_Z45B2cs,10
|
12
|
+
azpaddypy-0.5.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|