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

feat: Add local server hostname to tags #234

Merged
merged 14 commits into from
Oct 7, 2021
Merged

feat: Add local server hostname to tags #234

merged 14 commits into from
Oct 7, 2021

Conversation

jrconlin
Copy link
Member

@jrconlin jrconlin commented Aug 3, 2021

Description

Adds the local server hostname to the metric and logging tags.

Testing

Unit test modified to include check for presence.

Issue(s)

Closes #200

@jrconlin jrconlin requested a review from a team August 3, 2021 14:56
pjenvey
pjenvey previously requested changes Aug 3, 2021
src/tags.rs Outdated Show resolved Hide resolved
@jbuck
Copy link
Collaborator

jbuck commented Aug 3, 2021

I am concerned this tag will be too high granularity - every single k8s pod will have a different hostname. What are you trying to measure by adding the hostname?

@jrconlin
Copy link
Member Author

jrconlin commented Aug 3, 2021

per the source issue:
So we can group some metrics by the k8s pod let's include the hostname in metrics as a tag.

We can probably skip adding this tag to anything other than metric reporting, but we'll probably still hit granularity issues.

@jrconlin
Copy link
Member Author

jrconlin commented Aug 4, 2021

Ok, refactored a bit.
I added a metric section to Tags that includes tags that only go to metrics (they're mixed in right before sending them out via cadence). That should prevent the tag from going out to Sentry by accident, as well as make it very clear when adding what's happening.

I also added the tag only in get_tiles, which is only when we get the tiles. FWIW, also renamed the old periodic reporter, since it's less about re-fetching everything, and more about doing garbage collection.

@pjenvey
Copy link
Member

pjenvey commented Aug 4, 2021

I am concerned this tag will be too high granularity - every single k8s pod will have a different hostname. What are you trying to measure by adding the hostname?

Nothing too specific but it's helpful for diagnosing general individual pod behavior, allowing more correlation across metrics. E.g. the most recently spun up pod has this certain CPU usage with this number of adM request calls.

Though this is a good point, one I hadn't considered because we emit hostname tags for all autopush and some syncstorage metrics. I suppose it's a potential issue there but nobody's complained (yet).

Would a hostname tag in practice be much different from e.g. k8s metrics' resource.label.pod_name?

@jrconlin
Copy link
Member Author

jrconlin commented Aug 4, 2021

huh. So, looking at: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/ I don't believe that pods generally know what their name is, that info would have to be exposed in some way.

I'm going to drop this one in favor of better identifying the requirement in #200

@jrconlin jrconlin closed this Aug 4, 2021
@jrconlin
Copy link
Member Author

jrconlin commented Aug 4, 2021

In light of the conversation in #200, reopening.

@jrconlin jrconlin reopened this Aug 4, 2021
@jrconlin jrconlin requested a review from pjenvey August 4, 2021 23:31
@jrconlin jrconlin dismissed pjenvey’s stale review August 19, 2021 21:33

change applied

@jrconlin jrconlin merged commit ba04b24 into main Oct 7, 2021
@jrconlin jrconlin deleted the feat/200-hostname branch October 7, 2021 16:03
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.

Include a hostname tag in metrics
4 participants