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

feature: Provide custom MetricTags during runtime #111

Merged
merged 2 commits into from
May 31, 2024

Conversation

pboos
Copy link
Collaborator

@pboos pboos commented May 30, 2024

Until now one could only provide additional metric tags through the configuration file application.properties. Sometimes they should be provided at runtime.

This change allows providing MetricTags at runtime for each violation.

An example of such a provider (taken from the README.md):

@Component
public class MetricTagProviderExample implements MetricTagProvider {
  @Override
  public List<MetricTag> getTagsForViolation(OpenApiViolation violation) {
    return List.of(new MetricTag("rule", violation.getRule()));
  }
}

@pboos pboos requested a review from a team as a code owner May 30, 2024 14:03
@pboos pboos requested a review from eleonoraborghi May 30, 2024 14:03
Copy link

@eleonoraborghi eleonoraborghi left a comment

Choose a reason for hiding this comment

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

Looks good!

@pboos pboos merged commit 042dcf0 into main May 31, 2024
1 check passed
@pboos pboos deleted the feature/metric-tags-provider branch May 31, 2024 12:08
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.

2 participants