-
Notifications
You must be signed in to change notification settings - Fork 1.8k
MemoryLimiter extension as an http/grpc middleware #14071
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
base: main
Are you sure you want to change the base?
Changes from 14 commits
f7888f5
e5b68cf
ec69243
7fa2759
ca98260
e064592
8e590f4
43f9638
fb0bbf5
af89816
d5c9f25
fbddc93
db5222c
096b345
c6b0b9b
52693d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: enhancement | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
| component: extension/memory_limiter | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: The memorylimiter extension can be used as an HTTP/GRPC middleware. | ||
|
|
||
| # One or more tracking issues or pull requests related to the change | ||
| issues: [14081] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: | ||
|
|
||
| # Optional: The change log or logs in which this entry should be included. | ||
| # e.g. '[user]' or '[user, api]' | ||
| # Include 'user' if the change is relevant to end users. | ||
| # Include 'api' if there is a change to a library API. | ||
| # Default: '[user]' | ||
| change_logs: [user] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| "go.uber.org/zap" | ||
|
|
||
| "go.opentelemetry.io/collector/component/componenttest" | ||
| "go.opentelemetry.io/collector/extension/extensionmiddleware" | ||
| "go.opentelemetry.io/collector/internal/memorylimiter" | ||
| "go.opentelemetry.io/collector/internal/memorylimiter/iruntime" | ||
| ) | ||
|
|
@@ -95,3 +96,8 @@ | |
| }) | ||
| } | ||
| } | ||
|
|
||
| func TestMiddleware(t *testing.T) { | ||
|
Check failure on line 100 in extension/memorylimiterextension/memorylimiter_test.go
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of having a test for this, could we use the type checker to assert interface implementation? You could put the following above line 19 in var _ extensionmiddleware.GRPCServer = (*memoryLimiterExtension)(nil)
var _ extensionmiddleware.HTTPServer = (*memoryLimiterExtension)(nil) |
||
| var _ extensionmiddleware.HTTPServer = &memoryLimiterExtension{} | ||
| var _ extensionmiddleware.GRPCServer = &memoryLimiterExtension{} | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.