Add ProjectDB operations to datadog - #38130
Conversation
518c17d to
7f4eeff
Compare
Tagged by endpoint ID, so a slow endpoint can be identified without correlating against the domain's other projectDB traffic.
7f4eeff to
1677d41
Compare
| for case_type, case_type_cases in cases_by_type.items(): | ||
| populate_case_type(domain, case_type, case_type_cases) | ||
| metric = 'commcare.project_db.populate.duration' | ||
| with metrics_histogram_timer(metric, timing_buckets=(.1, .5, 1, 2, 5), tags={'domain': domain}): |
There was a problem hiding this comment.
If we use (.1, .5, 1, 2, 5) in other places. Should there be a constant to standardize it?
There was a problem hiding this comment.
I dunno, depends on whether they should be connected. The timing buckets depend on the application - some things we expect to be fast, some things slower, and the bucketing should reflect that. Like, I'd expect queries to usually be fast, but certainly could be slow, while row insertions should definitely be fast. That said, when comparing two things apples to apples, it would be nice to have the same buckets for each.
Another thought is we could come up with a platform-wide idea of different categories of speed that apply to a range of things, like:
- Imperceptible
- Fast
- Medium (user is waiting, but some hesitation is acceptable)
- Slow (will require UI affordances)
- Long-running (imports, migrations, etc)
And then define benchmarks around each of those, bucketing as appropriate. It'd be nice to have a more concrete way to talk about and measure performance - I bet the product team would be interested.
| result = user_sql.run(query_params, max_rows=CASE_SEARCH_MAX_RESULTS) | ||
| with metrics_histogram_timer( | ||
| 'commcare.project_db.endpoint_query.duration', | ||
| timing_buckets=(.1, .5, 1, 2, 5, 10), |
Product Description
no user-facing changes
Technical Summary
Add a few metrics to datadog for key ProjectDB operations
Feature Flag
Safety Assurance
Safety story
Automated test coverage
QA Plan
Rollback instructions
Labels & Review