-
Notifications
You must be signed in to change notification settings - Fork 860
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
gRPC support request/response size #11833
Open
crossoverJie
wants to merge
28
commits into
open-telemetry:main
Choose a base branch
from
crossoverJie:grpc-req-res-size
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
425c17f
grpc support request/response size
crossoverJie 29259dc
fix ci
crossoverJie 06aa680
fix ci
crossoverJie 7960777
fix ci
crossoverJie e8948d8
fix test
crossoverJie 7954240
fix ci
crossoverJie ef9b84e
fix muzzle
crossoverJie d063d33
fix muzzle
crossoverJie 30f7c9c
fix muzzle
crossoverJie 9dff355
fix ci
crossoverJie 7fe3980
Merge remote-tracking branch 'otel-origin/main' into grpc-req-res-size
crossoverJie 5c455e8
fix ci
crossoverJie 5c7f329
fix ci
crossoverJie 1b3ff26
fix ci
crossoverJie 38fc1c3
fix ci
crossoverJie 330f9f3
fix ci
crossoverJie 0dd479b
Merge remote-tracking branch 'otel-origin/main' into grpc-req-res-size
crossoverJie 4bf7656
fix ci
crossoverJie 9d0f339
revert ci
crossoverJie a3251af
revert ci
crossoverJie 3f8c53c
fix muzzle
crossoverJie 5048258
fix muzzle
crossoverJie 59adfd6
fix muzzle
crossoverJie 409a8d4
fix muzzle
crossoverJie 5084309
use static import asList
crossoverJie 6676d78
fix with cr
crossoverJie 4f69c46
Merge remote-tracking branch 'otel-origin/main' into grpc-req-res-size
crossoverJie 360f658
remove client&server prefix.
crossoverJie 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
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
36 changes: 36 additions & 0 deletions
36
...va/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcMessageBodySizeUtil.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,36 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.api.incubator.semconv.rpc; | ||
|
||
import io.opentelemetry.api.common.AttributeKey; | ||
import io.opentelemetry.api.common.Attributes; | ||
import javax.annotation.Nullable; | ||
|
||
final class RpcMessageBodySizeUtil { | ||
|
||
@Nullable | ||
static Long getRpcRequestBodySize(Attributes... attributesList) { | ||
return getAttribute(RpcCommonAttributesExtractor.RPC_REQUEST_BODY_SIZE, attributesList); | ||
} | ||
|
||
@Nullable | ||
static Long getRpcResponseBodySize(Attributes... attributesList) { | ||
return getAttribute(RpcCommonAttributesExtractor.RPC_RESPONSE_BODY_SIZE, attributesList); | ||
} | ||
|
||
@Nullable | ||
private static <T> T getAttribute(AttributeKey<T> key, Attributes... attributesList) { | ||
for (Attributes attributes : attributesList) { | ||
T value = attributes.get(key); | ||
if (value != null) { | ||
return value; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
private RpcMessageBodySizeUtil() {} | ||
} |
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
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
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.
as you are always going to use the same set of attributes you could make all these delegate to a common method or extract the attributes list to a variable
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.
Done.