Skip to content

Commit

Permalink
Merge pull request #116 from johnseekins/bucket-fix
Browse files Browse the repository at this point in the history
InfluxDB bucket fix
  • Loading branch information
johnseekins authored Sep 6, 2023
2 parents 3055632 + a6d4535 commit 7079773
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion openstates/utils/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self) -> None:
self._batch: List[Dict] = list()
self.prefix: str = os.environ.get("STATS_PREFIX", "openstates_")
self.endpoint: str = os.environ.get("STATS_ENDPOINT", "")
self.bucket: str = os.environ.get("STATS_BUCKET", "openstates")
if self.endpoint.endswith("/"):
self.endpoint = self.endpoint.strip("/")
client = InfluxDBClient(
Expand Down Expand Up @@ -88,7 +89,7 @@ def _send_stats(self, force: bool = False) -> None:
points.append(p)
self.logger.debug(f"Sending stats batch: {self._batch}")
try:
self.write_api.write("", record=points)
self.write_api.write(self.bucket, record=points)
self._batch = list()
except Exception as e:
self.logger.warning(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openstates"
version = "6.17.6"
version = "6.17.7"
description = "core infrastructure for the openstates project"
authors = ["James Turk <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 7079773

Please sign in to comment.