Skip to content

Conversation

@videnkz
Copy link
Contributor

@videnkz videnkz commented Apr 18, 2021

closes #1562

  • This is an enhancement of existing features, or a new feature in existing plugins
    • I have updated CHANGELOG.asciidoc
    • I have added tests that prove my fix is effective or that my feature works
@videnkz videnkz force-pushed the issue-1562-routing-key-rabbitmq branch from 96474a0 to 6479cbf Compare April 18, 2021 15:08
@ghost
Copy link

ghost commented Apr 18, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-13T08:39:55.856+0000

  • Duration: 64 min 54 sec

  • Commit: 167246c

Test stats 🧪

Test Results
Failed 0
Passed 2423
Skipped 19
Total 2442

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark test.

  • run compatibility tests : Run the JDK Compatibility test.

  • run integration tests : Run the APM-ITs.

@videnkz
Copy link
Contributor Author

videnkz commented May 3, 2021

hi @felixbarny , I noticed that with apm-server:7.12.1 version, routing_key not handled with server:

{ "metadata": { "service": { "name": "apm-amqp-receiver-service", "agent": { "name": "java", "ephemeral_id": "4fed92e3-c766-4867-b89f-1be6bda59533", "version": "1.23.1-SNAPSHOT.abc2c70" }, "language": { "name": "Java", "version": "11.0.10" }, "runtime": { "name": "Java", "version": "11.0.10" }, "version": null }, "process": { "pid": 22120, "ppid": 22104, "title": "C:\\Program Files\\jdk\\jdk-11.0.10\\bin\\java.exe" }, "system": { "architecture": "amd64", "hostname": "pc", "platform": "Windows 10" } } } { "metricset": { "timestamp": 1620031880969000, "samples": { "system.process.cpu.total.norm.pct": { "value": 0.0017389012841546039 }, "jvm.memory.heap.used": { "value": 184418376.0 }, "jvm.memory.non_heap.used": { "value": 71899992.0 }, "jvm.memory.heap.max": { "value": 4139778048.0 }, "jvm.gc.alloc": { "value": 33179640.0 }, "jvm.memory.non_heap.committed": { "value": 75808768.0 }, "system.cpu.total.norm.pct": { "value": 0.030081916889602156 }, "system.process.memory.size": { "value": 513421312.0 }, "jvm.memory.heap.committed": { "value": 312475648.0 }, "jvm.memory.non_heap.max": { "value": -1.0 }, "system.memory.actual.free": { "value": 3253686272.0 }, "system.memory.total": { "value": 16556687360.0 }, "jvm.thread.count": { "value": 50.0 } } } } { "metricset": { "timestamp": 1620031880969000, "tags": { "name": "G1 Eden Space" }, "samples": { "jvm.memory.heap.pool.committed": { "value": 146800640.0 }, "jvm.memory.heap.pool.max": { "value": -1.0 }, "jvm.memory.heap.pool.used": { "value": 126877696.0 } } } } { "metricset": { "timestamp": 1620031880969000, "tags": { "name": "G1 Old Generation" }, "samples": { "jvm.gc.time": { "value": 0.0 }, "jvm.gc.count": { "value": 0.0 } } } } { "metricset": { "timestamp": 1620031880969000, "tags": { "name": "G1 Young Generation" }, "samples": { "jvm.gc.time": { "value": 64.0 }, "jvm.gc.count": { "value": 8.0 } } } } { "metricset": { "timestamp": 1620031880969000, "tags": { "name": "G1 Survivor Space" }, "samples": { "jvm.memory.heap.pool.committed": { "value": 14680064.0 }, "jvm.memory.heap.pool.max": { "value": -1.0 }, "jvm.memory.heap.pool.used": { "value": 14680064.0 } } } } { "metricset": { "timestamp": 1620031880969000, "tags": { "name": "G1 Old Gen" }, "samples": { "jvm.memory.heap.pool.committed": { "value": 150994944.0 }, "jvm.memory.heap.pool.max": { "value": 4139778048.0 }, "jvm.memory.heap.pool.used": { "value": 42860616.0 } } } } { "transaction": { "timestamp": 1620031881908131, "name": "RabbitMQ RECEIVE from direct-routing-x", "id": "895a5f75a0348f5d", "trace_id": "80ec763873b68768948da0111ca4b8f3", "parent_id": "4f3e295ddc1a590b", "type": "messaging", "duration": 526.887, "outcome": "success", "context": { "service": { "framework": { "name": "Spring AMQP" }, "name": null }, "message": { "headers": { "elastic-apm-traceparent": "00-80ec763873b68768948da0111ca4b8f3-4f3e295ddc1a590b-01", "tracestate": "es=s:1.0", "traceparent": "00-80ec763873b68768948da0111ca4b8f3-4f3e295ddc1a590b-01" }, "queue": { "name": "direct-routing-x" }, "routing_key": "email" }, "tags": {} }, "span_count": { "dropped": 0, "started": 0 }, "sample_rate": 1.0, "sampled": true } } { "transaction": { "timestamp": 1620031881908131, "name": "RabbitMQ RECEIVE from direct-routing-x", "id": "57d9010686c69e8c", "trace_id": "80ec763873b68768948da0111ca4b8f3", "parent_id": "4f3e295ddc1a590b", "type": "messaging", "duration": 526.624, "outcome": "success", "context": { "service": { "framework": { "name": "Spring AMQP" }, "name": null }, "message": { "headers": { "elastic-apm-traceparent": "00-80ec763873b68768948da0111ca4b8f3-4f3e295ddc1a590b-01", "tracestate": "es=s:1.0", "traceparent": "00-80ec763873b68768948da0111ca4b8f3-4f3e295ddc1a590b-01" }, "queue": { "name": "direct-routing-x" }, "routing_key": "email" }, "tags": {} }, "span_count": { "dropped": 0, "started": 0 }, "sample_rate": 1.0, "sampled": true } } 
@eyalkoren
Copy link
Contributor

