-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using deprecated NetPeerAttributes outside of the deprecated pac…
…kage (#5024)
- Loading branch information
Showing
3 changed files
with
57 additions
and
14 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
38 changes: 38 additions & 0 deletions
38
...ain/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceNetAttributesExtractor.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,38 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.lettuce.v5_1; | ||
|
||
import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_TCP; | ||
|
||
import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesExtractor; | ||
import io.opentelemetry.instrumentation.lettuce.v5_1.OpenTelemetryTracing.OpenTelemetryEndpoint; | ||
import javax.annotation.Nullable; | ||
|
||
final class LettuceNetAttributesExtractor | ||
extends NetClientAttributesExtractor<OpenTelemetryEndpoint, Void> { | ||
|
||
@Override | ||
public String transport(OpenTelemetryEndpoint endpoint, @Nullable Void unused) { | ||
return IP_TCP; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public String peerName(OpenTelemetryEndpoint endpoint, @Nullable Void unused) { | ||
return endpoint.name; | ||
} | ||
|
||
@Override | ||
public Integer peerPort(OpenTelemetryEndpoint endpoint, @Nullable Void unused) { | ||
return endpoint.port; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public String peerIp(OpenTelemetryEndpoint endpoint, @Nullable Void unused) { | ||
return endpoint.ip; | ||
} | ||
} |
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