Skip to content

feature: Provide custom MetricTags during runtime - #111

Merged
pboos merged 2 commits into
mainfrom
feature/metric-tags-provider
May 31, 2024
Merged

feature: Provide custom MetricTags during runtime#111
pboos merged 2 commits into
mainfrom
feature/metric-tags-provider

Conversation

@pboos

@pboospboos commented May 30, 2024

Copy link
Copy Markdown
Contributor

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):

@ComponentpublicclassMetricTagProviderExampleimplementsMetricTagProvider {
@OverridepublicList<MetricTag> getTagsForViolation(OpenApiViolationviolation) {
returnList.of(newMetricTag("rule", violation.getRule()));
}
}

@pboos
pboos requested review from a team and eleonoraborghiMay 30, 2024 14:03

@eleonoraborghieleonoraborghi left a comment

Copy link
Copy Markdown

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 mainMay 31, 2024
@pboos
pboos deleted the feature/metric-tags-provider branch May 31, 2024 12:08
Sign up for freeto 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

@pboos@eleonoraborghi