xk6-output-prometheus-remote icon indicating copy to clipboard operation
xk6-output-prometheus-remote copied to clipboard

feat: Add SigV4 support

Open rybbchao opened this issue 1 year ago • 2 comments

Add SigV4 support for #93.

Environment variables:

  • K6_PROMETHEUS_RW_SIGV4_AUTH: Enable SigV4 for AWS Managed Prometheus.
  • K6_PROMETHEUS_RW_SIGV4_REGION: AWS region where the workspace is.
  • K6_PROMETHEUS_RW_SIGV4_ACCESS_KEY: AWS access key.
  • K6_PROMETHEUS_RW_SIGV4_SECRET_KEY: AWS secret key.
  • K6_PROMETHEUS_RW_SIGV4_PROFILE: AWS profile to use.
  • K6_PROMETHEUS_RW_SIGV4_ROLE_ARN: AWS role ARN to assume.

Note: Set AWS_SDK_LOAD_CONFIG to true for the shared config and credential files.

rybbchao avatar Feb 02 '24 10:02 rybbchao

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 02 '24 10:02 CLAassistant

Looking at teh amount of dependancies this pulls in ... I am concerned.

I did a quick check and this adds 7mb on top of k6 for this one authentication. +Every security alert we get about all of those dependancies.

GIven that this currently goes in k6 core I really would prefer not to merge this.

Some quick googling shows that there are ways to get the authenticaiton without pulling in the whole aws sdk and I would recommend we actually go down this route

https://gist.github.com/anandkunal/b67eb94454b77cfc2b50026989586cc0

cc @codebien

edit:

$ xk6  build --output k6-remote-one  --with github.com/grafana/xk6-output-prometheus-remote@main
$ xk6 build --output k6-remove-sigv4  --with github.com/grafana/xk6-output-prometheus-remote=github.com/rybbchao/xk6-output-prometheus-remote@1b6d8863e4f3c1ce91b1419185faad6bb5d865db

$ ls -l k6-*
-rwxr-xr-x. 1 mstoykov mstoykov 37511320 Feb  8 18:03 k6-remote-one
-rwxr-xr-x. 1 mstoykov mstoykov 44818584 Feb  8 18:03 k6-remove-sigv4

mstoykov avatar Feb 08 '24 16:02 mstoykov

Hey @rybbchao, I'm going to close this issue as it seems is not under active development. Feel free to re-open if you find the time to re-work the changes.

Thanks for your contribution :bow:

codebien avatar Jul 03 '24 13:07 codebien