Skip to content

Use empty string as the fault metric method label for HTTP requests.#693

Merged
HiramSilvey merged 5 commits intoreddit:masterfrom
HiramSilvey:lower-cardinality
Mar 27, 2025
Merged

Use empty string as the fault metric method label for HTTP requests.#693
HiramSilvey merged 5 commits intoreddit:masterfrom
HiramSilvey:lower-cardinality

Conversation

@HiramSilvey
Copy link
Copy Markdown
Contributor

@HiramSilvey HiramSilvey commented Mar 27, 2025

In-path parameters were causing this label to explode in cardinality. Until a better solution is worked out, we will drop that label value entirely for HTTP requests. This PR updates the Inject function to take in both a method and methodLabel parameter, since while we don't want to output the label, we do still want the method to be available for matching against the fault configuration in case a very specific fault is desired. Note that matching against all methods is unchanged by just not including a method to match against in the fault configuration, as was always the case. The parameter list was additionally updated to be a struct as it was getting long and unwieldy.

The remaining labels have maximums of 3, 2, 2 and 2 values respectively.
@HiramSilvey HiramSilvey requested a review from a team as a code owner March 27, 2025 14:16
@HiramSilvey HiramSilvey requested review from fishy, kylelemons and pacejackson and removed request for a team March 27, 2025 14:16
Copy link
Copy Markdown
Contributor

@mathyourlife-reddit mathyourlife-reddit left a comment

Choose a reason for hiding this comment

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

any dashboards/alerts/recording rules that'll need to be adjusted for the drop of these labels?

Copy link
Copy Markdown
Contributor

@pacejackson pacejackson left a comment

Choose a reason for hiding this comment

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

These seem like pretty standard labels across baseplate so I'm surprised it caused issues here, is there anything different about these?

@HiramSilvey
Copy link
Copy Markdown
Contributor Author

any dashboards/alerts/recording rules that'll need to be adjusted for the drop of these labels?

No, they're relatively new so I only had some draft dashboards using them so far.

@HiramSilvey
Copy link
Copy Markdown
Contributor Author

HiramSilvey commented Mar 27, 2025

These seem like pretty standard labels across baseplate so I'm surprised it caused issues here, is there anything different about these?

The method label in particular ended up using far too much memory in one particularly large service internally. There's some more information in a thread in the baseplate-go channel.

Edit: These are different from standard labels because these ones are based on upstream services rather than the local service.

Copy link
Copy Markdown

@scotthew1 scotthew1 left a comment

Choose a reason for hiding this comment

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

@pacejackson the address/method are for the upstream, so this is causing problems with services calling many different endpoints (i.e. graphql)

@scotthew1 scotthew1 requested a review from pacejackson March 27, 2025 14:29
No need to keep these around.
Copy link
Copy Markdown
Contributor

@fishy fishy left a comment

Choose a reason for hiding this comment

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

please update pr title as well :)

Copy link
Copy Markdown
Contributor

@pacejackson pacejackson left a comment

Choose a reason for hiding this comment

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

@HiramSilvey @scotthew1 My concern is that this is being treated as an anomaly for this middleware when this is actually a common pattern within all of our client middlewares.

headerbp
thriftbp
httpbp

So I'm worried that there's either:

A) Something else wrong
B) We are just already sitting close to the edge and this is just what pushed it over
C) GQL is doing something else to mitigate this and we should probably be doing that

@HiramSilvey HiramSilvey changed the title Comment out labels with high cardinality. Remove labels with high cardinality. Mar 27, 2025
@HiramSilvey HiramSilvey changed the title Remove labels with high cardinality. Use empty string as the fault metric method label for HTTP requests. Mar 27, 2025
Comment on lines +474 to +475
Method: method,
MethodLabel: "",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔕 this is under internal api so we can change this later, thus 🔕, but this is going to be a huge source of confusion in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack. I'll think of a better long-term solution for a follow-up PR then.

@HiramSilvey HiramSilvey merged commit c75248c into reddit:master Mar 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants