-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NetClientAttributesAdapter - favor composition over inheritance (open…
…-telemetry#5030) * first pass at separating NetAttributesAdapter interface and make NetClientAttributesExtractor concrete * rename the implementations extractor -> adapter * hide constructor and make factory method * rename to client and add javadoc * spotless * finish javadoc thought * rebase * renamed NetClientAttributesAdapter to NetClientAttributesGetter * fix lettuce * code review comments * code review comments -- renaming for consistency * adapter -> getter * fix ratpack * adapter -> getter
- Loading branch information
1 parent
bcafbcb
commit a25a459
Showing
106 changed files
with
468 additions
and
334 deletions.
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
31 changes: 31 additions & 0 deletions
31
...java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesGetter.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,31 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.api.instrumenter.net; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* An interface for getting client-based network attributes. It adapts from a type-specific request | ||
* and response into the 4 common network attribute values. | ||
* | ||
* <p>Instrumentation authors will create implementations of this interface for their specific | ||
* library/framework. It will be used by the NetClientAttributesExtractor to obtain the various | ||
* network attributes in a type-generic way. | ||
*/ | ||
public interface NetClientAttributesGetter<REQUEST, RESPONSE> { | ||
|
||
@Nullable | ||
String transport(REQUEST request, @Nullable RESPONSE response); | ||
|
||
@Nullable | ||
String peerName(REQUEST request, @Nullable RESPONSE response); | ||
|
||
@Nullable | ||
Integer peerPort(REQUEST request, @Nullable RESPONSE response); | ||
|
||
@Nullable | ||
String peerIp(REQUEST request, @Nullable RESPONSE response); | ||
} |
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
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
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.