@SylvainJuge
Copy link
Member

FYI elastic/apm-server#5229 has been merged, thus this is not blocked anymore.

@videnkz
Copy link
Contributor Author

videnkz commented Sep 21, 2021

FYI elastic/apm-server#5229 has been merged, thus this is not blocked anymore.

Hi @SylvainJuge ,
Thanks, I have updated the PR
You wrote about the normalization of the value. Is it necessary to do something in this direction?

@eyalkoren
Copy link
Contributor

@kananindzya - @SylvainJuge and I just discussed that and at the moment we can't see an easy way to identify such temp/ephemeral routing keys, so we prefer not to deal with it, meaning - there is no requirement for normalizing it.

The RabbitMQ tests can just assert that the routing_key is set where is should be, but not necessarily assert for its value, unless it is a known one.

@videnkz
Copy link
Contributor Author

videnkz commented Sep 28, 2021

@kananindzya - @SylvainJuge and I just discussed that and at the moment we can't see an easy way to identify such temp/ephemeral routing keys, so we prefer not to deal with it, meaning - there is no requirement for normalizing it.

The RabbitMQ tests can just assert that the routing_key is set where is should be, but not necessarily assert for its value, unless it is a known one.

Hi @eyalkoren , @SylvainJuge
I started apm-server locally from the master branch with apm-integration-testing:

 ./scripts/compose.py versions Getting current version numbers for services... APM Server (image built: 2021-09-28 05:00:42 UTC): apm-server version 8.0.0 (amd64), libbeat 8.0.0 [79373ca7596844ad5b3b19b0f7b1465eca1ec4aa built 2021-09-28 04:43:36 +0000 UTC] Elasticsearch (image built: 2021-09-28 09:15:11 UTC): WARNING: A terminally deprecated method in java.lang.System has been called WARNING: System::setSecurityManager has been called by org.elasticsearch.bootstrap.Elasticsearch (file:/usr/share/elasticsearch/lib/elasticsearch-8.0.0-SNAPSHOT.jar) WARNING: Please consider reporting this to the maintainers of org.elasticsearch.bootstrap.Elasticsearch WARNING: System::setSecurityManager will be removed in a future release Version: 8.0.0-SNAPSHOT, Build: default/docker/717d83df30b63381b59a3b0368161c70069b384a/2021-09-28T04:36:33.529812448Z, JVM: 17 Kibana (image built: 2021-09-28 05:37:34 UTC): Version: 8.0.0-SNAPSHOT Branch: master Build SHA: de43a3b83d90d66744d9f71fbe4c742bed9df6af Build number: 46533 

In transaction details tab message.routing_key value is displayed correctly and this field removed from transaction mapping(elastic/apm-server#6224):
image
image

The same is true for span:
image
image

Copy link
Contributor

@eyalkoren eyalkoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, some small changes requested.

@videnkz videnkz requested a review from eyalkoren October 12, 2021 16:03
Copy link
Contributor

@eyalkoren eyalkoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! ❤️

@eyalkoren
Copy link
Contributor

/test

@eyalkoren
Copy link
Contributor

run elasticsearch-ci/docs

@eyalkoren eyalkoren merged commit 15c0cfc into elastic:master Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants