Skip to content

Conversation

CoreyGriffin
Copy link
Contributor

@CoreyGriffin CoreyGriffin commented Nov 3, 2022

What does this PR do?

  • Includes the error when statsd client fails to send the metric

Motivation

  • Ran into an issue where metrics were sporadically failing to send when using the serverless plugin. Needed the know error to resolve underlying issue.

Testing Guidelines

  • Tested in lambda functions that were originally failing to send metrics and was able to identify and resolve the issue.

Example

{
    "status": "error",
    "message": "datadog: could not send metric <metric name>"
}

Original output

{
    "status": "error",
    "message": "datadog: could not send metric <metric name>: statsd buffer is full"
}

New output

Additional Notes

  • None

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Checklist

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

@CoreyGriffin CoreyGriffin marked this pull request as ready for review November 3, 2022 13:34
@CoreyGriffin CoreyGriffin requested a review from a team as a code owner November 3, 2022 13:34
@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2022

Codecov Report

Merging #118 (c217e21) into main (bf8b37f) will decrease coverage by 1.30%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
- Coverage   84.51%   83.21%   -1.31%     
==========================================
  Files          13       13              
  Lines         788      846      +58     
==========================================
+ Hits          666      704      +38     
- Misses         96      113      +17     
- Partials       26       29       +3     
Impacted Files Coverage Δ
internal/metrics/listener.go 83.06% <0.00%> (ø)
internal/extension/extension.go 80.26% <0.00%> (-10.65%) ⬇️
internal/trace/listener.go 54.92% <0.00%> (-3.14%) ⬇️
internal/metrics/processor.go 97.70% <0.00%> (-2.30%) ⬇️
internal/wrapper/wrap_handler.go 97.93% <0.00%> (+0.02%) ⬆️
ddlambda.go 79.61% <0.00%> (+1.04%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@DylanLovesCoffee DylanLovesCoffee merged commit f41f4ee into DataDog:main Nov 8, 2022
peterdeme pushed a commit to spacelift-io/datadog-lambda-go that referenced this pull request Nov 15, 2023
peterdeme added a commit to spacelift-io/datadog-lambda-go that referenced this pull request Dec 4, 2023
* Create codeql-analysis.yml (DataDog#100)

* Create codeql-analysis.yml

* Update codeql-analysis.yml

* Update run_integration_tests.sh

* Do not show error messages even if neither DD_API_KEY nor DD_KMS_API_KEY is set when Lambda Extension is running (DataDog#102)

* Bump version to 1.4.0

* Bump go + fasthttp + lint (DataDog#104)

* Consolidate serverless configurations into one place (DataDog#105)

* Update README.md

* Update README.md

* Bump dd-trace-go to latest version to address some vulnerabilities (DataDog#109)

* Bump dd-trace-go to latest version to address some vulnaribilities
* update go.sum with `go mod tidy`

* Bump version to 1.6.0

* bump codeql (DataDog#112)

* Bump dd-trace-go to v1.41 (DataDog#115)

* Bump version to 1.7.0

* [SLS-2330] Add support for universal instrumentation with the extension (DataDog#116)

add option to use universal instrumentation

* [EEP-444] include error in failed metric send log (DataDog#118)

Co-authored-by: Corey Griffin <[email protected]>

* [SLS-2492] Upgrade aws sdk v2 (DataDog#113)

upgrade sdk

* Bump version to 1.8.0

* Use new account in integration tests (DataDog#119)

* set the architecture explicitely (DataDog#122)

* mask init runtime logs (DataDog#123)

* Update libs (DataDog#121)

* bump go 1.18 (DataDog#125)

* Retry sending trace payloads on failure. (DataDog#128)

* Bump version to 1.9.0

* Update DD Trace to  v1.51.0(DataDog#133)

* Bump go version to 1.20 (DataDog#140)

Bump go version to 1.20

* Upgrade version of dd-trace-go to v1.54.1 (DataDog#141)

* Bump version to 1.10.0

* Propagate trace context from SQS events (DataDog#142)

* Default parent id to be trace id if not found elsewhere.

* Look for trace context in context object as well as headers.

* Apply trace context before starting the function execution span.

* Update signature in tests.

* Add spanid of execution span to context.

* Do not ignore priority "-128".

* Test that default parent id set to trace id.

* Test span id added to context.

* Test uses trace context from context object.

* Bump version to 1.11.0

* feat: automate AppSec enablement setup (e.g: `AWS_LAMBDA_RUNTIME_API`) (DataDog#143)

* feat: honor AWS_LAMBDA_EXEC_WRAPPER when AWS Lambda does not

In order to simplify onboarding & make it more uniform across languages,
inspect the value of the `AWS_LAMBDA_EXEC_WRAPPER` environment variable
and apply select environment variable changes it perofrms upon
decorating a handler.

This is necessary/useful because that environment variable is not
honored by custom runtimes (`provided`, `provided.al2`) as well as the
`go1.x` runtime (which is a glorified provided runtime). The datadog
Lambda wrapper starts a proxy to inject ASM functionality directly on
the Lambda runtime API instead of having to manually instrument each and
every lambda handler/application, and modifies `AWS_LAMBDA_RUNTIME_API`
to instruct Lambda language runtime client libraries to go through it
instead of directly interacting with the Lambda control plane.

APPSEC-11534

* pivot to a different, cheaper strategy

* typo fix

* PR feedback

* minor fixups

* add warning in go1.x runtime if lambda.norpc build tag was not enabled

* Bump version to 1.12.0

* Re-add configs after upstream rebase

* Bump packages

* Remove deprecated `io/ioutil` calls

---------

Co-authored-by: Tian Chu <[email protected]>
Co-authored-by: Soshi Katsuta <[email protected]>
Co-authored-by: Maxime David <[email protected]>
Co-authored-by: kimi <[email protected]>
Co-authored-by: Kimi Wu <[email protected]>
Co-authored-by: Dylan Yang <[email protected]>
Co-authored-by: Corey Griffin <[email protected]>
Co-authored-by: Corey Griffin <[email protected]>
Co-authored-by: Marcin Rabenda <[email protected]>
Co-authored-by: Rey Abolofia <[email protected]>
Co-authored-by: Rey Abolofia <[email protected]>
Co-authored-by: Andrew Rodriguez <[email protected]>
Co-authored-by: Ivan Topolcic <[email protected]>
Co-authored-by: Romain Marcadier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants