Skip to content

Commit

Permalink
Use PID tag in all metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Aug 6, 2024
1 parent 4b166ac commit 93a87a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions singer_sdk/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def __init__(self, metric: Metric, tags: dict | None = None) -> None:
"""
self.metric = metric
self.tags = tags or {}
self.tags[Tag.PID] = os.getpid()
self.logger = get_metrics_logger()

@property
Expand Down
10 changes: 1 addition & 9 deletions singer_sdk/sinks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import copy
import datetime
import importlib.util
import os
import time
import typing as t
from functools import cached_property
Expand Down Expand Up @@ -190,14 +189,7 @@ def __init__(
)

self._validator: BaseJSONSchemaValidator | None = self.get_validator()
self._record_counter: metrics.Counter = metrics.Counter(
metrics.Metric.RECORD_COUNT,
{
metrics.Tag.STREAM: stream_name,
metrics.Tag.PID: os.getpid(),
},
log_interval=metrics.DEFAULT_LOG_INTERVAL,
)
self._record_counter: metrics.Counter = metrics.record_counter(stream_name)

@property
def record_counter_metric(self) -> metrics.Counter:
Expand Down

0 comments on commit 93a87a0

Please sign in to comment.