Skip to content

Commit 2b73ce7

Browse files
committed
saving work
1 parent c88590d commit 2b73ce7

File tree

1 file changed

+3
-237
lines changed

1 file changed

+3
-237
lines changed

content/en/serverless/aws_lambda/managed_instances.md

Lines changed: 3 additions & 237 deletions
Original file line numberDiff line numberDiff line change
@@ -7,242 +7,8 @@ Datadog Serverless Monitoring enables visibility into AWS Lambda Managed Instanc
77

88
## Setup
99

10+
{{< partial name="serverless/getting-started-languages.html" >}}
1011

11-
1. [Create a task definition file](#create-a-task-definition-file)
12-
2. [Register the task definition](#register-the-task-definition)
13-
3. [Run the task as a replica service](#run-the-task-as-a-replica-service)
12+
## Metrics collected
1413

15-
### Create a task definition file
16-
17-
This task definition launches the Datadog Agent container with the necessary configurations.
18-
19-
1. Download (TBD: file). This files provide minimal configuration for core infrastructure monitoring. For more sample task definition files with various features enabled, see the [Set up additional Agent features](#set-up-additional-datadog-agent-features) section on this page.
20-
2. Modify the task definition file:
21-
- Set the `DD_API_KEY` environment variable by replacing `<YOUR_DATADOG_API_KEY>` with the [Datadog API key][1] for your account. Alternatively, you can also [supply the ARN of a secret stored in AWS Secrets Manager][2].
22-
- Set the `DD_SITE` environment variable to your [Datadog site][3]. Your site is: {{< region-param key="dd_site" code="true" >}}
23-
3. (Optional) To add an Agent health check, add the following line to your task definition:
24-
```json
25-
"healthCheck": {
26-
"retries": 3,
27-
"command": ["CMD-SHELL","agent health"],
28-
"timeout": 5,
29-
"interval": 30,
30-
"startPeriod": 15
31-
}
32-
```
33-
34-
### Register the task definition
35-
36-
{{< tabs >}}
37-
{{% tab "AWS Console" %}}
38-
39-
1. Log in to your [AWS Console][1] and navigate to (TBD: where?)
40-
2. Select **Task Definitions** in the navigation pane. On the **Create new task definition** menu, select **Create new task definition with JSON**.
41-
3. In the JSON editor box, paste the contents of your task definition file.
42-
4. Select **Create**.
43-
44-
[1]: https://aws.amazon.com/console
45-
{{% /tab %}}
46-
47-
{{% tab "AWS CLI" %}}
48-
Use the [AWS CLI][1] to execute the following command:
49-
50-
```bash
51-
(TBD: command)
52-
```
53-
[1]: https://aws.amazon.com/cli
54-
{{% /tab %}}
55-
{{< /tabs >}}
56-
57-
58-
### Run the task as a replica service
59-
60-
{{< tabs >}}
61-
{{% tab "AWS Console" %}}
62-
1. Log in to your [AWS Web Console][1] and navigate to (TBD: where?)
63-
2. Choose the cluster to run the Datadog Agent on.
64-
3. On the **Services** tab, click **Create**.
65-
4. For **Task Definition**, select the task created in the previous steps.
66-
5. Enter a **Service name**.
67-
6. For **Launch type**, choose **Capacity Provider** and select the Manged Instance capacity provider tied to the cluster.
68-
7. For **Number of tasks**, enter `1`. Click **Next step**.
69-
8. Fill in the rest of the optional fields based on your preference.
70-
9. Click **Next step**.
71-
10. Click **Create service**.
72-
73-
[1]: https://aws.amazon.com/console
74-
{{% /tab %}}
75-
76-
{{% tab "AWS CLI" %}}
77-
Use the [AWS CLI][1] to execute the following command:
78-
79-
```bash
80-
(TBD: command)
81-
```
82-
83-
[1]: https://aws.amazon.com/cli
84-
{{% /tab %}}
85-
{{< /tabs >}}
86-
87-
## Set up additional Datadog Agent features
88-
89-
### Metrics collection
90-
91-
To provide a custom integration configuration, you must mount a configuration file directly onto the Datadog Agent container.
92-
93-
**Example**: Setting up a Datadog Agent with custom configuration files mounted
94-
95-
Create the following file structure:
96-
```
97-
|- datadog
98-
|- Dockerfile
99-
|- conf.d
100-
|-redis.yaml
101-
```
102-
103-
The `redis.yaml` file contains the configurations for the [Redis][4] integration.
104-
105-
{{< code-block lang="yaml" filename="redis.yaml" disable_copy="false" collapsible="true" >}}
106-
ad_identifiers:
107-
- redis
108-
109-
init_config:
110-
111-
instances:
112-
- host: %%host%%
113-
port: 6379
114-
{{< /code-block >}}
115-
116-
The `Dockerfile` is used to build a Datadog Agent image and include the `redis.yaml` file at the correct location:
117-
118-
{{< code-block lang="Dockerfile" filename="Dockerfile" disable_copy="false" collapsible="true" >}}
119-
FROM public.ecr.aws/datadog/agent:latest
120-
121-
COPY conf.d/ /etc/datadog-agent/conf.d/
122-
{{< /code-block >}}
123-
124-
After the image is built and pushed to an image registry, reference the custom image in the ECS task definition:
125-
```
126-
{
127-
"containerDefinitions": [
128-
{
129-
"image": "<registry-domain>/<namespace-or-account>/<repository>:<tag>",
130-
"name": "datadog-agent",
131-
...
132-
}
133-
],
134-
...
135-
}
136-
```
137-
138-
### Trace collection (APM)
139-
140-
Instrument your application based on your setup:
141-
142-
| Language |
143-
|------------------------------------|
144-
| [Java][5] |
145-
| [Python][6] |
146-
| [Ruby][7] |
147-
| [Go][8] |
148-
| [Node.js][9] |
149-
| [PHP][10] |
150-
| [C++][11] |
151-
| [.NET Core][12] |
152-
| [.NET Framework][13] |
153-
154-
#### UDP
155-
156-
To collect traces over UDP, do not set `DD_AGENT_HOST`. Keep the default `localhost` value.
157-
158-
#### UDS
159-
160-
To collect traces over UDS:
161-
1. Add an empty volume onto the task definition using the `volumes` parameter.
162-
2. Mount the volume onto the agent and application container using the `mountPoints` parameter.
163-
3. Configure the environmental variable `DD_DOGSTATSD_SOCKET` on the application container and set it to `/var/run/datadog/dsd.socket`.
164-
165-
**Example**: Container definitions that configure collecting traces over UDS
166-
```
167-
{
168-
"containerDefinitions": [
169-
{
170-
"image": "datadog/agent:latest",
171-
"mountPoints": [
172-
{
173-
"containerPath": "/var/run/datadog",
174-
"readOnly": false,
175-
"sourceVolume": "dd-sockets"
176-
}
177-
],
178-
"name": "datadog-agent",
179-
...
180-
...
181-
},
182-
{
183-
"environment": [
184-
{
185-
"name": "DD_DOGSTATSD_SOCKET",
186-
"value": "/var/run/datadog/dsd.socket"
187-
}
188-
],
189-
"mountPoints": [
190-
{
191-
"containerPath": "/var/run/datadog",
192-
"readOnly": false,
193-
"sourceVolume": "dd-sockets"
194-
}
195-
],
196-
"name": "app",
197-
...
198-
...
199-
}
200-
],
201-
...
202-
"volumes": [
203-
{
204-
"host": {},
205-
"name": "dd-sockets"
206-
}
207-
]
208-
}
209-
210-
```
211-
212-
### Log collection
213-
214-
The setup for log collection is identical to the setup for log collection in ECS Fargate. Follow the instructions in the [ECS Fargate documentation][14]. These instructions give you the option to use either AWS FireLens in combination with Datadog's Fluent Bit output plugin, or the `awslogs` log driver.
215-
216-
### Process collection
217-
218-
You can monitor processes in Datadog by using the [Live Processes page][15]. To enable process collection, add the [`PidMode` parameter][16] in the task definition and set it to `task` as follows:
219-
220-
```
221-
"pidMode": "task"
222-
```
223-
224-
## Troubleshooting
225-
226-
Need help? Contact [Datadog support][17].
227-
228-
## Further reading
229-
230-
{{< partial name="whats-next/whats-next.html" >}}
231-
232-
[1]: https://app.datadoghq.com/organization-settings/api-keys
233-
[2]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-tutorial.html
234-
[3]: /getting_started/site/
235-
[4]: /integrations/redis/?tab=ecs
236-
[5]: /tracing/trace_collection/dd_libraries/java?tab=containers#automatic-instrumentation
237-
[6]: /tracing/trace_collection/dd_libraries/python?tab=containers#instrument-your-application
238-
[7]: /tracing/trace_collection/dd_libraries/ruby#instrument-your-application
239-
[8]: /tracing/trace_collection/dd_libraries/go/?tab=containers#activate-go-integrations-to-create-spans
240-
[9]: /tracing/trace_collection/dd_libraries/nodejs?tab=containers#instrument-your-application
241-
[10]: /tracing/trace_collection/dd_libraries/php?tab=containers#automatic-instrumentation
242-
[11]: /tracing/trace_collection/dd_libraries/cpp?tab=containers#instrument-your-application
243-
[12]: /tracing/trace_collection/dd_libraries/dotnet-core?tab=containers#custom-instrumentation
244-
[13]: /tracing/trace_collection/dd_libraries/dotnet-framework?tab=containers#custom-instrumentation
245-
[14]: integrations/ecs_fargate/?tab=awscli#log-collection
246-
[15]: /process
247-
[16]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_definition_pidmode
248-
[17]: https://docs.datadoghq.com/help/
14+
## Logs Trace correlation

0 commit comments

Comments
 (0)