Skip to content

Add Dns event counters #48885

Open
Open

Description

@stephentoub

We should consider adding some event counters around name resolution, e.g.

  • Number of Dns requests issued
  • Number of Dns requests currently in fight
  • Number of unique Dns requests currently in flight

Activity

  1. added this to the 6.0.0 milestone on Feb 28, 2021
  2. ghost added
    untriaged
    on Feb 28, 2021
  3. changed the title [-]Dns event counters[/-] [+]Add Dns event counters[/+] on Feb 28, 2021
  4. MihaZupan commented on Mar 1, 2021

    @MihaZupan
    Member

    Right now we have

    • dns-lookups-requested - DNS Lookups Requested (total counter)
    • dns-lookups-duration - Average DNS Lookup Duration

    Number of Dns requests currently in fight

    Something like current-dns-lookups seems reasonable - we have that for Net.Security and Net.Http as well.

    With #48566 in mind, the meaning of this would likely be "number of not-finished Dns.Foo(...) calls".

    Number of unique Dns requests currently in flight

    I assume the tracking of "unique" would be duplicated between the Telemetry impl and a potential #48566 impl?

  5. stephentoub commented on Mar 1, 2021

    @stephentoub
    MemberAuthor

    dns-lookups-requested

    Ah, I didn't see that one. That's the "Number of Dns requests issued" I was asking for.

    Something like current-dns-lookups seems reasonable ... the meaning of this would likely be "number of not-finished Dns.Foo(...) calls"

    Yes, if we're already tracking number of requests initiated, then if we also tracked number of requests finished, it would be the difference.

    I assume the tracking of "unique" would be duplicated between the Telemetry impl and a potential #48566 impl?

    There might be some duplication, but whatever we do for #48566 is likely to only apply to a portion of requests, e.g. those that are implemented by queueing work items to the thread pool. On Windows most if not all requests will instead be implemented with async OS functionality, and we wouldn't do any such uniqueness tracking for the implementation. Longer term, we'd expect that to be true for all OSes.

  6. ManickaP commented on Mar 4, 2021

    @ManickaP
    Member

    Triage: shouldn't be hard to implement, the numbers might be useful. We would want current-dns-lookups for 6.0.

  7. removed
    untriaged
    on Mar 4, 2021
  8. added
    enhancement
    on May 4, 2021
  9. modified the milestones: 6.0.0, Future on May 6, 2021
  10. MihaZupan commented on Jul 21, 2021

    @MihaZupan
    Member

    Currently implemented:

    • Start/Failed/Stop events
      • Failed could use some additional info such as the exception message - right now it's just an empty event
    • dns-lookups-requested (total for process)
    • current-dns-lookups (current)
    • dns-lookups-duration (average time taken for lookups within the last counter period)

    Not yet added:

    • Number of unique DNS requests currently in flight

    Potential:

  11. karelz commented on Jul 21, 2021

    @karelz
    Member

    Taking the discussion from #56072 (comment) here:

    How many unique DNS addresses are resolved in an application’s lifetime?

    What is a developer going to do with this information? Doing this "perfectly" would be a leak, as it would require the application to maintain a set of every address it saw; that's not viable (it'd be like Kestrel having a counter for how many unique client addresses connected to it over the process' lifetime). Events are already emitted for that information, so a dev can post-process that information from traces if needed. #48885 (this issue) proposes one for the number of unique addresses currently being resolved; from my perspective, that's more reasonable, though I'm not sure how actionable it actually is, either.

    We should answer:

    1. Do we want current vs. app-lifetime counter?
    2. How is it useful to end users?
    3. Is it important for 6.0?

    @davidfowl can you respond here please to @stephentoub's comment above?

    Moving the issue to 6.0 to make decision what to do in 6.0.

  12. removed this from the Future milestone on Jul 21, 2021
  13. 5 remaining items

  14. modified the milestones: 6.0.0, 7.0.0 on Jul 26, 2021
  15. removed their assignment
    on Jul 26, 2021
  16. danmoseley commented on Aug 4, 2021

    @danmoseley
    Contributor

    @davidfowl can you ack or push back here to help us make the right call?

  17. davidfowl commented on Aug 5, 2021

    @davidfowl
    Member

    Is there any low hanging fruit here we could tackle for .NET 6? I think the unique dns requests are difficult and we can punt for now, but it would be ideal to add some of the other counters.

  18. MihaZupan commented on Jul 18, 2022

    @MihaZupan
    Member

    The "Number of unique DNS requests currently in flight" counter doesn't seem critical for 7.0. Moving to future.

    but it would be ideal to add some of the other counters

    @davidfowl did you have any other counters in mind (aside from those mentioned in #48885 (comment))?

  19. modified the milestones: 7.0.0, Future on Jul 18, 2022
  20. davidfowl commented on Jul 9, 2023

    @davidfowl
    Member

    This is something I would like to get done for .NET 8 now that we're moving to metrics. Specifically, a Meter in System.Net that reports the number of DNS resolutions with a host name dimension.

  21. antonfirsov commented on Jul 11, 2023

    @antonfirsov
    Contributor

    @davidfowl is DNS the only area you find critical in .NET 8 to define Metrics for, or is there anything from #88383 and #88384 you want us to get done?

  22. davidfowl commented on Jul 11, 2023

    @davidfowl
    Member

    HTTP counters: #88384 and DNS counters are the most important. The socket and TLS ones I think can wait. Specifically, the counters you cannot write yourselves are the most important for us to add (the connection pooling data that exists inside of SocketHttpHandler's guts).

  23. antonfirsov commented on Jul 12, 2023

    @antonfirsov
    Contributor

    That should be all covered by #84978, #88384 is mostly about extras.

  24. davidfowl commented on Jul 12, 2023

    @davidfowl
    Member

    Perfect, then I think the DNS one is the next most important one to add that isn't currently tracked for .NET 8.

  25. self-assigned this
    on Jul 12, 2023
  26. removed their assignment
    on Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Netenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions