Skip to content

Commit

Permalink
Metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
sethsamuel committed Oct 3, 2024
1 parent 52fd49c commit 0a2fbf0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions postgres/datadog_checks/postgres/statement_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,13 @@ def _collect_statement_samples(self):
tags=self.tags,
raw=True,
)
datadog_agent.emit_agent_telemetry(
"postgres",
"collect_activity_snapshot_ms",
(time.time() - start_time) * 1000,
"histogram",
)

elapsed_ms = (time.time() - start_time) * 1000
self._check.histogram(
"dd.postgres.collect_statement_samples.time",
Expand Down Expand Up @@ -517,6 +524,18 @@ def _collect_statement_samples(self):
hostname=self._check.resolved_hostname,
raw=True,
)
datadog_agent.emit_agent_telemetry(
"postgres",
"collect_statement_samples_ms",
elapsed_ms,
"histogram",
)
datadog_agent.emit_agent_telemetry(
"postgres",
"collect_statement_samples_count",
submitted_count,
"gauge",
)

@staticmethod
def _to_active_session(row, track_activity_query_size):
Expand Down

0 comments on commit 0a2fbf0

Please sign in to comment.