prometheus metrics, dynamic url creation#16
prometheus metrics, dynamic url creation#16TomerTcherniak wants to merge 1 commit intosktan:masterfrom
Conversation
Bumps [black](https://github.com/psf/black) from 22.3.0 to 24.3.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](psf/black@22.3.0...24.3.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
| } | ||
| // Set URL with an updated path based on the request | ||
| log.Printf("baseURL %s", CodeArtifactAuthInfo.Url) | ||
| CodeArtifactAuthInfo.Url = fmt.Sprintf("%s/%s", extractBaseURL(CodeArtifactAuthInfo.Url), strings.TrimPrefix(r.URL.Path, "/")) |
There was a problem hiding this comment.
Haven't had some time to look at or test this code yet, but are you able to explain what problem is being solved with these changes?
I am likely missing something, but it looks like we're over-writing the ProxyRequestHandler hooks everytime a request comes through.
There was a problem hiding this comment.
Hello Steven Tan,
Current project status supports only the "Repository Type" value.
The change i made is using "Repository Type" only for the health check.
I am rewriting ProxyRequestHandler to support multiple types during runtime.
For example if a specific team would like pip and not maven, currently it is hard coded maven by the "Repository Type" ENV param.
For example -
Currently status: proxy support only maven curl http://localhost:8080/maven/maven-central-store/group-id/artifact-id/version/artifact-id-version.jar.sha1
Change status:
The change allow to redirect request with artifact type
curl http://localhost:8080/maven/maven-central-store/group-id/artifact-id/version/artifact-id-version.jar.sha1
curl http://localhost:8080/pip/maven-central-store/group-id/artifact-id/version/artifact-id-version.jar.sha1
Allowing both pip and maven
Thanks
Tomer
|
hey @TomerTcherniak, thanks for your contribution! I've left a comment for you to respond to so that I can fully understand what results these changes are trying to achieve. |
Metrics
Supporting prometheus counters :
Prometheus endpoint is 8080 on /metrics
Multiple path support
It is dynamic url creation based on the request , supporting multiple paths.
CodeArtifactAuthInfo.Url = fmt.Sprintf("%s/%s", extractBaseURL(CodeArtifactAuthInfo.Url), strings.TrimPrefix(r.URL.Path, "/"))
Kubernetes deployments
svc.yaml and deployment.yaml which are found in deploy/kubernetes can be used to deploy.
The below env var should be set