opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

Add capability to rely on AWS prometheus on the prometheus-remote-write exporter

Open ashangit opened this issue 2 years ago • 3 comments
trafficstars

Description

AWS Managed Prometheus (https://aws.amazon.com/prometheus/) rely on SignV4 mechanism to authorise write This change add the capability to add SignV4 headers to the post request

Type of change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How Has This Been Tested?

  • [ ] Create an AWS Prometheus managed component Modified the opentelemetry-python-contrib/exporter/opentelemetry-exporter-prometheus-remote-write/example/sampleapp.py script to push metrics to the write endpoint of the created AWS prometheus managed and enable aws_prometheus
exporter = PrometheusRemoteWriteMetricsExporter(
    endpoint="https://aps-workspaces.eu-west-1.amazonaws.com/workspaces/ws-test/api/v1/remote_write",
    headers={"X-Scope-Org-ID": "5"},
    aws_prometheus=True
)

Execute this script with appropriate AWS credentials (right to push metrics to the AWS Prometheus) Check metrics are well pushed to the AWS prometheus (without the aws_prometheus=True the client report 403 errors)

  • [ ] Rely on this updated exporter in some of our AWS lambda and AWS batch jobs pushing metrics to an AWS Prometheus managed component Again check that metrics are well send to that component

Does This PR Require a Core Repo Change?

  • [ ] Yes. - Link to PR:
  • [X] No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • [ ] Followed the style guidelines of this project
  • [x] Changelogs have been updated
  • [X] Unit tests have been added
  • [ ] Documentation has been updated

ashangit avatar Dec 23 '22 13:12 ashangit