Change gauges to not track guild info
This commit is contained in:
parent
f2ef1e77c8
commit
7876ba0051
3 changed files with 4 additions and 8 deletions
|
@ -6,7 +6,7 @@ tasks_info = Info("jarvis_tasks", "JARVIS Task info")
|
||||||
reddit_gauge = Gauge(
|
reddit_gauge = Gauge(
|
||||||
"jarvis_tasks_reddit_follows",
|
"jarvis_tasks_reddit_follows",
|
||||||
"JARVIS Reddit follows",
|
"JARVIS Reddit follows",
|
||||||
labelnames=["guild_id", "guild_name", "subreddit_name"],
|
labelnames=["subreddit_name"],
|
||||||
)
|
)
|
||||||
reddit_count = Counter(
|
reddit_count = Counter(
|
||||||
"jarvis_tasks_reddit_count",
|
"jarvis_tasks_reddit_count",
|
||||||
|
@ -17,7 +17,7 @@ reddit_count = Counter(
|
||||||
twitter_gauge = Gauge(
|
twitter_gauge = Gauge(
|
||||||
"jarvis_tasks_twitter_follows",
|
"jarvis_tasks_twitter_follows",
|
||||||
"JARVIS twitter follows",
|
"JARVIS twitter follows",
|
||||||
labelnames=["guild_id", "guild_name", "twitter_handle"],
|
labelnames=["twitter_handle"],
|
||||||
)
|
)
|
||||||
twitter_count = Counter(
|
twitter_count = Counter(
|
||||||
"jarvis_tasks_twitter_count",
|
"jarvis_tasks_twitter_count",
|
||||||
|
|
|
@ -166,9 +166,7 @@ async def _stream(sub: Sub, bot: Client, reddit: Reddit) -> None:
|
||||||
f"Failed to send message to {channel.id} in {channel.guild.name}", exc_info=True
|
f"Failed to send message to {channel.id} in {channel.guild.name}", exc_info=True
|
||||||
)
|
)
|
||||||
|
|
||||||
gauge = reddit_gauge.labels(
|
gauge = reddit_gauge.labels(subreddit_name=sub.display_name)
|
||||||
guild_id=guild.id, guild_name=guild.name, subreddit_name=sub.display_name
|
|
||||||
)
|
|
||||||
gauge.set(num_follows)
|
gauge.set(num_follows)
|
||||||
|
|
||||||
if num_follows == 0:
|
if num_follows == 0:
|
||||||
|
|
|
@ -149,9 +149,7 @@ class JARVISTwitterStream(AsyncStream):
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.debug(f"Failed to send message to {channel.id} in {channel.guild.name}")
|
logger.debug(f"Failed to send message to {channel.id} in {channel.guild.name}")
|
||||||
|
|
||||||
gauge = twitter_gauge.labels(
|
gauge = twitter_gauge.labels(twitter_handle=status.user.screen_name)
|
||||||
guild_id=guild.id, guild_name=guild.name, twitter_handle=status.user.screen_name
|
|
||||||
)
|
|
||||||
gauge.set(num_follows)
|
gauge.set(num_follows)
|
||||||
|
|
||||||
if num_follows == 0:
|
if num_follows == 0:
|
||||||
|
|
Loading…
Add table
Reference in a new issue