Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: remove extra metrics #58

Merged
merged 1 commit into from
Sep 3, 2022
Merged

perf: remove extra metrics #58

merged 1 commit into from
Sep 3, 2022

Conversation

brianluong
Copy link
Member

@brianluong brianluong commented Sep 2, 2022

Description

  • Removing the URL label as I think it's unnecessary. upstream_id is descriptive enough
  • Remove the total metrics - we can use duration.count instead
  • Rename the label endpoint_id to upstream_id for consistency

Type of change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 😎 New feature (non-breaking change which adds functionality)
  • ⁉️ Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ⚒️ Refactor (no functional changes)
  • 📖 Documentation (updating or adding docs)

How Has This Been Tested?

Ran it and seeing metrics in data dog

Copy link
Member

@dianwen dianwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any downside to keeping the URL? It might be useful if we're replacing a node but want to keep the same ID. No strong opinions.

Are there any concerns with using count on the duration metric? A theoretical concern: datadog or the client could sample data points for distribution-type metrics under the hood. Although it's a bit redundant, it might be more readable / clear to have separate metrics for count and duration. I'm not concerned about the minor redundancy.

@brianluong
Copy link
Member Author

Is there any downside to keeping the URL? It might be useful if we're replacing a node but want to keep the same ID. No strong opinions.

Are there any concerns with using count on the duration metric? A theoretical concern: datadog or the client could sample data points for distribution-type metrics under the hood. Although it's a bit redundant, it might be more readable / clear to have separate metrics for count and duration. I'm not concerned about the minor redundancy.

The motivation behind this was costs. About the replacements - that shouldn't be a very common event. I was warned by @kevin-satsuma that DD custom metrics are expensive.

On the sampling - I haven't seen any docs that indicate sampling happens. I graphed a few duration.count and requests.count and they were the same. I can move it add it back now and remove it if we need to cut costs later.

@dianwen
Copy link
Member

dianwen commented Sep 2, 2022

Gotcha. I think they charge by existence of combination of tags, so if we have a 1:1 mapping of URL to ID, then it's the same cardinality / cost as having only ID.

Copy link
Member

@dianwen dianwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion on the URL. Up to you!

@brianluong
Copy link
Member Author

Oh good point on the unique combinations https://docs.datadoghq.com/account_management/billing/custom_metrics/?tab=countrate

A custom metric is uniquely identified by a combination of a metric name and tag values (including the host tag).

@brianluong brianluong force-pushed the perf_metrics branch 2 times, most recently from 9e9abbe to e0ee1f7 Compare September 3, 2022 00:07
* feat: metrics on health checks
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