public class DDLambda
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
|
DDLambda(com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent req,
com.amazonaws.services.lambda.runtime.Context cxt)
Create a trace-enabled DDLambda instrumenter given an APIGatewayProxyRequestEvent and a Lambda context
|
|
DDLambda(com.amazonaws.services.lambda.runtime.events.APIGatewayV2ProxyRequestEvent req,
com.amazonaws.services.lambda.runtime.Context cxt)
Create a trace-enabled DDLambda instrumenter given an APIGatewayV2ProxyEventRequest and a Lambda context
|
|
DDLambda(com.amazonaws.services.lambda.runtime.Context cxt)
Create a new DDLambda instrumenter given some Lambda context
|
protected |
DDLambda(com.amazonaws.services.lambda.runtime.Context cxt,
java.lang.String xrayTraceInfo)
Testing only: create a DDLambda instrumenter with a given context and xrayTraceInfo
|
|
DDLambda(Headerable req,
com.amazonaws.services.lambda.runtime.Context cxt)
Create a trace-enabled DDLambda instrumenter given a custom request object.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.client.methods.HttpUriRequest |
addTraceHeaders(org.apache.http.client.methods.HttpUriRequest httpRequest)
Deprecated.
|
okhttp3.Request |
addTraceHeaders(okhttp3.Request request)
Deprecated.
|
java.net.URLConnection |
addTraceHeaders(java.net.URLConnection urlConnection)
Deprecated.
|
protected boolean |
checkEnhanced() |
protected boolean |
checkTraceEnabled()
Check to see if the user has set DD_TRACE_ENABLED
|
void |
error(com.amazonaws.services.lambda.runtime.Context cxt)
error increments the aws.lambda.enhanced.error metric in Datadog.
|
void |
finish()
Finish the active span.
|
java.util.Map<java.lang.String,java.lang.String> |
getTraceContext()
Get the trace context for trace/log correlation.
|
java.lang.String |
getTraceContextString()
Get the trace context in string form.
|
org.apache.http.client.methods.HttpGet |
makeHttpGet(java.lang.String url)
Deprecated.
|
okhttp3.Request.Builder |
makeRequestBuilder()
Deprecated.
|
java.net.URLConnection |
makeUrlConnection(java.net.URL url)
Deprecated.
|
void |
metric(java.lang.String name,
double value,
java.util.Map<java.lang.String,java.lang.Object> tags)
metric allows the user to record their own custom metric that will be sent to Datadog.
|
void |
metric(java.lang.String name,
double value,
java.util.Map<java.lang.String,java.lang.Object> tags,
java.util.Date date)
metric allows the user to record their own custom metric that will be sent to Datadog.
|
protected java.lang.String |
santitizeFunctionArn(java.lang.String functionArn) |
public DDLambda(com.amazonaws.services.lambda.runtime.Context cxt)
cxt - Enhanced Metrics pulls information from the Lambda context.protected DDLambda(com.amazonaws.services.lambda.runtime.Context cxt,
java.lang.String xrayTraceInfo)
cxt - Enhanced Metrics pulls information from the Lambda context.xrayTraceInfo - This would normally be the contents of the "_X_AMZN_TRACE_ID" env varpublic DDLambda(com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent req,
com.amazonaws.services.lambda.runtime.Context cxt)
req - Your Datadog trace headers are pulled from the request and sent to XRay for consumption by the
Datadog Xray Crawlercxt - Enhanced Metrics pulls information from the Lambda context.public DDLambda(com.amazonaws.services.lambda.runtime.events.APIGatewayV2ProxyRequestEvent req,
com.amazonaws.services.lambda.runtime.Context cxt)
req - Your Datadog trace headers are pulled from the request and sent to XRay for consumption by the
Datadog Xray Crawlercxt - Enhanced Metrics pulls information from the Lambda context.public DDLambda(Headerable req, com.amazonaws.services.lambda.runtime.Context cxt)
req - A custom request object that implements Headerable. Datadog trace headers are pulled from this request object.cxt - Enhanced Metrics pulls information from the Lambda context.public void finish()
protected java.lang.String santitizeFunctionArn(java.lang.String functionArn)
protected boolean checkEnhanced()
protected boolean checkTraceEnabled()
public void metric(java.lang.String name,
double value,
java.util.Map<java.lang.String,java.lang.Object> tags)
name - The metric's namevalue - The metric's valuetags - A map of tags to be assigned to the metricpublic void metric(java.lang.String name,
double value,
java.util.Map<java.lang.String,java.lang.Object> tags,
java.util.Date date)
name - The metric's namevalue - The metric's valuetags - A map of tags to be assigned to the metricdate - The date under which the metric value will appear in datadogpublic void error(com.amazonaws.services.lambda.runtime.Context cxt)
cxt - The AWS Context provided to your handler@Deprecated
public java.net.URLConnection makeUrlConnection(java.net.URL url)
throws java.io.IOException
url - the URL to which you want to open a connection.java.io.IOException@Deprecated public java.net.URLConnection addTraceHeaders(java.net.URLConnection urlConnection)
urlConnection - the URLConnection that will have the trace headers added to it.@Deprecated public org.apache.http.client.methods.HttpGet makeHttpGet(java.lang.String url)
url - The URL that will eventually be gotten.@Deprecated public org.apache.http.client.methods.HttpUriRequest addTraceHeaders(org.apache.http.client.methods.HttpUriRequest httpRequest)
httpRequest - the HttpUriRequest that will have the trace headers added to it.@Deprecated public okhttp3.Request.Builder makeRequestBuilder()
@Deprecated public okhttp3.Request addTraceHeaders(okhttp3.Request request)
request - The OKHttp3 Request that will have the trace headers added to it.public java.util.Map<java.lang.String,java.lang.String> getTraceContext()
public java.lang.String getTraceContextString()