-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved Jakarta and latest Jakarta based dependencies
created a separate micrometer-jakarta module and put all the latest deps there. That way we could instrument latest Tomcat, Jersey etc. without any classpath issues
- Loading branch information
1 parent
1e8f194
commit 77bd8b1
Showing
44 changed files
with
857 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
plugins { | ||
id 'me.champeau.mrjar' version "0.1.1" | ||
} | ||
|
||
description 'Module for Jakarta based instrumentations' | ||
|
||
jar { | ||
bundle { | ||
|
||
bnd '''\ | ||
Import-Package: \ | ||
org.eclipse.jetty.*;resolution:=dynamic;version="${@}",\ | ||
org.glassfish.jersey.*;resolution:=dynamic;version="${@}",\ | ||
ch.qos.logback.*;resolution:=dynamic;version="${@}",\ | ||
org.apache.logging.log4j.*;resolution:=dynamic;version="${@}",\ | ||
jakarta.jms.*;resolution:=dynamic;version="${@}",\ | ||
jakarta.servlet.*;resolution:=dynamic;version="${@}",\ | ||
io.micrometer.context.*;resolution:=dynamic,\ | ||
io.micrometer.observation.*;resolution:=dynamic;version="${@}",\ | ||
* | ||
'''.stripIndent() | ||
} | ||
} | ||
|
||
dependencies { | ||
api project(":micrometer-core") | ||
api project(":micrometer-commons") | ||
api project(":micrometer-observation") | ||
optionalApi 'jakarta.ws.rs:jakarta.ws.rs-api:3.+' // jakarta | ||
|
||
// Aspects | ||
optionalApi 'org.aspectj:aspectjweaver' | ||
|
||
optionalApi 'org.eclipse.jetty:jetty-server' | ||
// jakarta servlet | ||
optionalApi 'jakarta.servlet:jakarta.servlet-api:5.+' | ||
optionalApi 'org.eclipse.jetty:jetty-client:12.0.+' | ||
optionalApi 'org.apache.tomcat.embed:tomcat-embed-core:10.1.+' | ||
optionalApi 'org.glassfish.jersey.core:jersey-server:3.1.+' | ||
// jakarta JMS | ||
optionalApi 'jakarta.jms:jakarta.jms-api' | ||
|
||
// log monitoring | ||
optionalApi 'ch.qos.logback:logback-classic' | ||
optionalApi 'org.apache.logging.log4j:log4j-core' | ||
|
||
optionalApi project(':micrometer-observation') | ||
optionalApi 'io.micrometer:context-propagation' | ||
|
||
testImplementation project(":micrometer-observation-test") | ||
|
||
// JUnit 5 | ||
testImplementation 'org.junit.jupiter:junit-jupiter' | ||
testImplementation 'com.tngtech.archunit:archunit-junit5' | ||
|
||
testImplementation 'org.mockito:mockito-inline' | ||
|
||
testImplementation 'org.assertj:assertj-core' | ||
testImplementation 'org.awaitility:awaitility' | ||
|
||
testImplementation 'org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-inmemory' | ||
testRuntimeOnly 'org.glassfish.jersey.inject:jersey-hk2' | ||
|
||
testImplementation 'ru.lanwen.wiremock:wiremock-junit5' | ||
testImplementation 'com.github.tomakehurst:wiremock-jre8-standalone' | ||
|
||
// Dependencies for @ClassPathExclusions | ||
testImplementation("org.junit.platform:junit-platform-engine") | ||
testImplementation("org.junit.platform:junit-platform-launcher") | ||
testImplementation("javax.validation:validation-api") | ||
testImplementation("org.jboss.resteasy:resteasy-netty4") | ||
} | ||
|
||
task shenandoahTest(type: Test) { | ||
// set heap size for the test JVM(s) | ||
maxHeapSize = "1500m" | ||
|
||
useJUnitPlatform { | ||
includeTags 'gc' | ||
} | ||
|
||
jvmArgs '-XX:+UseShenandoahGC' | ||
} | ||
|
||
task zgcTest(type: Test) { | ||
// set heap size for the test JVM(s) | ||
maxHeapSize = "1500m" | ||
|
||
useJUnitPlatform { | ||
includeTags 'gc' | ||
} | ||
|
||
jvmArgs '-XX:+UseZGC' | ||
} | ||
|
||
task openj9BalancedTest(type: Test) { | ||
// set heap size for the test JVM(s) | ||
maxHeapSize = "1500m" | ||
|
||
useJUnitPlatform { | ||
includeTags 'gc' | ||
} | ||
|
||
jvmArgs '-Xgcpolicy:balanced' | ||
} | ||
|
||
task openj9ConcurrentScavengeTest(type: Test) { | ||
// set heap size for the test JVM(s) | ||
maxHeapSize = "1500m" | ||
|
||
useJUnitPlatform { | ||
includeTags 'gc' | ||
} | ||
|
||
jvmArgs '-Xgc:concurrentScavenge' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...a/instrument/binder/http/DefaultHttpJakartaServerServletRequestObservationConvention.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright 2023 VMware, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micrometer.jakarta.instrument.binder.http; | ||
|
||
import io.micrometer.common.KeyValues; | ||
import io.micrometer.core.instrument.binder.http.AbstractDefaultHttpServerRequestObservationConvention; | ||
|
||
/** | ||
* Default {@link HttpJakartaServerServletRequestObservationConvention}. | ||
* | ||
* @author Brian Clozel | ||
* @author Marcin Grzejszczak | ||
* @since 1.12.0 | ||
*/ | ||
public class DefaultHttpJakartaServerServletRequestObservationConvention | ||
extends AbstractDefaultHttpServerRequestObservationConvention | ||
implements HttpJakartaServerServletRequestObservationConvention { | ||
|
||
private static final String DEFAULT_NAME = "http.server.requests"; | ||
|
||
private final String name; | ||
|
||
/** | ||
* Create a convention with the default name {@code "http.server.requests"}. | ||
*/ | ||
public DefaultHttpJakartaServerServletRequestObservationConvention() { | ||
this(DEFAULT_NAME); | ||
} | ||
|
||
/** | ||
* Create a convention with a custom name. | ||
* @param name the observation name | ||
*/ | ||
public DefaultHttpJakartaServerServletRequestObservationConvention(String name) { | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
@Override | ||
public String getContextualName(HttpJakartaServerServletRequestObservationContext context) { | ||
String method = context.getCarrier().getMethod(); | ||
if (method == null) { | ||
return null; | ||
} | ||
return getContextualName(method.toLowerCase(), context.getPathPattern()); | ||
} | ||
|
||
@Override | ||
public KeyValues getLowCardinalityKeyValues(HttpJakartaServerServletRequestObservationContext context) { | ||
String method = context.getCarrier() != null ? context.getCarrier().getMethod() : null; | ||
Integer status = context.getResponse() != null ? context.getResponse().getStatus() : null; | ||
String pathPattern = context.getPathPattern(); | ||
String requestUri = context.getCarrier() != null ? context.getCarrier().getRequestURI() : null; | ||
return getLowCardinalityKeyValues(context.getError(), method, status, pathPattern, requestUri); | ||
} | ||
|
||
@Override | ||
public KeyValues getHighCardinalityKeyValues(HttpJakartaServerServletRequestObservationContext context) { | ||
String requestUri = context.getCarrier() != null ? context.getCarrier().getRequestURI() : null; | ||
return getHighCardinalityKeyValues(requestUri); | ||
} | ||
|
||
} |
Oops, something went wrong.