-
Notifications
You must be signed in to change notification settings - Fork 867
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Host header parsing in HTTP client attributes extractor (#7288
) Continuation (and refactoring) of #6892
- Loading branch information
Mateusz Rzeszutek
authored
Nov 30, 2022
1 parent
e2f9603
commit 91d9f1d
Showing
10 changed files
with
195 additions
and
44 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
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
26 changes: 26 additions & 0 deletions
26
...o/opentelemetry/instrumentation/api/instrumenter/net/internal/FallbackNamePortGetter.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,26 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.api.instrumenter.net.internal; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* This class is internal and is hence not for public use. Its APIs are unstable and can change at | ||
* any time. | ||
*/ | ||
public interface FallbackNamePortGetter<REQUEST> { | ||
|
||
@Nullable | ||
String name(REQUEST request); | ||
|
||
@Nullable | ||
Integer port(REQUEST request); | ||
|
||
@SuppressWarnings("unchecked") | ||
static <REQUEST> FallbackNamePortGetter<REQUEST> noop() { | ||
return (FallbackNamePortGetter<REQUEST>) NoopNamePortGetter.INSTANCE; | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
...va/io/opentelemetry/instrumentation/api/instrumenter/net/internal/NoopNamePortGetter.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,24 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.api.instrumenter.net.internal; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
enum NoopNamePortGetter implements FallbackNamePortGetter<Object> { | ||
INSTANCE; | ||
|
||
@Nullable | ||
@Override | ||
public String name(Object o) { | ||
return null; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Integer port(Object o) { | ||
return null; | ||
} | ||
} |
Oops, something went wrong.