-
Notifications
You must be signed in to change notification settings - Fork 228
docs: Add documentation for sending traces with instrumentation of dotnet lambda functions #5876
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
54b8845
docs: Add documentation for sending traces with instrumentation of do…
rnishtala-sumo c5d30f0
Change the docs to use the upstream collector lambda layer
rnishtala-sumo 922a6e2
Changed .NET URL to dotnet and added aws-lamda index page (#5877)
kimsauce 240fae1
Add OPENTELEMETRY_COLLECTOR_CONFIG_URI to the environment variables
rnishtala-sumo e35ab7a
Reorganizing content under lambda configuration
rnishtala-sumo f3a06f8
Update the image to adhere style guide
rnishtala-sumo 99b4160
Remove /v1/traces from the sumologic endpoint
rnishtala-sumo 40ce719
Update the link to setup the sumologic otlp endpoint
rnishtala-sumo 3ef74c0
Merge branch 'main' into dotnet-lambda-docs
rnishtala-sumo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
...-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/dotnet.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| --- | ||
| id: dotnet | ||
| title: AWS Lambda - .NET Function Instrumentation | ||
| sidebar_label: .NET | ||
| description: Learn how to install and configure OpenTelemetry distributed tracing for AWS .NET-based Lambda functions and send data to Sumo Logic. | ||
| --- | ||
|
|
||
| import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
| import ApmTrace from '../../../../../reuse/apm-traces-layer-order.md'; | ||
|
|
||
| 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. | ||
|
|
||
| To obtain tracing data from AWS Lambda functions developed in .NET, you can use the following components | ||
|
|
||
| ### Provided SDK | ||
|
|
||
| [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). | ||
|
|
||
| ### OpenTelemetry Lambda layer | ||
|
|
||
| [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. | ||
|
|
||
| #### .NET Lambda layer supports | ||
|
|
||
| * .NET 6 SDK or later | ||
| * x86_64 and arm64 architectures | ||
|
|
||
| ### Lambda function requirements | ||
|
|
||
| You'll need the following: | ||
|
|
||
| * .NET 6 SDK or later | ||
| * Lambda layers add permissions | ||
| * 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). | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ### Overview | ||
|
|
||
| ```text | ||
| ┌─────────────────────┐ OTLP ┌──────────────────────┐ HTTP ┌─────────────┐ | ||
| │ .NET Lambda │ ────────► │ Collector Layer │ ────────► │ Sumo Logic │ | ||
| │ Function │ (default) │ (Lambda Extension) │ (protobuf) │ OTLP Endpoint│ | ||
| │ (Function.cs) │ │ localhost:4318 │ │ │ | ||
| └─────────────────────┘ └──────────────────────┘ └─────────────┘ | ||
| ``` | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| * AWS CLI configured with appropriate permissions | ||
| * Configure the [AWS credential](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) | ||
| * .NET 6 SDK | ||
| * Sumo Logic OTLP endpoint URL | ||
|
|
||
| ### OpenTelemetry Collector Lambda layer | ||
|
|
||
| Use the following upstream [collector lambda layer](https://github.com/open-telemetry/opentelemetry-lambda/tree/main?tab=readme-ov-file#latest-layer-versions) | ||
|
|
||
| * `arn:aws:lambda:<region>:184161586896:layer:opentelemetry-collector-<amd64|arm64>-<version>:1` | ||
|
|
||
| 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. | ||
|
|
||
| * Configure the collector layer to send data to SumoLogic: | ||
|
|
||
| ```yaml | ||
| receivers: | ||
| otlp: | ||
| protocols: | ||
| grpc: | ||
| endpoint: localhost:4317 | ||
| http: | ||
| endpoint: localhost:4318 | ||
|
|
||
| exporters: | ||
| otlphttp: | ||
| endpoint: ${SUMO_LOGIC_OTLP_ENDPOINT} | ||
| headers: | ||
| Content-Type: application/x-protobuf | ||
| encoding: proto | ||
|
|
||
| service: | ||
| pipelines: | ||
| traces: | ||
| receivers: [otlp] | ||
| exporters: [otlphttp] | ||
| ``` | ||
|
|
||
| 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: | ||
|
|
||
| ```bash | ||
| aws lambda update-function-configuration --function-name Function --environment Variables={OPENTELEMETRY_COLLECTOR_CONFIG_URI=/var/task/collector.yaml} | ||
| ``` | ||
|
|
||
| ### Configure the lambda function | ||
|
|
||
| Navigate to [functions](https://console.aws.amazon.com/lambda/home#/functions) in the AWS Lambda Console and open the function you want to instrument. | ||
|
|
||
| * Navigate to the **Layers** section and click **Add a layer**. | ||
| * In the **Choose a layer** menu, select **Specify an ARN** and paste the ARN ID for your Lambda function | ||
| :::note | ||
| 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. | ||
| ::: | ||
| * Configure the following environment variables: | ||
|
|
||
| Navigate to the **Configuration > Environment variables** section and ensure that the following environment variables are setup: | ||
|
|
||
| | Variable | Value | Purpose | | ||
| |:---------|:------|:--------| | ||
| | `OTEL_EXPORTER_OTLP_ENDPOINT` | `localhost:4318` | Collector endpoint | | ||
| | `OTEL_EXPORTER_OTLP_PROTOCOL` | `http/protobuf` | Export protocol | | ||
| | `AWS_LAMBDA_EXEC_WRAPPER` | `/opt/otel-instrument` | Lambda wrapper | | ||
| | `SUMO_LOGIC_OTLP_ENDPOINT` | `https://your-endpoint.sumologic.net/receiver/v1/otlp/YOUR_TOKEN/v1/traces` | Sumo Logic endpoint | | ||
| | `OPENTELEMETRY_COLLECTOR_CONFIG_URI` | `/var/task/collector.yaml` | Collector configuration | | ||
|
|
||
| Any other environment variables like `OTEL_RESOURCE_ATTRIBUTES` or `OTEL_SERVICE_NAME` could also be configured. | ||
|
|
||
| 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) | ||
|
|
||
| ## References | ||
|
|
||
| * [OpenTelemetry Lambda Layer Documentation](https://github.com/open-telemetry/opentelemetry-lambda) | ||
| * [Sumo Logic OTLP Integration](https://help.sumologic.com/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/) | ||
35 changes: 35 additions & 0 deletions
35
...t-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| slug: /apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/aws-lambda | ||
| title: AWS Lambda Instrumentation | ||
| sidebar_label: AWS Lambda | ||
| description: Learn how to install and configure OpenTelemetry distributed tracing for AWS Lambda functions and send data to Sumo Logic. | ||
| --- | ||
|
|
||
| import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
|
|
||
| <img src={useBaseUrl('img/connection-and-integration/aws-lambda.svg')} alt="Thumbnail icon" width="45"/> | ||
|
|
||
| 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. | ||
|
|
||
| <div className="box-wrapper" markdown="1"> | ||
| <div className="box smallbox card"> | ||
| <div className="container"> | ||
| <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> | ||
| </div> | ||
| </div> | ||
| <div className="box smallbox card"> | ||
| <div className="container"> | ||
| <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> | ||
| </div> | ||
| </div> | ||
| <div className="box smallbox card"> | ||
| <div className="container"> | ||
| <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> | ||
| </div> | ||
| </div> | ||
| <div className="box smallbox card"> | ||
| <div className="container"> | ||
| <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> | ||
| </div> | ||
| </div> | ||
| </div> |
2 changes: 1 addition & 1 deletion
2
...pentelemetry-instrumentation/net/index.md → ...telemetry-instrumentation/dotnet/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.