mirror of
https://github.com/signalapp/Signal-Server
synced 2026-02-24 16:45:17 +00:00
Include request method as a request counter dimension
This commit is contained in:
committed by
Chris Eager
parent
cb72e4f426
commit
a83fd1d3fe
@@ -29,6 +29,9 @@ public class MetricsRequestEventListener implements RequestEventListener {
|
||||
@VisibleForTesting
|
||||
static final String PATH_TAG = "path";
|
||||
|
||||
@VisibleForTesting
|
||||
static final String METHOD_TAG = "method";
|
||||
|
||||
@VisibleForTesting
|
||||
static final String STATUS_CODE_TAG = "status";
|
||||
|
||||
@@ -52,8 +55,9 @@ public class MetricsRequestEventListener implements RequestEventListener {
|
||||
public void onEvent(final RequestEvent event) {
|
||||
if (event.getType() == RequestEvent.Type.FINISHED) {
|
||||
if (!event.getUriInfo().getMatchedTemplates().isEmpty()) {
|
||||
final List<Tag> tags = new ArrayList<>(4);
|
||||
final List<Tag> tags = new ArrayList<>(5);
|
||||
tags.add(Tag.of(PATH_TAG, UriInfoUtil.getPathTemplate(event.getUriInfo())));
|
||||
tags.add(Tag.of(METHOD_TAG, event.getContainerRequest().getMethod()));
|
||||
tags.add(Tag.of(STATUS_CODE_TAG, String.valueOf(event.getContainerResponse().getStatus())));
|
||||
tags.add(Tag.of(TRAFFIC_SOURCE_TAG, trafficSource.name().toLowerCase()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user