Erster Stand der Hintergrundprozesse, die auf der Synology unter /volume1/homes/wagner/SolarManager laufen: der Manager selbst, die Sammler je Geraet, die MQTT-Bruecke, der Wecker und - neu hinzugezogen - der AutoAction-Runner, der als Hintergrundprozess hierher gehoert und nicht ins Web-Verzeichnis. Zugangsdaten stehen nicht mehr im Quelltext, sondern in config.ini, die nicht mit eingecheckt wird. Vorlage ist config.ini.example, gelesen wird sie von konfig.py. Betroffen waren solarManager.py (Datenbank und Wattpilot), zeit.py, gatherWaterData.py, wecker.py und skoda_testdaten.py, das sich das Passwort bisher aus dem Quelltext eines anderen Moduls herausgesucht hat. Die Kia-Anbindung ist mit dem Fahrzeug entfallen: kiaTest.py, gatherCarData.py und hyundai_kia_connect_api sind nicht mehr dabei, ebenso gatherInverterData.py, auf das nur noch eine auskommentierte Zeile zeigte. Die mitgelieferten Bibliotheken bleiben im Repository - die NAS hat kein pip, sie muessen neben den Skripten liegen. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
57 lines
1.7 KiB
Python
57 lines
1.7 KiB
Python
"""Constants used by the opentelemetry instrumentation implementation."""
|
|
# mypy: disable-error-code="no-redef,assignment"
|
|
|
|
# pylint: disable=unused-import
|
|
OTEL_ENABLED = True
|
|
try:
|
|
# try to load otel from the system
|
|
from opentelemetry import trace # check api
|
|
from opentelemetry.sdk.trace import TracerProvider # check sdk
|
|
from opentelemetry.semconv.trace import SpanAttributes # check semconv
|
|
except ImportError:
|
|
# falling back to the bundled installation
|
|
try:
|
|
from mysql.opentelemetry import trace
|
|
from mysql.opentelemetry.sdk.trace import TracerProvider
|
|
from mysql.opentelemetry.semconv.trace import SpanAttributes
|
|
except ImportError:
|
|
# bundled installation has missing dependencies
|
|
OTEL_ENABLED = False
|
|
|
|
|
|
OPTION_CNX_SPAN = "_span"
|
|
"""
|
|
Connection option name used to inject the connection span.
|
|
This connection option name must not be used, is reserved.
|
|
"""
|
|
|
|
OPTION_CNX_TRACER = "_tracer"
|
|
"""
|
|
Connection option name used to inject the opentelemetry tracer.
|
|
This connection option name must not be used, is reserved.
|
|
"""
|
|
|
|
CONNECTION_SPAN_NAME = "connection"
|
|
"""
|
|
Connection span name to be used by the instrumentor.
|
|
"""
|
|
|
|
FIRST_SUPPORTED_VERSION = "8.1.0"
|
|
"""
|
|
First mysql-connector-python version to support opentelemetry instrumentation.
|
|
"""
|
|
|
|
TRACEPARENT_HEADER_NAME = "traceparent"
|
|
|
|
DB_SYSTEM = "mysql"
|
|
DEFAULT_THREAD_NAME = "main"
|
|
DEFAULT_THREAD_ID = 0
|
|
|
|
# Reference: https://github.com/open-telemetry/opentelemetry-specification/blob/main/
|
|
# specification/trace/semantic_conventions/span-general.md
|
|
NET_SOCK_FAMILY = "net.sock.family"
|
|
NET_SOCK_PEER_ADDR = "net.sock.peer.addr"
|
|
NET_SOCK_PEER_PORT = "net.sock.peer.port"
|
|
NET_SOCK_HOST_ADDR = "net.sock.host.addr"
|
|
NET_SOCK_HOST_PORT = "net.sock.host.port"
|