Skip to content
Discussion options

You must be logged in to vote

Thanks to @geoand I made that work by checking the tags in the Meter.Id API:

	if (id.getTags().contains(Outcome.CLIENT_ERROR.asTag())) {
	    return MeterFilter.deny().configure(id, config);
	}

Here is my complete MeterFilter implementation:

import java.util.Set;
import java.util.concurrent.TimeUnit;

import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.config.MeterFilter;
import io.micrometer.core.instrument.distribution.DistributionStatisticConfig;
import jakarta.inject.Singleton;

/**
 * Enable histogram buckets for http.server.requests metric
 */
@Singleton
public class HistogramMeterFilter implements MeterFilter {
…

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@geoand
Comment options

geoand Jul 11, 2023
Collaborator

@gastaldi
Comment options

gastaldi Jul 11, 2023
Collaborator Author

@geoand
Comment options

geoand Jul 11, 2023
Collaborator

@gastaldi
Comment options

gastaldi Jul 11, 2023
Collaborator Author

@geoand
Comment options

geoand Jul 11, 2023
Collaborator

Comment options

gastaldi
Jul 11, 2023
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by gastaldi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants