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

Add telemetry support #1345

Open
vaspop opened this issue Oct 30, 2021 · 11 comments
Open

Add telemetry support #1345

vaspop opened this issue Oct 30, 2021 · 11 comments

Comments

@vaspop
Copy link

vaspop commented Oct 30, 2021

Is your feature request related to a problem?

Not really a problem but a difficulty in primarly understanding performance behaviour but also lack of tracing ability of middleware.

Describe the solution you'd like

Hi, have there been any thoughts on adding some kind of telemetry support? If so are there any technical reasons for not wanting to add such support from your point of view? Do you see a future need for such a thing? If one would at some point try to add such a thing would it be taken into considerstion?

Additional context

@SebastianStehle
Copy link

I think it is a great idea but I would wait until events in Open Telemetry are stable. Should be this year.

@vaspop
Copy link
Author

vaspop commented Oct 30, 2021

I think it is a great idea but I would wait until events in Open Telemetry are stable. Should be this year.

Just curious, what do you mean by stable? What issues would hinder this and in what way? @SebastianStehle

@kevinchalet
Copy link
Member

If so are there any technical reasons for not wanting to add such support from your point of view?

Like most things, the reason is actually simpler: because you're the first one asking for it 😄
It's a good idea but I'm not super familiar with the new diagnostics/telemetry APIs introduced in recent .NET versions so it's not going to be a quick thing to implement.

@vaspop
Copy link
Author

vaspop commented Oct 31, 2021

If so are there any technical reasons for not wanting to add such support from your point of view?

Like most things, the reason is actually simpler: because you're the first one asking for it 😄

It's a good idea but I'm not super familiar with the new diagnostics/telemetry APIs introduced in recent .NET versions so it's not going to be a quick thing to implement.

Im learning as much as i can on those APIs so im not any expert by any means but i just mainly wanted to see whether or not it would be a waste of time to contribute something or atleast a naive prototype on this topic 🙂

But it sounds like its an not that farfetched idea then 👍

@SebastianStehle
Copy link

Just curious, what do you mean by stable? What issues would hinder this and in what way? @SebastianStehle

Open Telemetry has several components:

  • Tracing
  • Metrics / Events
  • Logs

Only tracing is ready, but when you go over the code it makes sense to introduce a few events as well. Therefore I would implement it in one step.

@vaspop
Copy link
Author

vaspop commented Oct 31, 2021

Just curious, what do you mean by stable? What issues would hinder this and in what way? @SebastianStehle

Open Telemetry has several components:

  • Tracing

  • Metrics / Events

  • Logs

Only tracing is ready, but when you go over the code it makes sense to introduce a few events as well. Therefore I would implement it in one step.

Thank you for the clarification. Sounds like a reasonsble approach 👍

@jbonnett92
Copy link

Honestly I would also like this, my traces are missing a couple of jumps showing for introspection...
image

@jmsvl
Copy link

jmsvl commented Feb 6, 2024

Any updates on the possibility of implementing opentelemetry traces and metrics?

@oguzhancagliyan
Copy link

Hi, any updates on implementing opentelemetry ?

@kevinchalet
Copy link
Member

No immediate plans (since no one offered to fund that). That said, there's a demand, so maybe in the future.

@JeffBarnard
Copy link

JeffBarnard commented Apr 27, 2024

It's already there, to a degree, .net8 introduces the aspnet System.Diagnostics.Metrics, so my company is currently using the opentelemetry.net sdk to export and observe our openiddict endpoint activity. If openiddict were to do anything natively, it would be to add custom meters/metrics to measure certain things that occur within the API itself. What's important to see?

The aspnet http requests themselves are already covered. e.g.

"MetricType": "Histogram",
      "Temporality": "Delta",
      "Name": "http.server.request.duration",
      "Description": "Duration of HTTP server requests.",
      "Unit": "s",
      "MeterName": "Microsoft.AspNetCore.Hosting",
      "MeterVersion": "",
      "MetricPoints": [
        {
          "StartTime": "2024-04-30T14:46:57.243366+00:00",
          "EndTime": "2024-04-30T14:47:27.291515+00:00",
          "Value": "Sum: 0.0790335 Count: 1 Min: 0.0790335 Max: 0.0790335 \r\n(-Infinity,0.005]:0\r\n(0.005,0.01]:0\r\n(0.01,0.025]:0\r\n(0.025,0.05]:0\r\n(0.05,0.075]:0\r\n(0.075,0.1]:1\r\n(0.1,0.25]:0\r\n(0.25,0.5]:0\r\n(0.5,0.75]:0\r\n(0.75,1]:0\r\n(1,2.5]:0\r\n(2.5,5]:0\r\n(5,7.5]:0\r\n(7.5,10]:0\r\n(10,+Infinity]:0\r\n",
          "Tags": [
            {
              "Key": "http.request.method",
              "Value": "GET"
            },
            {
              "Key": "http.response.status_code",
              "Value": 302
            },
            {
              "Key": "http.route",
              "Value": "Connect/Authorize"
            },           
            {
              "Key": "url.scheme",
              "Value": "https"
            }
          ]
        },
        ```

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

7 participants