-
Notifications
You must be signed in to change notification settings - Fork 780
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
[Exporter.PrometherusHttpListener] Restore ScrapeResponseCacheDuratio… #3694
Conversation
70a0675
to
cf1db61
Compare
Why do we need to restore it? |
cf1db61
to
2fcd36f
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3694 +/- ##
==========================================
- Coverage 87.80% 87.74% -0.07%
==========================================
Files 283 284 +1
Lines 10308 10314 +6
==========================================
- Hits 9051 9050 -1
- Misses 1257 1264 +7
|
@reyang, this option was available in the previous version (when both HttpListener and AspNetCore were in one package). I think that it is useful, to have a possibility to cache data to avoid to frequent calculation of needed data. |
25bd241
to
7263165
Compare
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusHttpListener.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it is useful, to have a possibility to cache data to avoid to frequent calculation of needed data.
I know it is useful, do we even want to encourage feature parity between HttpListener and ASP.NET Core binding? I would say no, I think we should push hard for ASP.NET Core binding for any production scenario, and limit HttpListener to only dev inner loop and testing, in a nutshell, I don't think feature parity is something we should be driving here.
4d12bce
to
87e95f9
Compare
@reyang, I understand your perspective, but in Auto Instrumentation we would like to have fully functional, production ready Prometherus exporter without referencing unnecessary, additional libraries. It is not always possible with AspNetCore based. Especially it is not possible for any .NET Framework which is still significant part of the usages. |
We should not limit ourselves to ASP.NET Core. There are many other types of .NET services that are NOT HTTP servers. Examples:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Good point, if the goal is to make the HttpListener production ready, we should have a design for authentication. If there is no authentication, it already means that the exporter is only going to serve a trusted environment, which makes caching less useful. |
You've got me convinced 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to understand the overall design/plan #3694 (comment)
73ea501
to
20ed647
Compare
20ed647
to
656853b
Compare
@reyang, I think that we should keep authentication out of scope of this PR. If you are fine with this, I can create issue/feature request to cover authorization and authentication process for Prometheus over HttpListener. In addition, we should give a possibility to bind over https and set up correct certificate. |
Do you have actual measurements which show why the caching behavior is important for auto-instrumentation? I wish to understand why it is important and how important it is. |
I agree that we should keep this PR scoped. However, I think we should not merge this PR until there is an authentication support. |
To mitigate "potential DoS". We want to have a possibility to "control" the performance. I think it is of the same importance as for the
Why so? How will authentication help without authorization? Personally, I feel that HTTPS support is more important to encrypt the traffic. Maybe self-signed HTTPS could be used by default. Still, I think that none of that is coupled with caching. |
@reyang ☝️ (I have forgotten to add a mention 😆 ) |
"Potential DoS" is already a production topic, which requires a combination of security/perf(caching), I don't think "just having a caching" would solve DoS - instead, it is giving people false assumption that it can be used in production while actually that's not the case. The analogy is installing airbags to a toy cart, if the intention is to make it secure, we should do proper design. |
I do not claim that it is production-ready, I just thought it is not "against" it 😉 But I understand that it makes more sense for you to first have a design in place to drive the implementation. |
I agree that HTTPS is important, I actually think that authentication/authorization makes less sense on plain HTTP (and that's why most websites moved to HTTPS). I think all these should be addressed in the HttpListener version of PrometheusExporter, before we can give signal that it is production ready. And this requires some design and overall thinking, which is exactly I'm asking #3694 (review). Without an overall design/thinking/plan, I don't feel we should merge this PR. |
Closing, |
Fixes also #3679
Changes
Restore
ScrapeResponseCacheDurationMilliseconds
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes[ ] Design discussion issue #[ ] Changes in public API reviewed