-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
244 changed files
with
3,300 additions
and
1,323 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: "Bug Report (Low Priority)" | ||
description: "Create a public Bug Report. Note that these may not be addressed as it depeonds on capacity and that looking up account information will be difficult." | ||
labels: "type: bug" | ||
body: | ||
- type: input | ||
attributes: | ||
label: Tracer Version(s) | ||
description: "Version(s) of the tracer affected by this bug" | ||
placeholder: "1.44.0" | ||
validations: | ||
required: true | ||
|
||
- type: input | ||
attributes: | ||
label: Java Version(s) | ||
description: "Version(s) of Java (`java --version`) that you've encountered this bug with" | ||
placeholder: 21.0.4 | ||
validations: | ||
required: true | ||
|
||
- type: dropdown | ||
attributes: | ||
label: JVM Vendor | ||
description: "Which JVM vendor does your application use" | ||
options: | ||
- Oracle JDK | ||
- Alibaba Dragonwell | ||
- Amazon Corretto | ||
- Azul Zing / Zulu | ||
- BellSoft Liberica JDK | ||
- Eclipse Adoptium / Temurin | ||
- Eclipse OpenJ9 | ||
- IBM SDK / Semeru | ||
- Oracle GraalVM | ||
- RedHat JDK | ||
- SapMachine | ||
- Other (please specify in comments) | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
attributes: | ||
label: Bug Report | ||
description: Please add a clear and concise description of the bug here | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
attributes: | ||
label: Expected Behavior | ||
description: What is the expected behavior | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
attributes: | ||
label: Reproduction Code | ||
description: Please add code here to help us reproduce the problem | ||
validations: | ||
required: false |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
blank_issues_enabled: true | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Bug Report | ||
- name: Bug Report (High Priority) | ||
url: https://help.datadoghq.com/hc/en-us/requests/new?tf_1260824651490=pt_product_type:apm&tf_1900004146284=pt_apm_language:java | ||
about: This option creates an expedited Bug Report via the helpdesk (no login required). This will allow us to look up your account and allows you to provide additional information in private. | ||
- name: Feature Request | ||
about: Create an expedited Bug Report via the helpdesk (no login required). This will allow us to look up your account and allows you to provide additional information in private. | ||
- name: Feature Request (High Priority) | ||
url: https://help.datadoghq.com/hc/en-us/requests/new?tf_1260824651490=pt_product_type:apm&tf_1900004146284=pt_apm_language:java&tf_1260825272270=pt_apm_category_feature_request | ||
about: This option creates an expedited Feature Request via the helpdesk (no login required). This helps with prioritization and allows you to provide additional information in private. | ||
about: Create an expedited Feature Request via the helpdesk (no login required). This helps with prioritization and allows you to provide additional information in private. |
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,49 @@ | ||
name: Feature Request (Low Priority) | ||
description: Create a public Feature Request. Note that these may not be addressed as it depeonds on capacity and that looking up account information will be difficult. | ||
labels: "type: feature request" | ||
body: | ||
- type: input | ||
attributes: | ||
label: Library Name | ||
description: "If your feature request is to add instrumentation support for a library please provide the name here" | ||
placeholder: "spring-boot" | ||
validations: | ||
required: false | ||
|
||
- type: input | ||
attributes: | ||
label: Library Version(s) | ||
description: "If your feature request is to add instrumentation support for a library please provide the version you use" | ||
placeholder: "1.2" | ||
validations: | ||
required: false | ||
|
||
- type: textarea | ||
attributes: | ||
label: Describe the feature you'd like | ||
description: A clear and concise description of what you want to happen. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
attributes: | ||
label: Is your feature request related to a problem? | ||
description: | | ||
Please add a clear and concise description of your problem. | ||
E.g. I'm unable to instrument my database queries... | ||
validations: | ||
required: false | ||
|
||
- type: textarea | ||
attributes: | ||
label: Describe alternatives you've considered | ||
description: A clear and concise description of any alternative solutions or features you've considered | ||
validations: | ||
required: false | ||
|
||
- type: textarea | ||
attributes: | ||
label: Additional context | ||
description: Add any other context or screenshots about the feature request here | ||
validations: | ||
required: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# Security | ||
# Security Policy | ||
|
||
## Security Vulnerabilities | ||
This document outlines the security policy for the Datadog Java client library (aka Java tracer) and what to do if you discover a security vulnerability in the project. | ||
Most notably, please do not share the details in a public forum (such as in a discussion, issue, or pull request) but instead reach out to us with the details. | ||
This gives us an opportunity to release a fix for others to benefit from by the time details are made public. | ||
|
||
If you have found a security issue, please contact the security team directly at security@datadoghq.com. | ||
## Reporting a Vulnerability | ||
|
||
If you discover a vulnerability in the Datadog Java client library (or any Datadog product for that matter) please submit details to the following email address: | ||
|
||
* [security@datadoghq.com](mailto:security@datadoghq.com) |
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
3 changes: 0 additions & 3 deletions
3
components/context/src/main/java/datadog/context/ContextBinder.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
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
4 changes: 4 additions & 0 deletions
4
components/context/src/main/java/datadog/context/package-info.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,4 @@ | ||
@ParametersAreNonnullByDefault | ||
package datadog.context; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; |
15 changes: 15 additions & 0 deletions
15
components/context/src/main/java/datadog/context/propagation/CarrierSetter.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,15 @@ | ||
package datadog.context.propagation; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
@FunctionalInterface | ||
public interface CarrierSetter<C> { | ||
/** | ||
* Sets a carrier key/value pair. | ||
* | ||
* @param carrier the carrier to store key/value into. | ||
* @param key the key to set. | ||
* @param value the value to set. | ||
*/ | ||
void set(@Nullable C carrier, String key, String value); | ||
} |
26 changes: 26 additions & 0 deletions
26
components/context/src/main/java/datadog/context/propagation/CarrierVisitor.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 @@ | ||
package datadog.context.propagation; | ||
|
||
import java.util.function.BiConsumer; | ||
|
||
/** | ||
* This interface represents the capacity of walking through a carrier content, iterating over its | ||
* key/value pairs. | ||
* | ||
* <p>Walking through carrier is preferred to direct access to carrier key/value pairs as some | ||
* carrier implementations do not have built-in direct access and require walking over the full | ||
* carrier structure to find the requested key/value pair, leading to multiple walks when multiple | ||
* keys are requested, whereas the visitor is expected to walk through only once, and the | ||
* propagators to keep the data they need using the visitor callback. | ||
* | ||
* @param <C> the type of carrier. | ||
*/ | ||
@FunctionalInterface | ||
public interface CarrierVisitor<C> { | ||
/** | ||
* Iterates over the carrier content and calls the visitor callback for every key/value found. | ||
* | ||
* @param carrier the carrier to iterate over. | ||
* @param visitor the callback to call for each carrier key/value pair found. | ||
*/ | ||
void forEachKeyValue(C carrier, BiConsumer<String, String> visitor); | ||
} |
55 changes: 55 additions & 0 deletions
55
components/context/src/main/java/datadog/context/propagation/CompositePropagator.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,55 @@ | ||
package datadog.context.propagation; | ||
|
||
import datadog.context.Context; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.function.BiConsumer; | ||
|
||
class CompositePropagator implements Propagator { | ||
private final Propagator[] propagators; | ||
|
||
CompositePropagator(Propagator[] propagators) { | ||
this.propagators = propagators; | ||
} | ||
|
||
@Override | ||
public <C> void inject(Context context, C carrier, CarrierSetter<C> setter) { | ||
for (Propagator propagator : this.propagators) { | ||
propagator.inject(context, carrier, setter); | ||
} | ||
} | ||
|
||
@Override | ||
public <C> Context extract(Context context, C carrier, CarrierVisitor<C> visitor) { | ||
// Extract and cache carrier key/value pairs | ||
CarrierCache carrierCache = new CarrierCache(); | ||
visitor.forEachKeyValue(carrier, carrierCache); | ||
// Run the multiple extractions on cache | ||
for (Propagator propagator : this.propagators) { | ||
context = propagator.extract(context, carrierCache, carrierCache); | ||
} | ||
return context; | ||
} | ||
|
||
static class CarrierCache implements BiConsumer<String, String>, CarrierVisitor<CarrierCache> { | ||
/** Cached key/values from carrier (even indexes are keys, odd indexes are values). */ | ||
private final List<String> keysAndValues; | ||
|
||
public CarrierCache() { | ||
this.keysAndValues = new ArrayList<>(32); | ||
} | ||
|
||
@Override | ||
public void accept(String key, String value) { | ||
this.keysAndValues.add(key); | ||
this.keysAndValues.add(value); | ||
} | ||
|
||
@Override | ||
public void forEachKeyValue(CarrierCache carrier, BiConsumer<String, String> visitor) { | ||
for (int i = 0; i < carrier.keysAndValues.size() - 1; i += 2) { | ||
visitor.accept(carrier.keysAndValues.get(i), carrier.keysAndValues.get(i + 1)); | ||
} | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
components/context/src/main/java/datadog/context/propagation/Concern.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,57 @@ | ||
package datadog.context.propagation; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
import datadog.context.Context; | ||
|
||
/** This class defines a cross-cutting concern to be propagated from a {@link Context}. */ | ||
public class Concern { | ||
/** The concern default priority. */ | ||
public static final int DEFAULT_PRIORITY = 100; | ||
/** The concern name, for debugging purpose only. */ | ||
private final String name; | ||
/** The concern priority, lower value means higher priority. */ | ||
private final int priority; | ||
|
||
/** | ||
* Creates a concern. | ||
* | ||
* @param name the concern name, for debugging purpose only. | ||
* @return The created concern. | ||
*/ | ||
public static Concern named(String name) { | ||
return new Concern(name, DEFAULT_PRIORITY); | ||
} | ||
|
||
/** | ||
* Creates a concern with a specific priority. | ||
* | ||
* @param name the concern name, for debugging purpose only. | ||
* @param priority the concern priority (lower value means higher priority, while the default is | ||
* {@link #DEFAULT_PRIORITY}), | ||
* @return The created concern. | ||
*/ | ||
public static Concern withPriority(String name, int priority) { | ||
return new Concern(name, priority); | ||
} | ||
|
||
private Concern(String name, int priority) { | ||
requireNonNull(name, "Concern name cannot be null"); | ||
if (priority < 0) { | ||
throw new IllegalArgumentException("Concern priority cannot be negative"); | ||
} | ||
this.name = name; | ||
this.priority = priority; | ||
} | ||
|
||
int priority() { | ||
return this.priority; | ||
} | ||
|
||
// We want identity equality, so no need to override equals(). | ||
|
||
@Override | ||
public String toString() { | ||
return this.name; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
components/context/src/main/java/datadog/context/propagation/NoopPropagator.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,19 @@ | ||
package datadog.context.propagation; | ||
|
||
import datadog.context.Context; | ||
|
||
final class NoopPropagator implements Propagator { | ||
static final NoopPropagator INSTANCE = new NoopPropagator(); | ||
|
||
private NoopPropagator() {} | ||
|
||
@Override | ||
public <C> void inject(Context context, C carrier, CarrierSetter<C> setter) { | ||
// noop | ||
} | ||
|
||
@Override | ||
public <C> Context extract(Context context, C carrier, CarrierVisitor<C> visitor) { | ||
return context; | ||
} | ||
} |
Oops, something went wrong.