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

lambda traces and application traces (mongo, s3) not grouped #1278

Open
jeusdi opened this issue Apr 27, 2024 · 0 comments
Open

lambda traces and application traces (mongo, s3) not grouped #1278

jeusdi opened this issue Apr 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jeusdi
Copy link

jeusdi commented Apr 27, 2024

Describe the bug
I've configured opentelemetry on my aws lambdas using opentelemetry provided layers.

I mean, I'm using javaagent + collector layer attached to my lambdas, following this agent layer documentation and this collector layer documentation](https://opentelemetry.io/docs/faas/lambda-collector/).

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:

  • lambda context executation traces
  • S3 access traces
  • mongodb access traces

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

I'm using spring cloud function. Here my dependencies:

<properties>
  <aws-lambda-events.version>3.11.4</aws-lambda-events.version>
  <aws-lambda-java-core.version>1.2.3</aws-lambda-java-core.version>
  <aws-lambda-java-serialization.version>1.1.5</aws-lambda-java-serialization.version>
</properties>

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-function-adapter-aws</artifactId>
</dependency>
<dependency>
	<groupId>com.amazonaws</groupId>
	<artifactId>aws-lambda-java-events</artifactId>
	<version>${aws-lambda-events.version}</version>
</dependency>
<dependency>
	<groupId>com.amazonaws</groupId>
	<artifactId>aws-lambda-java-core</artifactId>
	<version>${aws-lambda-java-core.version}</version>
        <scope>provided</scope>
</dependency>
<dependency>
	<groupId>com.amazonaws</groupId>
	<artifactId>aws-lambda-java-serialization</artifactId>
	<version>${aws-lambda-java-serialization.version}</version>
</dependency>

Any ideas?

What did you expect to see?
Traces with hierarchy

What version of collector/language SDK version did you use?
layer verions:

  • arn:aws:lambda:eu-west-1:901920570463:layer:aws-otel-collector-amd64-ver-0-90-1:1
  • arn:aws:lambda:eu-west-1:184161586896:layer:opentelemetry-javaagent-0_5_0:1

What language layer did you use?
Java

@jeusdi jeusdi added the bug Something isn't working label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant