-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New rest observation instrumentation and tests
- Loading branch information
Showing
46 changed files
with
2,387 additions
and
87 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
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
6 changes: 6 additions & 0 deletions
6
.../main/java/io/smallrye/opentelemetry/instrumentation/observation/handler/HandlerUtil.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,6 @@ | ||
package io.smallrye.opentelemetry.instrumentation.observation.handler; | ||
|
||
public class HandlerUtil { | ||
public static final String LOW_CARD_ATTRIBUTES = "low_card_attributes"; | ||
public static final String HIGH_CARD_ATTRIBUTES = "high_card_attributes"; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...tation/observation-otel-bridge/src/main/resources/META-INF/microprofile-config.properties
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
otel.logs.exporter=none | ||
#otel.logs.exporter=none | ||
otel.metric.export.interval=1000 |
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,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.smallrye.opentelemetry</groupId> | ||
<artifactId>smallrye-opentelemetry-parent</artifactId> | ||
<version>2.8.2-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>smallrye-opentelemetry-rest-observation</artifactId> | ||
<name>SmallRye OpenTelemetry: REST Observation</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.smallrye.opentelemetry</groupId> | ||
<artifactId>smallrye-opentelemetry-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye.opentelemetry</groupId> | ||
<artifactId>smallrye-opentelemetry-micrometer-otel-bridge</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye.opentelemetry</groupId> | ||
<artifactId>smallrye-opentelemetry-observation-otel-bridge</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>jakarta.enterprise</groupId> | ||
<artifactId>jakarta.enterprise.cdi-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>jakarta.ws.rs</groupId> | ||
<artifactId>jakarta.ws.rs-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.opentelemetry.semconv</groupId> | ||
<artifactId>opentelemetry-semconv</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
148 changes: 148 additions & 0 deletions
148
...n/java/io/smallrye/opentelemetry/implementation/rest/observation/FilterDocumentation.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,148 @@ | ||
package io.smallrye.opentelemetry.implementation.rest.observation; | ||
|
||
import io.micrometer.common.docs.KeyName; | ||
import io.micrometer.observation.docs.ObservationDocumentation; | ||
import io.smallrye.opentelemetry.implementation.rest.observation.client.ClientFilterConvention; | ||
import io.smallrye.opentelemetry.implementation.rest.observation.client.DefaultClientFilterConvention; | ||
import io.smallrye.opentelemetry.implementation.rest.observation.server.DefaultServerFilterConvention; | ||
import io.smallrye.opentelemetry.implementation.rest.observation.server.ServerFilterConvention; | ||
|
||
public enum FilterDocumentation implements ObservationDocumentation { | ||
SERVER { | ||
@Override | ||
public Class<? extends ServerFilterConvention> getDefaultConvention() { | ||
return DefaultServerFilterConvention.class; | ||
} | ||
|
||
@Override | ||
public KeyName[] getLowCardinalityKeyNames() { | ||
return LowCardinalityValues.values(); | ||
} | ||
|
||
@Override | ||
public KeyName[] getHighCardinalityKeyNames() { | ||
return KeyName.merge(HighCardinalityValues.values(), ServerHighCardinalityValues.values()); | ||
} | ||
}, | ||
CLIENT { | ||
@Override | ||
public Class<? extends ClientFilterConvention> getDefaultConvention() { | ||
return DefaultClientFilterConvention.class; | ||
} | ||
|
||
@Override | ||
public KeyName[] getLowCardinalityKeyNames() { | ||
return LowCardinalityValues.values(); | ||
} | ||
|
||
@Override | ||
public KeyName[] getHighCardinalityKeyNames() { | ||
return KeyName.merge(HighCardinalityValues.values(), ClientHighCardinalityValues.values()); | ||
} | ||
}; | ||
|
||
public enum LowCardinalityValues implements KeyName { | ||
/** | ||
* The HTTP method of the request. | ||
*/ | ||
HTTP_REQUEST_METHOD { | ||
@Override | ||
public String asString() { | ||
return "http.request.method"; | ||
} | ||
}, | ||
HTTP_ROUTE { | ||
@Override | ||
public String asString() { | ||
return "http.route"; | ||
} | ||
}, | ||
URL_SCHEME { | ||
@Override | ||
public String asString() { | ||
return "url.scheme"; | ||
} | ||
}, | ||
HTTP_RESPONSE_STATUS_CODE { | ||
@Override | ||
public String asString() { | ||
return "http.response.status_code"; | ||
} | ||
}, | ||
NETWORK_PROTOCOL_NAME { | ||
@Override | ||
public String asString() { | ||
return "network.protocol.name"; | ||
} | ||
}, | ||
NETWORK_PROTOCOL_VERSION { | ||
@Override | ||
public String asString() { | ||
return "network.protocol.version"; | ||
} | ||
} | ||
} | ||
|
||
public enum ServerHighCardinalityValues implements KeyName { | ||
SERVER_PORT { | ||
@Override | ||
public String asString() { | ||
return "server.port"; | ||
} | ||
}, | ||
SERVER_ADDRESS { | ||
@Override | ||
public String asString() { | ||
return "server.address"; | ||
} | ||
} | ||
} | ||
|
||
public enum ClientHighCardinalityValues implements KeyName { | ||
CLIENT_ADDRESS { | ||
@Override | ||
public String asString() { | ||
return "client.address"; | ||
} | ||
}, | ||
CLIENT_PORT { | ||
@Override | ||
public String asString() { | ||
return "client.port"; | ||
} | ||
} | ||
} | ||
|
||
public enum HighCardinalityValues implements KeyName { | ||
URL_PATH { | ||
@Override | ||
public String asString() { | ||
return "url.path"; | ||
} | ||
}, | ||
URL_QUERY { | ||
@Override | ||
public String asString() { | ||
return "url.query"; | ||
} | ||
}, | ||
ERROR { | ||
@Override | ||
public String asString() { | ||
return "error"; | ||
} | ||
}, | ||
URL_FULL { | ||
@Override | ||
public String asString() { | ||
return "url.full"; | ||
} | ||
}, | ||
USER_AGENT_ORIGINAL { | ||
@Override | ||
public String asString() { | ||
return "user_agent.original"; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.