Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

feat: add more metrics #130

Merged
merged 11 commits into from
Jun 7, 2021
Merged

feat: add more metrics #130

merged 11 commits into from
Jun 7, 2021

Conversation

jrconlin
Copy link
Member

@jrconlin jrconlin commented Jun 3, 2021

Adds richer set of metrics and metric handling

Closes #120

Description

Added more metric information for contile including:

  • unknown locations
  • adm tile issues

Testing

Testing should result in increase of various metrics.

Issue(s)

Closes #120

┆Issue is synchronized with this Jira Bug

Adds richer set of metrics and metric handling

Closes #120
@jrconlin jrconlin requested a review from a team June 3, 2021 22:41
Copy link
Member

@pjenvey pjenvey left a comment

Choose a reason for hiding this comment

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

My other thought is we might want to prefix most of these metric names with "adm." -- it's always possible we plug in different partners later. Or does a tag make more sense?

I regret we missed prefixing the CONTILE_{PARTNER_ID,SUB1} settings

} else {
metrics.incr_with_tags(
"location.unknown.city",
Some(&Tags::from_extra(vec![("ip", ip_addr.to_string())])),
Copy link
Member

Choose a reason for hiding this comment

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

extras are only sent to sentry, so all these one offs in this module are unnecessary for metrics calls (I guess that applies to the new from_extra method too)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I debated adding these as proper tags, but I figured we'd hit cardinality issues pretty fast. I'll remove the tag from this for now.

As for keeping the from::extra, I can see that potentially being useful in the future.

jrconlin added 2 commits June 4, 2021 10:52
* Add stupid GC function for tiles cache.

Issue: #71, #68, #35
@jrconlin jrconlin requested a review from pjenvey June 4, 2021 17:58
key,
Tiles {
json: tiles,
ttl: SystemTime::now() + Duration::from_secs(settings.tiles_ttl as u64),
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm debating if we should make this TTL * 2, to cover potential issues with ADM returning nothing, or an error. To be fair, we should probably also exit if adM returns anything other than a 200, and assume that they're having problems.

Copy link
Member

Choose a reason for hiding this comment

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

Initially I leaned towards hiding things from the client like this but #92 suggests the client wants more feedback from the other end.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, if a background refresh fails, how should we notify the client?

@@ -238,16 +244,19 @@ impl AdmFilter {
};
if let Err(e) = self.check_advertiser(adv_filter, &mut tile, tags) {
dbg!("bad adv");
metrics.incr_with_tags("tag.err.invalid_advertiser", Some(tags));
Copy link
Member

Choose a reason for hiding this comment

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

what does "tag" in this name mean?

Also related, dunno if you saw this comment: #130 (review)

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, I think that was the product of a bad replace.
I'll correct the names (and I'll also add adm)

key,
Tiles {
json: tiles,
ttl: SystemTime::now() + Duration::from_secs(settings.tiles_ttl as u64),
Copy link
Member

Choose a reason for hiding this comment

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

Initially I leaned towards hiding things from the client like this but #92 suggests the client wants more feedback from the other end.

jrconlin added 2 commits June 7, 2021 08:16
correct `adm` filter metric labels
@jrconlin jrconlin requested a review from pjenvey June 7, 2021 16:18
@data-sync-user data-sync-user mentioned this pull request Jun 7, 2021
src/server/location.rs Show resolved Hide resolved
src/server/cache.rs Outdated Show resolved Hide resolved
@jrconlin jrconlin merged commit 786fe72 into main Jun 7, 2021
@jrconlin jrconlin deleted the feat/120-metrics branch June 7, 2021 23:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit a metric for location lookup failing
2 participants