Skip to content

Commit ec5df10

Browse files
committed
feat: Log runtime env info in agent/host.py
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
1 parent 95cf37f commit ec5df10

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/instana/agent/host.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
import os
1111
from datetime import datetime
1212
from typing import Any, Dict, List, Optional, Union
13-
from requests import Response
1413

1514
import requests
1615
import urllib3
16+
from requests import Response
1717

1818
from instana.agent.base import BaseAgent
1919
from instana.collector.host import HostCollector
2020
from instana.fsm import Discovery, TheMachine
2121
from instana.log import logger
2222
from instana.options import StandardOptions
2323
from instana.util import to_json
24-
from instana.util.runtime import get_py_source
24+
from instana.util.runtime import get_py_source, log_runtime_env_info
2525
from instana.util.span_utils import get_operation_specifiers
2626
from instana.version import VERSION
2727

@@ -62,6 +62,7 @@ def __init__(self) -> None:
6262
logger.info(
6363
f"Stan is on the scene. Starting Instana instrumentation version: {VERSION}"
6464
)
65+
log_runtime_env_info()
6566

6667
self.collector = HostCollector(self)
6768
self.machine = TheMachine(self)

src/instana/util/runtime.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,15 @@ def get_runtime_env_info() -> Tuple[str, str]:
198198

199199
return machine, python_version
200200

201+
202+
def log_runtime_env_info() -> None:
203+
"""
204+
Logs debug information about the current runtime environment.
205+
206+
This function retrieves machine architecture and Python version information
207+
using get_runtime_env_info() and logs it as a debug message.
208+
"""
209+
machine, python_version = get_runtime_env_info()
210+
logger.debug(f"Runtime environment: Machine: {machine}, Python version: {python_version}")
211+
201212
# Made with Bob

0 commit comments

Comments
 (0)