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

Ensure consistent labels for rpc metrics #1444

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Conversation

dnr
Copy link
Member

@dnr dnr commented Apr 16, 2024

What was changed

Ensure that all rpc metrics have a namespace label, by setting it to _unknown_ if it can't be derived from the request.

This was mentioned here: #861 (comment) and the resolution was to derive the namespace label from the request, which is great, but it should be consistent.

Why?

Many observability systems don't like the same metric to be emitted with different label sets.

Checklist

  1. Closes

  2. How was this tested:
    updated unit test

  3. Any docs updates needed?

@dnr dnr requested a review from a team as a code owner April 16, 2024 23:42
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

LGTM, @Quinn-With-Two-Ns - any objection?


// Since this interceptor can be used for clients of different name, we
// attempt to extract the namespace out of the request. All namespace-based
// requests have been confirmed to have a top-level namespace field.
namespace := "_unknown_"
Copy link
Member

@cretz cretz Apr 17, 2024

Choose a reason for hiding this comment

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

I wonder if "_none_" is better. I have no strong opinion though, this works for me (unsure if there is an industry standard placeholder here).

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 don't know if there is a standard. I might have picked a different value myself, but this is what the server uses for the same situation so it seemed like a good idea to match

Copy link
Contributor

@Quinn-With-Two-Ns Quinn-With-Two-Ns left a comment

Choose a reason for hiding this comment

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

We should probably ensure whatever we do here we do across all SDKs

@dnr dnr merged commit 93c08b0 into temporalio:master Apr 24, 2024
13 checks passed
@dnr dnr deleted the metriclabels branch April 24, 2024 06:00
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.

None yet

3 participants