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

Follow-Up Issues for Resource Detection in .NET #1835

Closed
1 of 2 tasks
svrnm opened this issue Oct 10, 2022 · 5 comments
Closed
1 of 2 tasks

Follow-Up Issues for Resource Detection in .NET #1835

svrnm opened this issue Oct 10, 2022 · 5 comments
Assignees

Comments

@svrnm
Copy link
Member

svrnm commented Oct 10, 2022

@cartermp cartermp self-assigned this Oct 10, 2022
@cartermp
Copy link
Contributor

Assigning myself here. The package does work, I just need to fit it in correctly with a good code sample.

@cartermp
Copy link
Contributor

Blegh. Unfortunately stumped because it's to do with environments and there's wonky behavior:

  • service.instance.id always shows up even though it's not in env
  • The package doesn't appear to actually work, as there is no container ID listed when the container is run

Will need to investigate but I'll add the servicename stuff for now.

@cartermp
Copy link
Contributor

@svrnm
Copy link
Member Author

svrnm commented Oct 11, 2022

  • The package doesn't appear to actually work, as there is no container ID listed when the container is run

It's a corner case, but the package does not work if cgroupv2 is used, there's a work around, so far only implemented by JS. So, by any chance, can you run the container again and check if /proc/self/cgroup gives you something?

@svrnm
Copy link
Member Author

svrnm commented Oct 11, 2022

Wanting to play around with dotnet anways, I just gave it a try:

I get some container.id (I use colima with docker engine)

$ docker run --rm -t -i dotnetty
Activity.TraceId:          a289ca5f184994a23f19aeec477e2882
Activity.SpanId:           9b0a995ef440242f
Activity.TraceFlags:           Recorded
Activity.ActivitySourceName: MyCompany.MyProduct.MyService
Activity.DisplayName: SayHello
Activity.Kind:        Internal
Activity.StartTime:   2022-10-11T09:17:59.6471556Z
Activity.Duration:    00:00:00.0003996
Activity.Tags:
    foo: 1
    bar: Hello, World!
    baz: [1,2,3]
Resource associated with Activity:
    container.id: b1e2f740d45828051ae474b34074c152c7a98409bfbdaf6f3c9781edc2e457c7
    service.name: MyCompany.MyProduct.MyService
    service.version: 1.0.0
    service.instance.id: 7c9de23c-7e67-433a-b25e-132d685a7c8f

When I overwrite the entrypoint with cat /proc/self/cgroup I see the following

❯ docker run --rm -t -i dotnetty cat /proc/self/cgroup
13:pids:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
12:hugetlb:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
11:net_prio:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
10:perf_event:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
9:net_cls:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
8:freezer:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
7:devices:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
6:memory:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
5:blkio:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
4:cpuacct:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
3:cpu:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
2:cpuset:/docker/9c742a2055836b7c0cc9583f062a9fccd9950f3fc22784dbbd1372f8f3738a72
1:name=openrc:/docker
0::/docker

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

No branches or pull requests

3 participants