Skip to content

Commit 37426c2

Browse files
adding logging format lint check
1 parent 48fc3bf commit 37426c2

File tree

3 files changed

+4
-3
lines changed
  • exporter
    • opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder
    • opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc

3 files changed

+4
-3
lines changed

exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ def _get_temporality(
117117
_logger.warning(
118118
"Unrecognized OTEL_EXPORTER_METRICS_TEMPORALITY_PREFERENCE"
119119
" value found: "
120-
f"{otel_exporter_otlp_metrics_temporality_preference}, "
121-
"using CUMULATIVE"
120+
"%s, "
121+
"using CUMULATIVE", otel_exporter_otlp_metrics_temporality_preference
122122
)
123123
instrument_class_temporality = {
124124
Counter: AggregationTemporality.CUMULATIVE,

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _read_file(file_path: str) -> Optional[bytes]:
125125
return file.read()
126126
except FileNotFoundError as e:
127127
logger.exception(
128-
f"Failed to read file: {e.filename}. Please check if the file exists and is accessible."
128+
"Failed to read file: %s. Please check if the file exists and is accessible.", e.filename
129129
)
130130
return None
131131

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ select = [
7777
"PLC", # pylint convention
7878
"PLE", # pylint error
7979
"Q", # flake8-quotes
80+
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
8081
]
8182

8283
ignore = [

0 commit comments

Comments
 (0)