-
Notifications
You must be signed in to change notification settings - Fork 148
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
Go lambda support #129
Go lambda support #129
Conversation
…lambda into go-lambda-support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocked on contrib #983, contrib #984, and aws-otel.github.io #142
TODO: see comments
go/README.md
Outdated
[OpenTelemetry Lambda SDK for Go]() includes tracing APIs to instrument Lambda handler. Follow the instructions on [user guide]() to manually instrument the Lambda handler. | ||
For other instrumentations, such as http, you'll need to include the corresponding library instrumentation from the [instrumentation project](https://github.com/open-telemetry/opentelemetry-go) and modify your code to use it in your function. | ||
|
||
## Provided Layer | ||
|
||
[OpenTelemetry Lambda Layer for Collector]() includes OpenTelemetry Collector for Lambda components. Follow [user guide]() to apply this layer to your Lambda handler that's already been instrumented with OpenTelemetry Lambda Go SDK to enable end-to-end tracing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Links need to be inserted once the targets exist. These should be correct:
[OpenTelemetry Lambda SDK for Go]() includes tracing APIs to instrument Lambda handler. Follow the instructions on [user guide]() to manually instrument the Lambda handler. | |
For other instrumentations, such as http, you'll need to include the corresponding library instrumentation from the [instrumentation project](https://github.com/open-telemetry/opentelemetry-go) and modify your code to use it in your function. | |
## Provided Layer | |
[OpenTelemetry Lambda Layer for Collector]() includes OpenTelemetry Collector for Lambda components. Follow [user guide]() to apply this layer to your Lambda handler that's already been instrumented with OpenTelemetry Lambda Go SDK to enable end-to-end tracing. | |
[OpenTelemetry Lambda SDK for Go](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/github.com/aws/aws-lambda-go/otellambda) includes tracing APIs to instrument Lambda handler. Follow the instructions on [user guide]() to manually instrument the Lambda handler. | |
For other instrumentations, such as http, you'll need to include the corresponding library instrumentation from the [instrumentation project](https://github.com/open-telemetry/opentelemetry-go) and modify your code to use it in your function. | |
## Provided Layer | |
[OpenTelemetry Lambda Layer for Collector](https://aws-otel.github.io/docs/getting-started/lambda/lambda-go#lambda-layer) includes OpenTelemetry Collector for Lambda components. Follow [user guide](https://aws-otel.github.io/docs/getting-started/lambda/lambda-go#instrumentation) to apply this layer to your Lambda handler that's already been instrumented with OpenTelemetry Lambda Go SDK to enable end-to-end tracing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove the section for the Provided layer because it is vendor-specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also should remove reference to user guide. We should have a section on building the layer if possible like other layers have instead? E.g. https://github.com/open-telemetry/opentelemetry-lambda/tree/main/java#building
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. I think we should keep the guide since it's brief - https://github.com/aws-otel/aws-otel.github.io/pull/142/files. I also think rather than having documentation at 2 places we should only put it in a single place (official docs) which is easier to maintain. Also, sometime just in case if we update official doc and missed updating READEME it would confuse customers.
go/README.md
Outdated
|
||
## Sample application | ||
|
||
The [sample application]() shows the manual instrumentations of OpenTelemetry Lambda .NET SDK on a Lambda handler that triggers downstream requests to AWS S3 and HTTP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link also needs to be populated but is a little different because it points into the PR, can either just do the end goal url ("https://github.com/open-telemetry/opentelemetry-lambda/blob/main/go/sample-apps/function/function.go") or just a relative path ("./sample-apps/function/function.go").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [sample application]() shows the manual instrumentations of OpenTelemetry Lambda .NET SDK on a Lambda handler that triggers downstream requests to AWS S3 and HTTP. | |
The [sample application]() shows the manual instrumentations of OpenTelemetry Lambda Go SDK on a Lambda handler that triggers downstream requests to AWS S3 and HTTP. |
go/sample-apps/function/go.mod
Outdated
replace ( | ||
go.opentelemetry.io/contrib/detectors/aws/lambda => github.com/garrettwegan/opentelemetry-go-contrib/detectors/aws/lambda v0.0.0-20210730164323-986e366f4c23 | ||
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda => github.com/garrettwegan/opentelemetry-go-contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.0.0-20210730164323-986e366f4c23 | ||
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig => github.com/garrettwegan/opentelemetry-go-contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig v0.0.0-20210730201622-eef81a9505f4 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to upgrade to latest versions of OTel go dependencies (1.0.0+)
go/sample-apps/function/function.go
Outdated
|
||
func main() { | ||
lambda.Start(otellambda.WrapHandlerFunction(lambda_handler, xrayconfig.AllRecommendedOptions()...)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few callouts we can change once this PR is unblocked
go/README.md
Outdated
[OpenTelemetry Lambda SDK for Go]() includes tracing APIs to instrument Lambda handler. Follow the instructions on [user guide]() to manually instrument the Lambda handler. | ||
For other instrumentations, such as http, you'll need to include the corresponding library instrumentation from the [instrumentation project](https://github.com/open-telemetry/opentelemetry-go) and modify your code to use it in your function. | ||
|
||
## Provided Layer | ||
|
||
[OpenTelemetry Lambda Layer for Collector]() includes OpenTelemetry Collector for Lambda components. Follow [user guide]() to apply this layer to your Lambda handler that's already been instrumented with OpenTelemetry Lambda Go SDK to enable end-to-end tracing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove the section for the Provided layer because it is vendor-specific.
go/README.md
Outdated
|
||
## Sample application | ||
|
||
The [sample application]() shows the manual instrumentations of OpenTelemetry Lambda .NET SDK on a Lambda handler that triggers downstream requests to AWS S3 and HTTP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [sample application]() shows the manual instrumentations of OpenTelemetry Lambda .NET SDK on a Lambda handler that triggers downstream requests to AWS S3 and HTTP. | |
The [sample application]() shows the manual instrumentations of OpenTelemetry Lambda Go SDK on a Lambda handler that triggers downstream requests to AWS S3 and HTTP. |
go/sample-apps/deploy/variables.tf
Outdated
variable "collector_layer_arn" { | ||
type = string | ||
description = "ARN for the Lambda layer containing the OpenTelemetry collector extension" | ||
default = "arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-collector-ver-0-27-0:1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to update this to latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default = "arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-collector-ver-0-27-0:1" | |
default = "arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-collector-ver-0-29-1:1" |
go/sample-apps/function/go.mod
Outdated
replace ( | ||
go.opentelemetry.io/contrib/detectors/aws/lambda => github.com/garrettwegan/opentelemetry-go-contrib/detectors/aws/lambda v0.0.0-20210730164323-986e366f4c23 | ||
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda => github.com/garrettwegan/opentelemetry-go-contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda v0.0.0-20210730164323-986e366f4c23 | ||
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig => github.com/garrettwegan/opentelemetry-go-contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig v0.0.0-20210730201622-eef81a9505f4 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to upgrade to latest versions of OTel go dependencies (1.0.0+)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more comments, then lgtm
go/README.md
Outdated
|
||
## Sample application | ||
|
||
The [sample application]() shows the manual instrumentations of OpenTelemetry Lambda Go SDK on a Lambda handler that triggers downstream requests to AWS S3 and HTTP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link the sample app here.
go/README.md
Outdated
|
||
## Provided SDK | ||
|
||
[OpenTelemetry Lambda SDK for Go](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/github.com/aws/aws-lambda-go/otellambda) includes tracing APIs to instrument Lambda handler. Follow the instructions on [user guide](https://aws-otel.github.io/docs/getting-started/lambda/lambda-go) to manually instrument the Lambda handler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[OpenTelemetry Lambda SDK for Go](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/github.com/aws/aws-lambda-go/otellambda) includes tracing APIs to instrument Lambda handler. Follow the instructions on [user guide](https://aws-otel.github.io/docs/getting-started/lambda/lambda-go) to manually instrument the Lambda handler. | |
[OpenTelemetry Lambda SDK for Go](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/github.com/aws/aws-lambda-go/otellambda) includes tracing APIs to instrument Lambda handler. |
Can't have anything vendor-specific
go/sample-apps/deploy/variables.tf
Outdated
variable "collector_layer_arn" { | ||
type = string | ||
description = "ARN for the Lambda layer containing the OpenTelemetry collector extension" | ||
default = "arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-collector-ver-0-27-0:1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default = "arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-collector-ver-0-27-0:1" | |
default = "arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-collector-ver-0-29-1:1" |
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
Draft as replaces Otel go contrib with forked repo for otellambda package as otellambda is not merged into contrib yet. See PR here: open-telemetry/opentelemetry-go-contrib#882