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

Micrometer metric tag for http method #1631

Closed
divsmith opened this issue Jun 10, 2022 · 3 comments
Closed

Micrometer metric tag for http method #1631

divsmith opened this issue Jun 10, 2022 · 3 comments
Labels
proposal Proposed Specification or API change waiting for votes Enhancements or changes proposed that need more support before consideration

Comments

@divsmith
Copy link

divsmith commented Jun 10, 2022

Description

The method tag added by feign-micrometer is the method name of the interface, not the http method. For example, metrics for requests made with the following client:

interface GitHub() {
     @RequestLine("GET /repos/{owner}/{repo}/issues")
     List<Issue> getIssues(@Param("owner") String owner, @Param("repo") String repo);
}

will have a method tag with a value of getIssues.

This becomes problematic when the same URI is used with multiple http methods:

interface GitHub() {
    @RequestLine("GET /repos/{owner}/{repo}/issues")
    List<Issue> getIssues(@Param("owner") String owner, @Param("repo") String repo);

    @RequestLine("POST /repos/{owner}/{repo}/issues")
    void createIssue(Issue issue, @Param("owner") String owner, @Param("repo") String repo);
} 

Metrics for these requests will have a method tag of getIssues or createIssues respectively, but both have the same uri tag with a value of /repos/{owner}/{repo}/issues. This makes it difficult to separate the two metrics intuitively without knowledge of the specific client implementation.

Proposal:

Add a tag named http_method (or something similar) with the value of the http method for the request.

@kdavisk6 kdavisk6 added waiting for votes Enhancements or changes proposed that need more support before consideration proposal Proposed Specification or API change labels Oct 7, 2022
@kdavisk6
Copy link
Member

kdavisk6 commented Oct 7, 2022

Feel free to provide an API proposal for discussion and we'll help move it along.

@rnavarropiris
Copy link
Contributor

The referenced merged pull request solves this issue, so this can be closed now :)

@divsmith
Copy link
Author

Nice, thanks @rnavarropiris!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposed Specification or API change waiting for votes Enhancements or changes proposed that need more support before consideration
Projects
None yet
Development

No branches or pull requests

3 participants