Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified service tagging for AWS Lambda #9374

Merged
merged 6 commits into from
Dec 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Unified service tagging for AWS Lambda
  • Loading branch information
tianchu authored Dec 28, 2020
commit f21e64733b0cea1d6fc6b7ca7410b2a952d48f0a
53 changes: 53 additions & 0 deletions content/en/getting_started/tagging/unified_service_tagging.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,59 @@ to configure the `service` tag only in the configuration of the process check.
{{% /tab %}}
{{< /tabs >}}

### Serverless environment

#### AWS Lambda Functions

Depending on how you build and deploy your AWS Lambda-based serverless applications, you may have several options available for applying the `env`, `service` and `version` tags to the metrics, traces and logs emitted from Lambda functions.

{{< tabs >}}

{{% tab "Serverless Framework" %}}

Tag your Lambda functions using the [tags][1] option:

```yaml
# serverless.yml
service: service-name
provider:
name: aws
# to apply the tags to all functions
tags:
env: "<ENV>"
service: "<SERVICE>"
version: "<VERSION>"

functions:
hello:
# this function will inherit the service level tags config above
handler: handler.hello
world:
# this function will overwrite the tags
handler: handler.users
tags:
env: "<ENV>"
service: "<SERVICE>"
version: "<VERSION>"
```

If you have installed the [Datadog serverless plugin][2], the plugin automatically tag the Lambda functions with the `service` and `env` tags using the `service` and `stage` values from the serverless application definition, unless a `service` or `env` tag already exists.
tianchu marked this conversation as resolved.
Show resolved Hide resolved

[1]: https://www.serverless.com/framework/docs/providers/aws/guide/functions#tags
[2]: https://docs.datadoghq.com/serverless/serverless_integrations/plugin
{{% /tab %}}

{{% tab "AWS SAM" %}}
{{% /tab %}}

{{% tab "AWS CDK" %}}
{{% /tab %}}

{{% tab "Custom" %}}
{{% /tab %}}

{{< /tabs >}}

## Further Reading

{{< partial name="whats-next/whats-next.html" >}}
Expand Down