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

CAP trace broken when using latest skyapm-dotnet code #573

Closed
1 of 4 tasks
witskeeper opened this issue Jan 9, 2024 · 6 comments
Closed
1 of 4 tasks

CAP trace broken when using latest skyapm-dotnet code #573

witskeeper opened this issue Jan 9, 2024 · 6 comments
Assignees
Milestone

Comments

@witskeeper
Copy link
Collaborator

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • Question or discussion
  • Bug
  • Requirement
  • Feature or performance improvement

Question

  • What do you want to know?

Bug

  • Which version of SkyWalking, OS and .NET Runtime?

Mac OS running SkyWalking 9.0.0 in Docker:

# 安装oap
docker run --name oap -p 11800:11800 -p 12800:12800 --restart always -d apache/skywalking-oap-server:9.0.0

# 安装oap-ui
export version=9.0.0
docker run --name oap-ui -p 8080:8080 -d --link oap -e SW_OAP_ADDRESS=http://oap:12800  apache/skywalking-ui:$version
  • Which company or project?

  • What happen?
    If possible, provide a way for reproducing the error. e.g. demo application, component version.

using skyapm-donet latest code from main branch.

demo code : https://github.com/netcorepal/netcorepal-cloud-framework/tree/main/test/NetCorePal.Web
 
image


Requirement or improvement

  • Please describe about your requirements or improvement suggestions.
@wu-sheng
Copy link
Member

wu-sheng commented Jan 9, 2024

Ping @snakorse if you are still watching this repository.

@witskeeper
Copy link
Collaborator Author

more info :
the BeforePublish do not show in trace

@witskeeper
Copy link
Collaborator Author

@yang-xiaodong Can you help us check this issue?

@witskeeper witskeeper mentioned this issue Jan 16, 2024
3 tasks
@witskeeper
Copy link
Collaborator Author

fixed in #575

@wu-sheng wu-sheng added this to the 2.2.0 milestone Jan 16, 2024
@yang-xiaodong
Copy link
Member

@witskeeper

BeforePublish is propagated based on the EntrySegmentContext created in BeforePublishStore. I saw that you judged _entrySegmentContextAccessor.Context == null in BeforePublish and created the EntrySegmentContext again. In fact, the Context here should not be null.

Have you configured SkyApm.Diagnostics.AspNetCore?

@witskeeper
Copy link
Collaborator Author

configure code like :

builder.Services.AddSkyAPM(ext => ext.AddAspNetCoreHosting().AddCap());

pulish code like:

 [HttpGet]
[Route("/sendEvent")]
public async Task SendEvent(OrderId id,[FromServices]ICarrierPropagator _carrierPropagator)
{
    await capPublisher.PublishAsync("OrderPaidIntegrationEvent", new OrderPaidIntegrationEvent(id), cancellationToken: HttpContext.RequestAborted);
}

BeforePublish dose not run under the async context in witch code calling PublishAsync,
it runs after the api function SendEvent return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants