Skip to content

Add time_to_first_response_sec and first_human_admin_response_at - #88

Open
mariamameetcleo wants to merge 1 commit into
fivetran:mainfrom
mariamameetcleo:add-response-time-sec-and-human-admin-response
Open

mariamameetcleo wants to merge 1 commit into
fivetran:mainfrom
mariamameetcleo:add-response-time-sec-and-human-admin-response

Conversation

@mariamameetcleo

Copy link
Copy Markdown

Summary

Adds second-granularity first response time and an optional human-admin first response timestamp to the Intercom conversation metrics models.

  • time_to_first_response_sec on intercom__conversation_metrics — uses the same dbt.datediff source as time_to_first_response_minutes, without dividing by 60, so sub-minute responses are preserved.
  • first_human_admin_response_at on int_intercom__conversation_part_aggregates (passed through to intercom__conversation_metrics) — same admin-response filters as first_admin_response_at, with optional exclusion of automated admin author IDs via a new project variable.
  • time_to_first_response_minutes bug fix — cast the datediff result to numeric before dividing by 60 to avoid integer truncation on destinations where integer / integer truncates (e.g. sub-60-second responses becoming 0).

New variable

intercom__first_response_excluded_admin_author_ids: []

When empty (default), first_human_admin_response_at matches first_admin_response_at. When populated with Intercom admin author_id values (e.g. bot agents), those admins are excluded from the human first-response timestamp.

Motivation

Consumers need seconds-based response SLAs without losing precision for fast replies. Teams using automated admin agents also need a human-only first response timestamp without forking the package.

Test plan

  • dbt run --select int_intercom__conversation_part_aggregates intercom__conversation_metrics against integration tests
  • Verify time_to_first_response_sec > 0 when time_to_first_response_minutes = 0 for sub-minute responses
  • Verify first_human_admin_response_at respects intercom__first_response_excluded_admin_author_ids

Made with Cursor

@fivetran-joemarkiewicz

Copy link
Copy Markdown
Contributor

@mariamameetcleo thanks for opening this PR! Could you also open an Issue (Feature Request) on this repo highlighting the proposed feature. This will help us understand the motivation and use case of this proposal as well as tracking and linking the issue to this PR. Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants