Skip to content
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

add managed prometheus + workspace endpoints support #69

Merged
merged 2 commits into from
Aug 26, 2022

Conversation

jafferli
Copy link
Contributor

fix the issue when prometheus workspace access, it will show the error of unable to proxy request - unable to determine service from host: aps-workspaces.REGION.amazonaws.com

Description of changes:
add explicit mapping for aps-workspaces to aps with sigv4 support.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

handler/aws.go Outdated
@@ -47,6 +47,14 @@ func init() {
host := fmt.Sprintf("%s.es.amazonaws.com", region)
services[host] = endpoints.ResolvedEndpoint{URL: fmt.Sprintf("https://%s", host), SigningMethod: "v4", SigningRegion: region, SigningName: "es", PartitionID: "aws"}
}
// Add managed prometheus + workspace endpoints
for region := range endpoints.AwsPartition().Regions() {
host_aps := fmt.Sprintf("aps.%s.amazonaws.com", region)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to use here camelCase notation as a guideline in go

@mazzy89
Copy link

mazzy89 commented Aug 25, 2022

Btw I've tested this locally and it works for me.

@alvinlin123
Copy link
Collaborator

alvinlin123 commented Aug 26, 2022

This is great @jafferli. Can you address @mazzy89's comment then I can merge this one.

By the way before this change is released, existing versions of proxy can combination of --host and --name can be used for managed prometheus workspace. However, this PR adds much more flexibility to the proxy.

update camel case as recommended by mazzy89.
@jafferli
Copy link
Contributor Author

update with camel case as @mazzy89 suggested.

@jafferli jafferli requested a review from mazzy89 August 26, 2022 16:37
@alvinlin123 alvinlin123 merged commit c1ff099 into awslabs:master Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants