Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instrumentation for rocketmq #2263

Merged
merged 57 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
535b95b
Merge pull request #1 from open-telemetry/main
addname Feb 12, 2021
0d1fbed
add rocketmq support
addname Feb 12, 2021
cb059ab
Merge branch 'main'
addname Feb 12, 2021
2f2cfcf
merge main
addname Feb 12, 2021
d3fd46b
Merge branch 'main'
addname Feb 15, 2021
bce0921
modify tests
addname Feb 16, 2021
924b2e3
modify tests
addname Feb 16, 2021
fb41154
modify tests
addname Feb 16, 2021
451d3a5
modify style
addname Feb 16, 2021
24d1d4a
modify style
addname Feb 16, 2021
fd9f3a4
modify style
addname Feb 16, 2021
06ea7bc
modify style
addname Feb 16, 2021
f40b086
modify tests
addname Feb 16, 2021
bad5c16
modify tests
addname Feb 16, 2021
73bbefb
modify tests
addname Feb 16, 2021
06175b2
modify tests
addname Feb 16, 2021
fb3dc3d
Merge branch 'main'
addname Feb 18, 2021
a7f764c
Merge branch 'main'
addname Feb 24, 2021
66617dc
Merge branch 'main' of /~https://github.com/open-telemetry/opentelemetr…
addname Feb 28, 2021
4094f4a
Use hooks to register in the iavaagent instrumentation
addname Feb 28, 2021
558acf7
Use hooks to register in the iavaagent instrumentation
addname Feb 28, 2021
310c268
Use hooks to register in the iavaagent instrumentation
addname Feb 28, 2021
c98b828
Use hooks to register in the iavaagent instrumentation
addname Feb 28, 2021
1ea63af
Use hooks to register in the iavaagent instrumentation
addname Feb 28, 2021
449b8e2
Use hooks to register in the iavaagent instrumentation
addname Feb 28, 2021
55aa9f2
Merge branch 'main' of /~https://github.com/open-telemetry/opentelemetr…
addname Mar 5, 2021
a92c9b3
Fix
addname Mar 6, 2021
b5ba2ca
Revert "Use hooks to register in the iavaagent instrumentation"
addname Mar 6, 2021
0887762
Merge branch 'main' of /~https://github.com/open-telemetry/opentelemetr…
addname Mar 6, 2021
48de0f7
Fix
addname Mar 6, 2021
ad8cbc7
Fix
addname Mar 6, 2021
f28eee6
Fix
addname Mar 6, 2021
81c3720
Fix
addname Mar 6, 2021
1c2c71f
Fix
addname Mar 6, 2021
0ed11a0
Fix
addname Mar 6, 2021
c32bc40
Fix
addname Mar 6, 2021
460092a
Merge branch 'main' of /~https://github.com/open-telemetry/opentelemetr…
addname Mar 9, 2021
0489ef9
Fix
addname Mar 9, 2021
963e012
Fix
addname Mar 9, 2021
00aa1fa
Fix
addname Mar 9, 2021
5419081
Fix
addname Mar 9, 2021
8419db8
Fix
addname Mar 9, 2021
aa2c7b5
Fix
addname Mar 9, 2021
8c606f6
Update settings.gradle
anuraaga Mar 9, 2021
4a00e83
Merge branch 'main' of /~https://github.com/open-telemetry/opentelemetr…
addname Mar 10, 2021
11aa520
Fix
addname Mar 10, 2021
9ffde5d
Merge remote-tracking branch 'origin/issue#1916' into issue#1916
addname Mar 10, 2021
6ad79eb
Fix
addname Mar 10, 2021
24de0ca
Fix
addname Mar 10, 2021
3aac1a5
Merge branch 'main' of /~https://github.com/open-telemetry/opentelemetr…
addname Mar 10, 2021
b4eb7c3
Fix
addname Mar 10, 2021
58801ed
Fix
addname Mar 10, 2021
398246b
Fix
addname Mar 10, 2021
5b45a6a
Fix
addname Mar 10, 2021
f873db7
Fix
addname Mar 10, 2021
c0c4c9d
Merge branch 'main' of /~https://github.com/open-telemetry/opentelemetr…
addname Mar 10, 2021
28f30fc
Fix
addname Mar 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
import org.apache.rocketmq.client.hook.ConsumeMessageHook;
import org.apache.rocketmq.client.hook.SendMessageHook;

/** Entrypoint for tracing RocketMq producers or consumers. */
public final class RocketMqTracing {
addname marked this conversation as resolved.
Show resolved Hide resolved

/** Returns a new {@link RocketMqTracing} configured with the given {@link OpenTelemetry}. */
public static RocketMqTracing create(OpenTelemetry openTelemetry) {
return newBuilder(openTelemetry)
.setPropagationEnabled(
Expand All @@ -23,6 +26,7 @@ public static RocketMqTracing create(OpenTelemetry openTelemetry) {
.build();
}

/** Returns a new {@link RocketMqTracingBuilder} configured with the given {@link OpenTelemetry}. */
public static RocketMqTracingBuilder newBuilder(OpenTelemetry openTelemetry) {
return new RocketMqTracingBuilder(openTelemetry);
}
Expand All @@ -46,10 +50,18 @@ public static RocketMqTracingBuilder newBuilder(OpenTelemetry openTelemetry) {
new RocketMqProducerTracer(openTelemetry, captureExperimentalSpanAttributes);
}

/**
* Returns a new {@link ConsumeMessageHook} for use with methods like {@link
* org.apache.rocketmq.client.impl.consumer.DefaultMQPullConsumerImpl#registerConsumeMessageHook(ConsumeMessageHook)}.
*/
public ConsumeMessageHook newTracingConsumeMessageHook() {
return new TracingConsumeMessageHookImpl(rocketMqConsumerTracer);
}

/**
* Returns a new {@link SendMessageHook} for use with methods like {@link
* org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl#registerSendMessageHook(SendMessageHook)}.
*/
public SendMessageHook newTracingSendMessageHook() {
return new TracingSendMessageHookImpl(rocketMqProducerTracer, propagationEnabled);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

addname marked this conversation as resolved.
Show resolved Hide resolved
import io.opentelemetry.api.OpenTelemetry;

/** A builder of {@link RocketMqTracing}. */
public final class RocketMqTracingBuilder {

private final OpenTelemetry openTelemetry;
Expand All @@ -18,6 +19,11 @@ public final class RocketMqTracingBuilder {
this.openTelemetry = openTelemetry;
}

/**
* Sets whether experimental attributes should be set to spans. These attributes may be changed or
* removed in the future, so only enable this if you know you do not require attributes filled by
* this instrumentation to be stable across versions
*/
public RocketMqTracingBuilder setCaptureExperimentalSpanAttributes(
boolean captureExperimentalSpanAttributes) {
this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes;
Expand All @@ -29,6 +35,7 @@ public RocketMqTracingBuilder setPropagationEnabled(boolean propagationEnabled)
return this;
}

/** Returns a new {@link RocketMqTracing} with the settings of this {@link RocketMqTracingBuilder}. */
public RocketMqTracing build() {
return new RocketMqTracing(
openTelemetry, captureExperimentalSpanAttributes, propagationEnabled);
Expand Down