aws-observability / aws-otel-collector

AWS Distro for OpenTelemetry Collector (see ADOT Roadmap at https://github.com/orgs/aws-observability/projects/4)
https://aws-otel.github.io/
Other
547 stars 234 forks source link

OpenTelemetry X-Ray: Traces without hierarchy #2719

Open jeusdi opened 2 months ago

jeusdi commented 2 months ago

I've configured opentelemetry on my lambdas using ADOT OpenTelemetry AWS distribution.

I mean, I'm using javaagent + collector layer attached to my lambdas, following this documentation.

That means that I'm using openTelemetry agent + collector and I'm autoinstrumention my code using agent.

After that, my traces are generated, but not aligned on X-Ray console.

I mean, opentelemetry agent is instrumenting my mongo and S3 access. Lambda traces are also generated.

So, I'm getting traces for:

However, traces appear not related between them:

enter image description here

I don't quite figure out how to create relation between them in order to putt all it together.

I've took a look on logs. Following traces are generated:

[otel.javaagent 2024-04-24 07:59:05:633 +0000] [main] INFO io.opentelemetry.exporter.logging.LoggingSpanExporter - 'update espaidoc.document' : 6628bbc902c4d22192672fe5958a00cd eb8b0f340609ba59 CLIENT [tracer: io.opentelemetry.mongo-3.1:1.32.0-adot-lambda1-alpha] AttributesMap{data={db.operation=update, db.mongodb.collection=document, db.name=espaidoc, thread.id=1, thread.name=main, db.connection_string=mongodb://pe-0-endurance-mongodb-dev-cluster.r6c5pur.mongodb.net:27017, net.peer.name=pe-0-endurance-mongodb-dev-cluster.r6c5pur.mongodb.net, db.system=mongodb, net.peer.port=27017, db.statement={\"update\": \"document\", \"ordered\": \"?\", \"writeConcern\": {\"w\": \"?\"}, \"txnNumber\": \"?\", \"$db\": \"?\", \"$clusterTime\": {\"clusterTime\": \"?\", \"signature\": {\"hash\": \"?\", \"keyId\": \"?\"}}, \"lsid\": {\"id\": \"?\"}, \"updates\": [{\"q\": {\"_id\": \"?\"}, \"u\": {\"_id\": \"?\", \"logicId\": \"?\", \"location\": {\"location\": \"?\", \"type\": \"?\"}, \"status\": {\"state\": \"?\"}, \"md5Checksum\": \"?\", \"_class\": \"?\"}, \"upsert\": \"?\"}]}}, capacity=128, totalAddedValues=10}
[otel.javaagent 2024-04-24 07:59:05:620 +0000] [main] INFO io.opentelemetry.exporter.logging.LoggingSpanExporter - 'S3.HeadObject' : 6628bbc95db57510853694261956a4d1 4c10b44d043a4612 CLIENT [tracer: io.opentelemetry.aws-sdk-2.2:1.32.0-adot-lambda1-alpha] AttributesMap{data={aws.agent=java-aws-sdk, http.method=HEAD, aws.requestId=1Y3J5K61D9ZHSV5X, net.peer.name=s3.eu-west-1.amazonaws.com, rpc.method=HeadObject, net.peer.port=443, http.url=https://s3.eu-west-1.amazonaws.com/espaidoc-des/frontoffice-apigateway-0.0.1-SNAPSHOT-aws.jar, rpc.system=aws-api, thread.id=1, thread.name=main, http.status_code=200, aws.bucket.name=espaidoc-des, http.response_content_length=50984457, rpc.service=S3}, capacity=128, totalAddedValues=14}
XRAY TraceId: 1-6628bbc9-0439f53a54534f10181c6da0\tSegmentId: 0111f4aa09e348cc\tSampled: true

Any ideas?

github-actions[bot] commented 1 week ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.