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
Opentelemetry Redis Instrumentation #39489
Conversation
/cc @brunobat (opentelemetry), @radcortez (opentelemetry) |
70b32d8
to
3c7c7be
Compare
@brunobat used only the Some like: ...
private static final Pattern COLON_PATTERN = Pattern.compile(":");
private static final String SERVER_ADDRESS_KEY = "server.address";
private static final String SERVER_PORT_KEY = "server.port";
private static final Logger LOGGER = Logger.getLogger(CommandTrace.class);
CommandTrace(final Map<String, String> attributes) {
this.attributes = attributes;
String peerAddress = peerAddress();
if (peerAddress != null) {
try {
String[] addressAndPort = COLON_PATTERN.split(peerAddress);
this.attributes.put(SERVER_ADDRESS_KEY, addressAndPort[0]);
if (addressAndPort.length > 1) {
this.attributes.put(SERVER_PORT_KEY, addressAndPort[1]);
}
} catch (Exception e) {
LOGGER.debugf(e, "Failed to parse peerAddress %s", peerAddress);
}
}
}
... Also I've set the db name... which is kinda of right since the command reporter returns which DB is being used in the operation, just that in Redis they are numbers.... so the span name will be |
This comment has been minimized.
This comment has been minimized.
3c7c7be
to
d3bd2d4
Compare
Another thing that I noted is that the |
This comment has been minimized.
This comment has been minimized.
d3bd2d4
to
2608e31
Compare
This comment has been minimized.
This comment has been minimized.
2608e31
to
2f250e7
Compare
This comment has been minimized.
This comment has been minimized.
2f250e7
to
937c0a8
Compare
This comment has been minimized.
This comment has been minimized.
Hey @brunobat were you able to take a look at this? |
937c0a8
to
3c5b6a0
Compare
This comment has been minimized.
This comment has been minimized.
3c5b6a0
to
24958f4
Compare
I've removed the db hash index from the span name and added it to an attribute... seems better =] so the span name will be only |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @luneo7
Tried to run the tests but I got this error:
... no DOCKER_HOST environment variable ...
This shouldn't be needed.
I see that you started from the setup available for the redis-client
IT. Please give it a shot with a more recent setup like the one in redis-devservices
.
We will also need the documentation update.
...emetry-redis-instrumentation/src/test/java/io/quarkus/it/opentelemetry/QuarkusRedisTest.java
Outdated
Show resolved
Hide resolved
...emetry-redis-instrumentation/src/test/java/io/quarkus/it/opentelemetry/QuarkusRedisTest.java
Outdated
Show resolved
Hide resolved
...emetry-redis-instrumentation/src/test/java/io/quarkus/it/opentelemetry/QuarkusRedisTest.java
Outdated
Show resolved
Hide resolved
...s/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java
Outdated
Show resolved
Hide resolved
...s/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java
Show resolved
Hide resolved
...s/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java
Show resolved
Hide resolved
Thanks @luneo7 for the initiative. |
24958f4
to
ff9e422
Compare
...telemetry-redis-instrumentation/src/main/java/io/quarkus/io/opentelemetry/RedisResource.java
Show resolved
Hide resolved
ff9e422
to
227eee4
Compare
This comment has been minimized.
This comment has been minimized.
227eee4
to
662ccd1
Compare
@Ladicek would you like to see something else in the spans for redis? |
This comment has been minimized.
This comment has been minimized.
I don't feel qualified to review the code, but the set of attributes seems reasonable, given what we expose on the Vert.x Redis client side. I can add more there, just let me know, but I tried to copy what the Vert.x SQL client exposes. |
Thanks @Ladicek, please don't feel pressured to review all the code. What I had in mind was exactly what you mentioned... Reviewing the tracked attributes to make sure we have the best set to show the users. |
662ccd1
to
a5ebf6d
Compare
@brunobat any new thoughts on this? |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luneo7 Can you please add the client instrumentation the documentation list in here:
https://github.com/quarkusio/quarkus/blob/f76d812036f1e2ce3ca12d0bb5465e09bfa28212/docs/src/main/asciidoc/opentelemetry.adoc#L635-L634
I wonder if you have any project using Redis where you can try this out?
...s/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java
Show resolved
Hide resolved
...s/opentelemetry/runtime/tracing/intrumentation/vertx/RedisClientInstrumenterVertxTracer.java
Show resolved
Hide resolved
Could you also please add a ON/OFF test for the feature, similar to this one? Line 38 in 42ffdef
|
a5ebf6d
to
fba2b87
Compare
@brunobat I've created the issue vert-x3/vertx-redis-client#441 , added the test and updated the docs. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
fba2b87
to
ac10bc4
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@brunobat any other request? |
ac10bc4
to
7e14b56
Compare
Status for workflow
|
Status for workflow
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much @luneo7
It looks good to me.
🙈 The PR is closed and the preview is expired. |
Adds Opentelemetry Redis Instrumentation, fixes #39011
Examples of how spans will be created: