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

Seeing HTTP POST as first span instead of the actual method being called #13373

Open
zubaiersayed opened this issue Feb 21, 2025 · 2 comments
Open
Labels
needs author feedback Waiting for additional feedback from the author

Comments

@zubaiersayed
Copy link

zubaiersayed commented Feb 21, 2025

Describe the bug

When a request is made to an endpoint the first span is {GET/POST/PUT ETC} instead of the actual method being being called by the endoint.

For example when I make a request to /report I expect the first span to be ReportController.generateReport, and not HTTP POST. I use @WithSpan annotations on my endpoint methods.

I using Micronaut with Netty, and run the opentelemetry agent like this:

exec su-exec "$USER:$GROUP" "$JAVA_HOME/bin/java" \
      -javaagent:/home/appuser/opentelemetry-javaagent.jar \
      -Dotel.exporter.otlp.endpoint="$APM_SERVER_URL" \
      -Dotel.exporter.otlp.headers="Authorization=Bearer $APM_SECRET_TOKEN" \
      -Dotel.resource.attributes="service.name=$APM_SERVICE_NAME,deployment.environment=$APM_ENVIRONMENT" \
      -Dotel.instrumentation.kotlinx-coroutines.enabled=true \
      -Dmicronaut.environments=ec2,cloud \
      -Dlogback.configurationFile=logback-cloud.xml \
      -XX:MaxRAMPercentage=80 \
      -jar "$APP_JAR"

Example in the picture below.

Image

Steps to reproduce

Example above.

Expected behavior

Expect the first span to be the actual method running inside the application.

Actual behavior

I see POST, GET etc as the first span

Javaagent or library instrumentation version

2.13.1

Environment

JDK:
OS:

Additional context

No response

@zubaiersayed zubaiersayed added bug Something isn't working needs triage New issue that requires triage labels Feb 21, 2025
@zubaiersayed
Copy link
Author

@trask any insight?

@trask
Copy link
Member

trask commented Feb 22, 2025

we don't have any Micronaut instrumentation that sets the http.route (and nice span name)

you could try https://micronaut-projects.github.io/micronaut-tracing/latest/guide/#opentelemetry

@jaydeluca jaydeluca added needs author feedback Waiting for additional feedback from the author and removed bug Something isn't working needs triage New issue that requires triage labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs author feedback Waiting for additional feedback from the author
Projects
None yet
Development

No branches or pull requests

3 participants