-
Notifications
You must be signed in to change notification settings - Fork 170
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
Working version for Lambda - AWS Managed Prometheus integration #248
Conversation
|
collector/config.yaml
Outdated
awsprometheusremotewrite: | ||
endpoint: "https://aps-workspaces.eu-west-1.amazonaws.com/workspaces/ws-12345678-1234-1234-1234-123456789012/api/v1/remote_write" | ||
aws_auth: | ||
service: "aps" | ||
region: "eu-west-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.
Is this a real endpoint that is used? If it's not, would this cause a problem if downstream repositories are using this file?
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.
I suspect this should be replaced with actual workspace from customer.
I think one addition to the PR would be a readme/documentation about what is added and how to use it
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 was a sample number to show how to fill the endpoint URL - I will add a comment
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.
Rather than changing the default configuration here, perhaps include a configuration with the sample app that includes its use. Also, note that the awsprometheusremotewrite
exporter is deprecated and should instead use the prometheusremotewrite
exporter and sigv4auth
extension for authentication.
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.
Thank you @Aneurysm9 - I'll update those
collector/config.yaml
Outdated
awsprometheusremotewrite: | ||
endpoint: "https://aps-workspaces.eu-west-1.amazonaws.com/workspaces/ws-12345678-1234-1234-1234-123456789012/api/v1/remote_write" | ||
aws_auth: | ||
service: "aps" | ||
region: "eu-west-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.
Rather than changing the default configuration here, perhaps include a configuration with the sample app that includes its use. Also, note that the awsprometheusremotewrite
exporter is deprecated and should instead use the prometheusremotewrite
exporter and sigv4auth
extension for authentication.
@pcolazurdo Are you able to fix the unit tests? I'll defer to @Aneurysm9 for the approval here 🙂 |
* Update Collector version to 0.54.0 * Update to go version 1.18
Updated to match latest commit on main. Some comments:
|
Hi @pcolazurdo, can you clarify on your first point? The |
@erichsueh3 I've tried initialising the extension and I just get an extension crash on Lambda. As soon as I add: extensions:
sigv4auth:
region: "us-west-2"
...
service:
extensions: [sigv4auth] I get:
Also, looking in the source code in the repo for |
@@ -23,6 +23,7 @@ import ( | |||
"go.opentelemetry.io/collector/receiver/otlpreceiver" | |||
"go.uber.org/multierr" | |||
|
|||
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsprometheusremotewriteexporter" |
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 sigv4auth
extension should be added here rather than the awsprometheusremotewrite
exporter.
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.
I didn't find the right way to add it. Looking at the code in the collector directory and the code in https://github.com/aws-observability/aws-otel-collector regarding the extensions - specifically this , they look different (no ExtensionFactoryMap is present) so I didn't know what the strategy to add extensions in this stripped-down version was. Adding awsprometheuswriter
was straightforward and didn't need major modifications in the existing collector. It looks like we I could to sync the code in https://github.com/aws-observability/aws-otel-collector/tree/2d4dd74947dc95826001a82e23a51c47a2d7f43b/pkg/lambdacomponents with the code here? I think this should be a totally different PR, am I right?
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.
You can add the ExtensionFactoryMap in this PR, and add the sigv4
extension instead of the awsprometheusremotewrite
exporter, it doesn't have to be in a separate PR
Environment: | ||
Variables: | ||
AWS_LAMBDA_EXEC_WRAPPER: /opt/python/otel-instrument | ||
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python # needed because https://github.com/open-telemetry/opentelemetry-python/issues/2717 / when new release of library is released this should be solved and can be removed |
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 issue is now resolved as the opentelemetry-python
has pinned the protobuf version.
This example in the PR is really helpful.
|
Lot has changed in the project since I built this demo and now. It served its purpose but it is now mostly obsolete. I'll close this for now to avoid people getting confused, and try to create a new one in the coming weeks (no promise) |
This PR shows a fully working Lambda function based on Python sending metrics to AWS Managed Prometheus using an OTel Layer.
A few comments:
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python
in thetemplate.yaml
for the function.metrics
api as internal, that's why_metrics
is used. Once the next stable version is released, I'll update the code with a new PR.