Skip to content

Commit

Permalink
Rename apache-pulsar to pulsar and apache-camel to camel (#8195)
Browse files Browse the repository at this point in the history
Closes #8004
  • Loading branch information
trask authored Apr 3, 2023
1 parent 8704510 commit b01996e
Show file tree
Hide file tree
Showing 77 changed files with 62 additions and 66 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ The `opentelemetry-instrumentation-api` artifact is declared stable in this rele

- Renamed Apache Dubbo and Log4j MDC library artifacts
([#4779](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/4779))
- Added http4 handler to apache-camel instrumentation
- Added http4 handler to camel instrumentation
([#4650](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/4650))
- Capture servlet request parameters
([#4703](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/4703))
Expand Down
5 changes: 0 additions & 5 deletions instrumentation/apache-camel-2.20/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions instrumentation/apache-pulsar/apache-pulsar-2.8/README.md

This file was deleted.

This file was deleted.

5 changes: 5 additions & 0 deletions instrumentation/camel-2.20/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Settings for the Apache Camel instrumentation

| System property | Type | Default | Description |
|---|---|---|---|
| `otel.instrumentation.camel.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes. |
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
testImplementation(project(":instrumentation:apache-camel-2.20:javaagent"))
testImplementation(project(":instrumentation:camel-2.20:javaagent"))
testImplementation(project(":instrumentation-api-semconv"))
testImplementation(project(":javaagent-extension-api"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies {
tasks {
withType<Test>().configureEach {
// TODO run tests both with and without experimental span attributes
jvmArgs("-Dotel.instrumentation.apache-camel.experimental-span-attributes=true")
jvmArgs("-Dotel.instrumentation.camel.experimental-span-attributes=true")
jvmArgs("-Dotel.instrumentation.aws-sdk.experimental-span-attributes=true")

// TODO: fix camel instrumentation so that it uses semantic attributes extractors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class ApacheCamelInstrumentationModule extends InstrumentationModule {

public ApacheCamelInstrumentationModule() {
super("apache-camel", "apache-camel-2.20");
super("camel", "camel-2.20");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

public final class CamelSingletons {

private static final String INSTRUMENTATION_NAME = "io.opentelemetry.apache-camel-2.20";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.camel-2.20";

private static final DecoratorRegistry registry = new DecoratorRegistry();
private static final Instrumenter<CamelRequest, Void> INSTRUMENTER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BaseSpanDecorator implements SpanDecorator {

static final boolean CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES =
InstrumentationConfig.get()
.getBoolean("otel.instrumentation.apache-camel.experimental-span-attributes", false);
.getBoolean("otel.instrumentation.camel.experimental-span-attributes", false);

static final String DEFAULT_OPERATION_NAME = "CamelOperation";

Expand Down Expand Up @@ -102,7 +102,7 @@ public void pre(
Endpoint endpoint,
CamelDirection camelDirection) {
if (CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES) {
attributes.put("apache-camel.uri", URISupport.sanitizeUri(endpoint.getEndpointUri()));
attributes.put("camel.uri", URISupport.sanitizeUri(endpoint.getEndpointUri()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ public void pre(
if (CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES) {
String partitionKey = (String) exchange.getIn().getHeader(PARTITION_KEY);
if (partitionKey != null) {
attributes.put("apache-camel.kafka.partitionKey", partitionKey);
attributes.put("camel.kafka.partitionKey", partitionKey);
}

String key = (String) exchange.getIn().getHeader(KEY);
if (key != null) {
attributes.put("apache-camel.kafka.key", key);
attributes.put("camel.kafka.key", key);
}

String offset = getValue(exchange, OFFSET, Long.class);
if (offset != null) {
attributes.put("apache-camel.kafka.offset", offset);
attributes.put("camel.kafka.offset", offset);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ class DirectCamelTest extends AgentInstrumentationSpecification {
kind INTERNAL
hasNoParent()
attributes {
"apache-camel.uri" "direct://input"
"camel.uri" "direct://input"
}
}
it.span(1) {
name "receiver"
kind INTERNAL
parentSpanId parent.span(0).spanId
attributes {
"apache-camel.uri" "direct://receiver"
"camel.uri" "direct://receiver"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MulticastDirectCamelTest extends AgentInstrumentationSpecification {
kind INTERNAL
hasNoParent()
attributes {
"apache-camel.uri" "direct://input"
"camel.uri" "direct://input"
}
}
// there is no strict ordering of "first" and "second" span
Expand All @@ -59,15 +59,15 @@ class MulticastDirectCamelTest extends AgentInstrumentationSpecification {
kind INTERNAL
parentSpanId parent.span(0).spanId
attributes {
"apache-camel.uri" "direct://first"
"camel.uri" "direct://first"
}
}
it.span(indexOfSecond) {
name "second"
kind INTERNAL
parentSpanId parent.span(0).spanId
attributes {
"apache-camel.uri" "direct://second"
"camel.uri" "direct://second"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import org.springframework.boot.SpringApplication
import org.springframework.context.ConfigurableApplicationContext
import spock.lang.Shared

import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.SpanKind.*
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_TCP

class RestCamelTest extends AgentInstrumentationSpecification implements RetryOnAddressAlreadyInUseTrait {
Expand Down Expand Up @@ -70,7 +68,7 @@ class RestCamelTest extends AgentInstrumentationSpecification implements RetryOn
name "start"
kind INTERNAL
attributes {
"apache-camel.uri" "direct://start"
"camel.uri" "direct://start"
}
}
it.span(1) {
Expand All @@ -80,7 +78,7 @@ class RestCamelTest extends AgentInstrumentationSpecification implements RetryOn
attributes {
"$SemanticAttributes.HTTP_METHOD" "GET"
"$SemanticAttributes.HTTP_STATUS_CODE" 200
"apache-camel.uri" "rest://get:api/%7Bmodule%7D/unit/%7BunitId%7D"
"camel.uri" "rest://get:api/%7Bmodule%7D/unit/%7BunitId%7D"
}
}
it.span(2) {
Expand Down Expand Up @@ -110,15 +108,15 @@ class RestCamelTest extends AgentInstrumentationSpecification implements RetryOn
attributes {
"$SemanticAttributes.HTTP_METHOD" "GET"
"$SemanticAttributes.HTTP_URL" "http://localhost:$port/api/firstModule/unit/unitOne"
"apache-camel.uri" String
"camel.uri" String
}
}
it.span(4) {
name "moduleUnit"
kind INTERNAL
parentSpanId(span(3).spanId)
attributes {
"apache-camel.uri" "direct://moduleUnit"
"camel.uri" "direct://moduleUnit"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SingleServiceCamelTest extends AgentInstrumentationSpecification implement
attributes {
"$SemanticAttributes.HTTP_METHOD" "POST"
"$SemanticAttributes.HTTP_URL" "${address.resolve("/camelService")}"
"apache-camel.uri" "${address.resolve("/camelService")}".replace("localhost", "0.0.0.0")
"camel.uri" "${address.resolve("/camelService")}".replace("localhost", "0.0.0.0")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ import org.springframework.boot.SpringApplication
import org.springframework.context.ConfigurableApplicationContext
import spock.lang.Shared

import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.SpanKind.*
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_TCP

class TwoServicesWithDirectClientCamelTest extends AgentInstrumentationSpecification implements RetryOnAddressAlreadyInUseTrait {
Expand Down Expand Up @@ -52,9 +50,9 @@ class TwoServicesWithDirectClientCamelTest extends AgentInstrumentationSpecifica
clientContext.addRoutes(new RouteBuilder() {
void configure() {
from("direct:input")
.log("SENT Client request")
.to("http://localhost:$portOne/serviceOne")
.log("RECEIVED Client response")
.log("SENT Client request")
.to("http://localhost:$portOne/serviceOne")
.log("RECEIVED Client response")
}
})
clientContext.start()
Expand Down Expand Up @@ -82,7 +80,7 @@ class TwoServicesWithDirectClientCamelTest extends AgentInstrumentationSpecifica
name "input"
kind INTERNAL
attributes {
"apache-camel.uri" "direct://input"
"camel.uri" "direct://input"
}
}
it.span(1) {
Expand All @@ -93,7 +91,7 @@ class TwoServicesWithDirectClientCamelTest extends AgentInstrumentationSpecifica
"$SemanticAttributes.HTTP_METHOD" "POST"
"$SemanticAttributes.HTTP_URL" "http://localhost:$portOne/serviceOne"
"$SemanticAttributes.HTTP_STATUS_CODE" 200
"apache-camel.uri" "http://localhost:$portOne/serviceOne"
"camel.uri" "http://localhost:$portOne/serviceOne"
}
}
it.span(2) {
Expand All @@ -104,7 +102,7 @@ class TwoServicesWithDirectClientCamelTest extends AgentInstrumentationSpecifica
"$SemanticAttributes.HTTP_METHOD" "POST"
"$SemanticAttributes.HTTP_URL" "http://localhost:$portOne/serviceOne"
"$SemanticAttributes.HTTP_STATUS_CODE" 200
"apache-camel.uri" "http://0.0.0.0:$portOne/serviceOne"
"camel.uri" "http://0.0.0.0:$portOne/serviceOne"
}
}
it.span(3) {
Expand All @@ -115,7 +113,7 @@ class TwoServicesWithDirectClientCamelTest extends AgentInstrumentationSpecifica
"$SemanticAttributes.HTTP_METHOD" "POST"
"$SemanticAttributes.HTTP_URL" "http://127.0.0.1:$portTwo/serviceTwo"
"$SemanticAttributes.HTTP_STATUS_CODE" 200
"apache-camel.uri" "http://127.0.0.1:$portTwo/serviceTwo"
"camel.uri" "http://127.0.0.1:$portTwo/serviceTwo"
}
}
it.span(4) {
Expand Down Expand Up @@ -145,7 +143,7 @@ class TwoServicesWithDirectClientCamelTest extends AgentInstrumentationSpecifica
attributes {
"$SemanticAttributes.HTTP_METHOD" "POST"
"$SemanticAttributes.HTTP_URL" "http://127.0.0.1:$portTwo/serviceTwo"
"apache-camel.uri" "jetty:http://0.0.0.0:$portTwo/serviceTwo?arg=value"
"camel.uri" "jetty:http://0.0.0.0:$portTwo/serviceTwo?arg=value"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CamelSpan {
kind INTERNAL
hasNoParent()
attributes {
"apache-camel.uri" "direct://${spanName}"
"camel.uri" "direct://${spanName}"
}
}
}
Expand All @@ -33,7 +33,7 @@ class CamelSpan {
childOf parentSpan
}
attributes {
"apache-camel.uri" "aws-sqs://${queueName}?amazonSQSClient=%23sqsClient&delay=1000"
"camel.uri" "aws-sqs://${queueName}?amazonSQSClient=%23sqsClient&delay=1000"
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" queueName
}
}
Expand All @@ -49,7 +49,7 @@ class CamelSpan {
childOf parentSpan
}
attributes {
"apache-camel.uri" "aws-sqs://${queueName}?amazonSQSClient=%23sqsClient&delay=1000"
"camel.uri" "aws-sqs://${queueName}?amazonSQSClient=%23sqsClient&delay=1000"
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" queueName
"$SemanticAttributes.MESSAGING_MESSAGE_ID" String
}
Expand All @@ -62,7 +62,7 @@ class CamelSpan {
kind INTERNAL
childOf parentSpan
attributes {
"apache-camel.uri" "aws-sns://${topicName}?amazonSNSClient=%23snsClient"
"camel.uri" "aws-sns://${topicName}?amazonSNSClient=%23snsClient"
"$SemanticAttributes.MESSAGING_DESTINATION_NAME" topicName
}
}
Expand All @@ -74,7 +74,7 @@ class CamelSpan {
kind INTERNAL
childOf parentSpan
attributes {
"apache-camel.uri" "aws-s3://${bucketName}?amazonS3Client=%23s3Client"
"camel.uri" "aws-s3://${bucketName}?amazonS3Client=%23s3Client"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ class CassandraTest extends AgentInstrumentationSpecification implements RetryOn
kind INTERNAL
hasNoParent()
attributes {
"apache-camel.uri" "direct://input"
"camel.uri" "direct://input"
}
}
span(1) {
kind CLIENT
attributes {
"apache-camel.uri" "cql://$host:$port/test"
"camel.uri" "cql://$host:$port/test"
"$SemanticAttributes.DB_NAME" "test"
"$SemanticAttributes.DB_STATEMENT" "select * from test.users where id=? ALLOW FILTERING"
"$SemanticAttributes.DB_SYSTEM" "cassandra"
Expand Down
5 changes: 5 additions & 0 deletions instrumentation/pulsar/apache-pulsar-2.8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Settings for the Apache Pulsar instrumentation

| System property | Type | Default | Description |
|---|---|---|---|
| `otel.instrumentation.pulsar.experimental-span-attributes` | `Boolean | `false` | Enable the capture of experimental span attributes. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id("otel.java-conventions")
}

dependencies {
testImplementation(project(":instrumentation:pulsar:pulsar-2.8:javaagent"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ dependencies {

tasks.withType<Test>().configureEach {
// TODO run tests both with and without experimental span attributes
jvmArgs("-Dotel.instrumentation.apache-pulsar.experimental-span-attributes=true")
jvmArgs("-Dotel.instrumentation.pulsar.experimental-span-attributes=true")
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@AutoService(InstrumentationModule.class)
public class PulsarInstrumentationModule extends InstrumentationModule {
public PulsarInstrumentationModule() {
super("apache-pulsar", "apache-pulsar-2.8.0");
super("pulsar", "pulsar-2.8.0");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.pulsar.client.api.Message;

public final class PulsarSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.apache-pulsar-2.8";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.pulsar-2.8";

private static final OpenTelemetry TELEMETRY = GlobalOpenTelemetry.get();
private static final TextMapPropagator PROPAGATOR =
Expand Down Expand Up @@ -96,7 +96,7 @@ private static Instrumenter<PulsarRequest, Void> createProducerInstrumenter() {
NetClientAttributesExtractor.create(new PulsarNetClientAttributesGetter()));

if (InstrumentationConfig.get()
.getBoolean("otel.instrumentation.apache-pulsar.experimental-span-attributes", false)) {
.getBoolean("otel.instrumentation.pulsar.experimental-span-attributes", false)) {
builder.addAttributesExtractor(ExperimentalProducerAttributesExtractor.INSTANCE);
}

Expand Down
Loading

0 comments on commit b01996e

Please sign in to comment.