Skip to content

Commit f72252a

Browse files
rnishtala-sumokimsaucejpipkin1
authored
docs: Add documentation for sending traces with instrumentation of dotnet lambda functions (#5876)
* docs: Add documentation for sending traces with instrumentation of dotnet lambda functions * Change the docs to use the upstream collector lambda layer * Changed .NET URL to dotnet and added aws-lamda index page (#5877) * changed .NET URL to dotnet and added aws-lamda index pg * indent * Update docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/dotnet.md Co-authored-by: John Pipkin (Sumo Logic) <[email protected]> --------- Co-authored-by: Raj Nishtala <[email protected]> Co-authored-by: John Pipkin (Sumo Logic) <[email protected]> * Add OPENTELEMETRY_COLLECTOR_CONFIG_URI to the environment variables * Reorganizing content under lambda configuration * Update the image to adhere style guide * Remove /v1/traces from the sumologic endpoint * Update the link to setup the sumologic otlp endpoint --------- Co-authored-by: Kim (Sumo Logic) <[email protected]> Co-authored-by: John Pipkin (Sumo Logic) <[email protected]>
1 parent 550c793 commit f72252a

File tree

9 files changed

+169
-11
lines changed

9 files changed

+169
-11
lines changed

cid-redirects.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,9 +1522,9 @@
15221522
"/Traces/01Getting_Started_with_Transaction_Tracing/Set_up_traces_collection_for_Kubernetes_environments": "/docs/apm/traces/get-started-transaction-tracing/set-up-traces-collection-for-kubernetes-environments",
15231523
"/Traces/01Getting_Started_with_Transaction_Tracing/Set_up_traces_collection_for_other_environments": "/docs/apm/traces/get-started-transaction-tracing/set-up-traces-collection-for-other-environments",
15241524
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation",
1525-
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/.NET_OpenTelemetry_auto-instrumentation": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net",
1526-
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/.NET_OpenTelemetry_auto-instrumentation/01NET_Core_TraceID_and_SpanID_Injection_into_Logs": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net/traceid-spanid-injection-into-logs",
1527-
"/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/java",
1525+
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/.NET_OpenTelemetry_auto-instrumentation": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet",
1526+
"/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/dotnet",
1527+
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/.NET_OpenTelemetry_auto-instrumentation/01NET_Core_TraceID_and_SpanID_Injection_into_Logs": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet/traceid-spanid-injection-into-logs",
15281528
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/AWS_Lambda_-_Java_function_instrumentation_with_Sumo_Logic_tracing": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/java",
15291529
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/AWS_Lambda_-_NodeJS_function_instrumentation_with_Sumo_Logic_tracing": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/nodejs",
15301530
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/AWS_Lambda_-_Python_function_instrumentation_with_Sumo_Logic_tracing": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/python",
@@ -1539,7 +1539,7 @@
15391539
"/docs/apm/traces/get-started-transaction-tracing/go": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/go",
15401540
"/docs/apm/traces/get-started-transaction-tracing/java": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/java",
15411541
"/docs/apm/traces/get-started-transaction-tracing/javascript": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/javascript",
1542-
"/docs/apm/traces/get-started-transaction-tracing/net": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net",
1542+
"/docs/apm/traces/get-started-transaction-tracing/net": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet",
15431543
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/Python_OpenTelemetry_auto-instrumentation": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/python",
15441544
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/Ruby_on_Rails_OpenTelemetry_auto-instrumentation": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/ruby-on-rails",
15451545
"/Traces/01Getting_Started_with_Transaction_Tracing/01Instrument_your_application_with_OpenTelemetry/Ruby_OpenTelemetry_auto-instrumentation": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/ruby",
@@ -4278,7 +4278,7 @@
42784278
"/Traces/Getting_Started_with_Transaction_Tracing/Set_up_traces_collection_for_other_environments": "/docs/apm/traces/get-started-transaction-tracing/set-up-traces-collection-for-other-environments",
42794279
"/Traces/Getting_Started_with_Transaction_Tracing/Working_with_spans_attributes": "/docs/apm/traces/advanced-configuration/working-with-span-attributes",
42804280
"/Traces/Getting_Started_with_Transaction_Tracing/Instrument_your_application_with_OpenTelemetry": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation",
4281-
"/Traces/Getting_Started_with_Transaction_Tracing/Instrument_your_application_with_OpenTelemetry/.NET_OpenTelemetry_auto-instrumentation": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net",
4281+
"/Traces/Getting_Started_with_Transaction_Tracing/Instrument_your_application_with_OpenTelemetry/.NET_OpenTelemetry_auto-instrumentation": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet",
42824282
"/Traces/Getting_Started_with_Transaction_Tracing/Instrument_your_application_with_OpenTelemetry/Java_OpenTelemetry_auto-instrumentation/TraceId_and_SpanId_injection_into_logs_configuration": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/java/traceid-spanid-injection-into-logs-configuration",
42834283
"/Traces/Getting_Started_with_Transaction_Tracing/Instrument_your_application_with_OpenTelemetry/Go_OpenTelemetry_auto-instrumentation": "/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/go",
42844284
"/Traces/Getting_Started_with_Transaction_Tracing/Set_up_traces_collection_for_Kubernetes_environments": "/docs/apm/traces/get-started-transaction-tracing/set-up-traces-collection-for-kubernetes-environments",

docs/apm/traces/advanced-configuration/correlate-logs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Our configurations, available in several programming languages, will inject the
3535
<div className="box smallbox card">
3636
<div className="container">
3737
<img src='https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/.NET_Core_Logo.svg/512px-.NET_Core_Logo.svg.png' alt="Thumbnail icon" width="60"/>
38-
<h4><a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net/traceid-spanid-injection-into-logs">.NET</a></h4>
38+
<h4><a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet/traceid-spanid-injection-into-logs">.NET</a></h4>
3939
<p>Injects data into user logs from ASP.NET & .NET core.</p>
4040
</div>
4141
</div>

docs/apm/traces/get-started-transaction-tracing/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Learn how to collect telemetry data from applications written in the following p
6666
<div className="box smallbox card">
6767
<div className="container">
6868
<img src='https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/.NET_Core_Logo.svg/512px-.NET_Core_Logo.svg.png' alt="Thumbnail icon" width="55"/>
69-
<h4><a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net">.NET</a></h4>
69+
<h4><a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet">.NET</a></h4>
7070
</div>
7171
</div>
7272
<div className="box smallbox card">
@@ -118,6 +118,12 @@ Learn how to install and configure OpenTelemetry distributed tracing for AWS Lam
118118
<img src='https://upload.wikimedia.org/wikipedia/commons/c/c3/Python-logo-notext.svg' alt="Thumbnail icon" width="50"/>
119119
<h4><a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/python">Python</a></h4>
120120
</div>
121+
</div>
122+
<div className="box smallbox card">
123+
<div className="container">
124+
<img src='https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/.NET_Core_Logo.svg/512px-.NET_Core_Logo.svg.png' alt="Thumbnail icon" width="55"/>
125+
<h4><a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/dotnet">Dotnet</a></h4>
126+
</div>
121127
</div>
122128
</div>
123129

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
id: dotnet
3+
title: AWS Lambda - .NET Function Instrumentation
4+
sidebar_label: .NET
5+
description: Learn how to install and configure OpenTelemetry distributed tracing for AWS .NET-based Lambda functions and send data to Sumo Logic.
6+
---
7+
8+
import useBaseUrl from '@docusaurus/useBaseUrl';
9+
import ApmTrace from '../../../../../reuse/apm-traces-layer-order.md';
10+
11+
This document covers how to install and configure OpenTelemetry distributed tracing for AWS Lambda functions based on .NET and send the data to Sumo Logic.
12+
13+
To obtain tracing data from AWS Lambda functions developed in .NET, you can use the following components
14+
15+
### Provided SDK
16+
17+
[OpenTelemetry Lambda SDK for .NET](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.AWSLambda) includes tracing APIs to instrument Lambda handlers and is provided on [NuGet](https://www.nuget.org/packages/OpenTelemetry.Instrumentation.AWSLambda).
18+
19+
### OpenTelemetry Lambda layer
20+
21+
[OpenTelemetry Lambda Layer for Collector](https://github.com/open-telemetry/opentelemetry-lambda/tree/main/collector#opentelemetry-collector-aws-lambda-extension-layer) includes OpenTelemetry Collector for Lambda components. Apply this layer to your Lambda handler that's already been instrumented with the OpenTelemetry Lambda .NET SDK to enable end-to-end tracing.
22+
23+
#### .NET Lambda layer supports
24+
25+
* .NET 6 SDK or later
26+
* x86_64 and arm64 architectures
27+
28+
### Lambda function requirements
29+
30+
You'll need the following:
31+
32+
* .NET 6 SDK or later
33+
* Lambda layers add permissions
34+
* Sumo Logic OTLP/HTTP Source endpoint URL - To send spans from the instrumented Lambda function to Sumo Logic you need an endpoint URL from an existing or new [OTLP/HTTP source](/docs/send-data/hosted-collectors/http-source/otlp).
35+
36+
## Quick Start
37+
38+
### Overview
39+
40+
<img src={useBaseUrl('img/apm/traces/lambda-dotnet-overview.png')} alt=".NET Lambda Overview" style={{border: '1px solid gray'}} width="800" />
41+
42+
### Prerequisites
43+
44+
* AWS CLI configured with appropriate permissions
45+
* Configure the [AWS credential](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
46+
* .NET 6 SDK
47+
* Sumo Logic OTLP endpoint URL
48+
49+
### Configure the lambda function
50+
51+
Navigate to [functions](https://console.aws.amazon.com/lambda/home#/functions) in the AWS Lambda Console and open the function you want to instrument.
52+
53+
* Navigate to the **Layers** section and click **Add a layer**.
54+
Use the following upstream [collector lambda layer](https://github.com/open-telemetry/opentelemetry-lambda/tree/main?tab=readme-ov-file#latest-layer-versions)
55+
56+
* `arn:aws:lambda:<region>:184161586896:layer:opentelemetry-collector-<amd64|arm64>-<version>:1`
57+
58+
* In the **Choose a layer** menu, select **Specify an ARN** and paste the above ARN ID for your Lambda function
59+
:::note
60+
Lambda layers are a regionalized resource, meaning that they can only be used in the Region in which they are published. Make sure to use the layer in the same region as your Lambda functions.
61+
:::
62+
63+
By default, OpenTelemetry Collector Lambda layer exports telemetry data to AWS backends. To customize the collector configuration, add a collector.yaml to your function and specify its location via the `OPENTELEMETRY_COLLECTOR_CONFIG_URI` environment file.
64+
65+
* Configure the collector layer to send data to SumoLogic:
66+
67+
```yaml
68+
receivers:
69+
otlp:
70+
protocols:
71+
grpc:
72+
endpoint: localhost:4317
73+
http:
74+
endpoint: localhost:4318
75+
76+
exporters:
77+
otlphttp:
78+
endpoint: ${SUMO_LOGIC_OTLP_ENDPOINT}
79+
headers:
80+
Content-Type: application/x-protobuf
81+
encoding: proto
82+
83+
service:
84+
pipelines:
85+
traces:
86+
receivers: [otlp]
87+
exporters: [otlphttp]
88+
```
89+
90+
Once the file has been deployed with a Lambda, configuring the `OPENTELEMETRY_COLLECTOR_CONFIG_URI` will tell the OpenTelemetry extension where to find the collector configuration:
91+
92+
```bash
93+
aws lambda update-function-configuration --function-name Function --environment Variables={OPENTELEMETRY_COLLECTOR_CONFIG_URI=/var/task/collector.yaml}
94+
```
95+
96+
* Configure the following environment variables:
97+
98+
Navigate to the **Configuration > Environment variables** section and ensure that the following environment variables are setup:
99+
100+
| Variable | Value | Purpose |
101+
|:---------|:------|:--------|
102+
| `OTEL_EXPORTER_OTLP_ENDPOINT` | `localhost:4318` | Collector endpoint |
103+
| `OTEL_EXPORTER_OTLP_PROTOCOL` | `http/protobuf` | Export protocol |
104+
| `AWS_LAMBDA_EXEC_WRAPPER` | `/opt/otel-instrument` | Lambda wrapper |
105+
| `SUMO_LOGIC_OTLP_ENDPOINT` | `https://your-endpoint.sumologic.net/receiver/v1/otlp/YOUR_TOKEN` | Sumo Logic endpoint |
106+
| `OPENTELEMETRY_COLLECTOR_CONFIG_URI` | `/var/task/collector.yaml` | Collector configuration |
107+
108+
Any other environment variables like `OTEL_RESOURCE_ATTRIBUTES` or `OTEL_SERVICE_NAME` could also be configured.
109+
110+
Your function should be successfully instrumented. Invoke the function and find your traces in the [Sumo Logic Tracing screen](/docs/apm/traces/view-and-investigate-traces)
111+
112+
## References
113+
114+
* [OpenTelemetry Lambda Layer Documentation](https://github.com/open-telemetry/opentelemetry-lambda)
115+
* [Sumo Logic OTLP Integration](https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/otlp/)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
slug: /apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda
3+
title: AWS Lambda Instrumentation
4+
sidebar_label: AWS Lambda
5+
description: Learn how to install and configure OpenTelemetry distributed tracing for AWS Lambda functions and send data to Sumo Logic.
6+
---
7+
8+
import useBaseUrl from '@docusaurus/useBaseUrl';
9+
10+
<img src={useBaseUrl('img/connection-and-integration/aws-lambda.svg')} alt="Thumbnail icon" width="45"/>
11+
12+
In this section, you'll learn how to install and configure OpenTelemetry distributed tracing for AWS Lambda functions written in various programming languages and send that data to Sumo Logic.
13+
14+
<div className="box-wrapper" markdown="1">
15+
<div className="box smallbox card">
16+
<div className="container">
17+
<a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/dotnet"><img src='https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/.NET_Core_Logo.svg/512px-.NET_Core_Logo.svg.png' alt="Thumbnail icon" width="55"/><h4>.NET</h4></a>
18+
</div>
19+
</div>
20+
<div className="box smallbox card">
21+
<div className="container">
22+
<a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/java"><img src='https://upload.wikimedia.org/wikipedia/en/thumb/3/30/Java_programming_language_logo.svg/131px-Java_programming_language_logo.svg.png' alt="Thumbnail icon" width="30"/><h4>Java</h4></a>
23+
</div>
24+
</div>
25+
<div className="box smallbox card">
26+
<div className="container">
27+
<a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/nodejs"><img src='https://upload.wikimedia.org/wikipedia/commons/d/d9/Node.js_logo.svg' alt="Thumbnail icon" width="95"/><h4>Node.js</h4></a>
28+
</div>
29+
</div>
30+
<div className="box smallbox card">
31+
<div className="container">
32+
<a href="/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/python"><img src='https://upload.wikimedia.org/wikipedia/commons/c/c3/Python-logo-notext.svg' alt="Thumbnail icon" width="50"/><h4>Python</h4></a>
33+
</div>
34+
</div>
35+
</div>

docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net/index.md renamed to docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
slug: /apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net
2+
slug: /apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet
33
title: .NET OpenTelemetry Auto-Instrumentation
44
sidebar_label: OpenTelemetry Auto-Instrumentation
55
description: The simplest way to start capturing telemetry data is to implement the solution coming from OpenTelemetry-dotNet.

sidebars.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,9 @@ module.exports = {
18171817
label: 'AWS Lambda',
18181818
collapsible: true,
18191819
collapsed: true,
1820+
link: {type: 'doc', id: 'apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/index'},
18201821
items: [
1822+
'apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/dotnet',
18211823
'apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/java',
18221824
'apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/nodejs',
18231825
'apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/python',
@@ -1862,8 +1864,8 @@ module.exports = {
18621864
collapsible: true,
18631865
collapsed: true,
18641866
items: [
1865-
'apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net/index',
1866-
'apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/net/traceid-spanid-injection-into-logs',
1867+
'apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet/index',
1868+
'apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/dotnet/traceid-spanid-injection-into-logs',
18671869
],
18681870
},
18691871
{
@@ -3117,7 +3119,7 @@ integrations: [
31173119
'api/about-apis/terraform-with-sumo-logic',
31183120
'api/about-apis/troubleshooting',
31193121
],
3120-
},
3122+
},
31213123
'api/access-keys',
31223124
'api/account-management',
31233125
'api/app-management',
32.1 KB
Loading

0 commit comments

Comments
 (0)