-
Notifications
You must be signed in to change notification settings - Fork 172
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 new IPC tags #1168
Merged
Merged
Add new IPC tags #1168
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5c7eaaf
Add new IPC tags from IPC Metrics v2 spec
umairk79 bd80ed6
Merge branch 'main' into ayangster/new-ipc-tags
477741c
Add new api metrics values
ba568f4
Add test
d0ee1b0
Remove not found
f2f2f62
Remove extraneous new line
7f434dc
Formatting
1fdadb3
Add API metrics enums
38fbaf7
Formatting
a665f79
Remove inflight metrics
b59978a
Merge branch 'main' into ayangster/new-ipc-tags
2b19bf1
Merge branch 'main' into ayangster/new-ipc-tags
20bdcf0
formatting and some minor updates
brharrington File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
spectator-ext-ipc/src/main/java/com/netflix/spectator/ipc/IpcMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
* Copyright 2024 Netflix, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.netflix.spectator.ipc; | ||
|
||
import com.netflix.spectator.api.Tag; | ||
|
||
public enum IpcMethod implements Tag { | ||
|
||
/** | ||
* Represents a unary gRPC method. | ||
*/ | ||
unary, | ||
|
||
/** | ||
* Represents a client streaming gRPC method. | ||
*/ | ||
client_streaming, | ||
|
||
/** | ||
* Represents a server streaming gRPC method. | ||
*/ | ||
server_streaming, | ||
|
||
/** | ||
* Represents a bidirectional streaming gRPC method. | ||
*/ | ||
bidi_streaming, | ||
|
||
/** | ||
* Represents an HTTP GET request. | ||
*/ | ||
get, | ||
|
||
/** | ||
* Represents an HTTP POST request. | ||
*/ | ||
post, | ||
|
||
/** | ||
* Represents an HTTP PUT request. | ||
*/ | ||
put, | ||
|
||
/** | ||
* Represents an HTTP PATCH request. | ||
*/ | ||
patch, | ||
|
||
/** | ||
* Represents an HTTP DELETE request. | ||
*/ | ||
delete, | ||
|
||
/** | ||
* Represents an HTTP OPTIONS request. | ||
*/ | ||
options, | ||
|
||
/** | ||
* Represents a GraphQL query. | ||
*/ | ||
query, | ||
|
||
/** | ||
* Represents a GraphQL mutation. | ||
*/ | ||
mutation, | ||
|
||
/** | ||
* Represents a GraphQL subscription. | ||
*/ | ||
subscription, | ||
|
||
/** | ||
* Represents a method that is not supported. | ||
*/ | ||
unknown; | ||
|
||
@Override public String key() { | ||
return IpcTagKey.method.key(); | ||
} | ||
|
||
@Override public String value() { | ||
return name(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
spectator-ext-ipc/src/main/java/com/netflix/spectator/ipc/IpcSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* Copyright 2024 Netflix, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.netflix.spectator.ipc; | ||
|
||
import com.netflix.spectator.api.Tag; | ||
|
||
public enum IpcSource implements Tag { | ||
|
||
/** | ||
* No call was made due to errors potentially. | ||
*/ | ||
none, | ||
|
||
/** | ||
* Data sourced directly from EVCache as the cache implementation (when the exact cache is known). | ||
*/ | ||
evcache, | ||
|
||
/** | ||
* Data sourced from a cache where the cache implementation is not directly known or abstracted. | ||
*/ | ||
cache, | ||
|
||
/** | ||
* Static fallback was used to fetch the data. | ||
*/ | ||
fallback, | ||
|
||
/** | ||
* Response fetched using mesh. | ||
*/ | ||
mesh, | ||
|
||
/** | ||
* Response fetched directly from the downstream service (or if not known to be mesh). | ||
*/ | ||
direct, | ||
|
||
/** | ||
* Data sourced from a validation handler that may short-circuit the response immediately for failed validation. | ||
*/ | ||
validation, | ||
|
||
/** | ||
* Data sourced and returned directly by a filter or interceptor. | ||
*/ | ||
filter, | ||
|
||
/** | ||
* Data fetched from an in-memory cache. | ||
*/ | ||
memory, | ||
|
||
/** | ||
* Data sourced from a user defined business logic handler or root data fetcher. | ||
*/ | ||
application; | ||
|
||
@Override | ||
public String key() { | ||
return IpcTagKey.source.key(); | ||
} | ||
|
||
@Override | ||
public String value() { | ||
return name(); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Source and method should also get updated in
reset()
and perhapspopulateMDC()
so it will be available for logs.