-
Notifications
You must be signed in to change notification settings - Fork 11
feat: add observability proxy #3332
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d68c587
Flip to using DNSCluster for cluster discovery
michaeljguarino 006f0a0
feat(observability-proxy): add initial setup with CI/CD integration a…
floreks 55d6e55
docs(observability-proxy): fix relative link in README.md to logging …
floreks c09804b
`refactor(observability-proxy): remove IP rate limiting logic and its…
floreks 9f8593a
chore(observability-proxy): remove ratelimit import and add bin to .g…
floreks 329a4d5
refactor(observability-proxy): remove rate limiting logic and tests, …
floreks 5aec6c0
Merge remote-tracking branch 'origin/master' into sebastian/prod-4541…
floreks b9031b8
`feat(observability-proxy): enhance with E2E tests and refactor mock …
floreks 9393645
`chore(docker-compose): remove default mock hosts for observability-p…
floreks 959a705
Merge remote-tracking branch 'origin/master' into sebastian/prod-4541…
floreks fe63cd9
`chore(observability-proxy): remove unused mock-upstream application`
floreks 4ee2629
Merge remote-tracking branch 'origin/master' into sebastian/prod-4541…
floreks 3a1e12e
feat(observability-proxy): add metering metrics and update Prometheus…
floreks 5dd381b
refactor(observability-proxy): restructure main logic with run functi…
floreks e6391bf
feat(observability-proxy): introduce elastic bulk write service in do…
floreks f5ec72d
refactor(Dockerfile): enhance build process with architecture variabl…
floreks 17ec477
refactor(observability-proxy): replace query metrics with metering in…
floreks 6bdc778
`fix(metering): handle metering error gracefully in meter function`
floreks 3302d7f
feat(observability-proxy): implement caching deduplication and method…
floreks 0f44f01
feat(console): add NetworkPolicy for internal ports
floreks c5dfd60
feat(observability-proxy): enhance request byte counting and CI/CD wo…
floreks 6b6ffc6
feat(observability-proxy): improve server startup and shutdown handling
floreks 50b36ea
feat(console): update NetworkPolicy and service configurations
floreks 74361b1
`refactor(observability-proxy): replace groupcache with x/sync for im…
floreks ae3f738
feat(observability-proxy): update Kubernetes labels
floreks 8cdd84a
fix(observability-proxy): correct service labels for consistent deplo…
floreks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,210 @@ | ||
| name: CD / Observability Proxy | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Tag to deploy" | ||
| required: true | ||
| push: | ||
| branches: | ||
| - "master" | ||
| tags: | ||
| - "v*.*.*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| GOPATH: /home/runner/go | ||
| GOBIN: /home/runner/go/bin | ||
| GOPROXY: "https://proxy.golang.org" | ||
| REGISTRY_IMAGE: ghcr.io/pluralsh/observability-proxy | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Unit test | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| working-directory: go/observability-proxy | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go/observability-proxy/go.mod | ||
| cache: true | ||
| - run: go mod download | ||
| - run: GOCACHE=/tmp/go-build go test ./... | ||
|
|
||
| build-observability-proxy: | ||
| name: Build observability-proxy image | ||
| needs: [test] | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| packages: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| platforms: | ||
| - platform: linux/amd64 | ||
| runner: ubuntu-24.04 | ||
| - platform: linux/arm64 | ||
| runner: ubuntu-24.04-arm | ||
| runs-on: ${{ matrix.platforms.runner }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Prepare | ||
| run: | | ||
| platform=${{ matrix.platforms.platform }} | ||
| echo "PLATFORM_PAIR=${platform//\//-}" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Docker meta | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY_IMAGE }} | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - uses: google-github-actions/auth@v1 | ||
| with: | ||
| workload_identity_provider: "projects/${{ secrets.GOOGLE_PROJECT_ID }}/locations/global/workloadIdentityPools/github/providers/github" | ||
| service_account: "terraform@pluralsh.iam.gserviceaccount.com" | ||
| token_format: "access_token" | ||
| create_credentials_file: true | ||
|
|
||
| - uses: google-github-actions/setup-gcloud@v1.0.1 | ||
|
|
||
| - name: Login to GCR | ||
| run: gcloud auth configure-docker -q | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: mjgpluralsh | ||
| password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build and push by digest | ||
| id: build | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: ./go/observability-proxy | ||
| file: ./go/observability-proxy/Dockerfile | ||
| tags: ${{ env.REGISTRY_IMAGE }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| platforms: ${{ matrix.platforms.platform }} | ||
| outputs: type=image,push-by-digest=true,name-canonical=true,push=true | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Export digest | ||
| run: | | ||
| mkdir -p "${{ runner.temp }}/digests" | ||
| digest="${{ steps.build.outputs.digest }}" | ||
| touch "${{ runner.temp }}/digests/${digest#sha256:}" | ||
|
|
||
| - name: Upload digest | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: digests-observability-proxy-${{ env.PLATFORM_PAIR }}-${{ github.run_id }} | ||
| path: ${{ runner.temp }}/digests/* | ||
| if-no-files-found: error | ||
| retention-days: 1 | ||
|
|
||
| publish-observability-proxy: | ||
| name: Publish observability-proxy image | ||
| needs: [build-observability-proxy] | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| packages: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| images: | ||
| - ghcr.io/pluralsh/observability-proxy | ||
| - gcr.io/pluralsh/observability-proxy | ||
| - docker.io/pluralsh/observability-proxy | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Download digests | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| path: ${{ runner.temp }}/digests | ||
| pattern: digests-observability-proxy-* | ||
| merge-multiple: true | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - uses: google-github-actions/auth@v1 | ||
| with: | ||
| workload_identity_provider: "projects/${{ secrets.GOOGLE_PROJECT_ID }}/locations/global/workloadIdentityPools/github/providers/github" | ||
| service_account: "terraform@pluralsh.iam.gserviceaccount.com" | ||
| token_format: "access_token" | ||
| create_credentials_file: true | ||
|
|
||
| - uses: google-github-actions/setup-gcloud@v1.0.1 | ||
|
|
||
| - name: Login to GCR | ||
| run: gcloud auth configure-docker -q | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: mjgpluralsh | ||
| password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Resolve tag version | ||
| id: tag_version | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| run: | | ||
| echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Docker meta | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ matrix.images }} | ||
| tags: | | ||
| type=ref,event=branch | ||
| type=ref,event=pr | ||
| type=sha | ||
| type=semver,pattern={{version}},value=${{ steps.tag_version.outputs.version }},enable=${{ steps.tag_version.outputs.version != '' }} | ||
| type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event.inputs.tag != '' }} | ||
|
|
||
| - name: Create manifest list and push | ||
| working-directory: ${{ runner.temp }}/digests | ||
| run: | | ||
| docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
| $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) | ||
|
|
||
| - name: Inspect image | ||
| run: | | ||
| docker buildx imagetools inspect ${{ matrix.images }}:${{ steps.meta.outputs.version }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| name: CI / Observability Proxy | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - "**" | ||
| paths: | ||
| - ".github/workflows/observability-proxy-ci.yaml" | ||
| - "go/observability-proxy/**" | ||
| - "proto/console.proto" | ||
|
|
||
| env: | ||
| GOPATH: /home/runner/go/ | ||
| GOPROXY: "https://proxy.golang.org" | ||
| REGISTRY_IMAGE: ghcr.io/pluralsh/observability-proxy | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go/observability-proxy/go.mod | ||
|
|
||
| - name: Run tests | ||
| run: GOCACHE=/tmp/go-build go test ./... | ||
| working-directory: go/observability-proxy | ||
|
|
||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go/observability-proxy/go.mod | ||
|
|
||
| - name: Build binary | ||
| run: make build | ||
| working-directory: go/observability-proxy | ||
|
|
||
| build-image: | ||
| name: Build image | ||
| if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
| needs: [build, test] | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| platforms: | ||
| - platform: linux/amd64 | ||
| runner: ubuntu-24.04 | ||
| - platform: linux/arm64 | ||
| runner: ubuntu-24.04-arm | ||
| runs-on: ${{ matrix.platforms.runner }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Prepare | ||
| run: | | ||
| platform=${{ matrix.platforms.platform }} | ||
| echo "PLATFORM_PAIR=${platform//\//-}" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Docker meta | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY_IMAGE }} | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push by digest | ||
| id: build | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: go/observability-proxy | ||
| file: go/observability-proxy/Dockerfile | ||
| tags: ${{ env.REGISTRY_IMAGE }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| platforms: ${{ matrix.platforms.platform }} | ||
| outputs: type=image,push-by-digest=true,name-canonical=true,push=true | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Export digest | ||
| run: | | ||
| mkdir -p "${{ runner.temp }}/digests" | ||
| digest="${{ steps.build.outputs.digest }}" | ||
| touch "${{ runner.temp }}/digests/${digest#sha256:}" | ||
|
|
||
| - name: Upload digest | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: digests-observability-proxy-${{ env.PLATFORM_PAIR }} | ||
| path: ${{ runner.temp }}/digests/* | ||
| if-no-files-found: error | ||
| retention-days: 1 | ||
|
|
||
| publish-image: | ||
| name: Publish PR image | ||
| if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
| needs: [build-image] | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - name: Download digests | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| path: ${{ runner.temp }}/digests | ||
| pattern: digests-observability-proxy-* | ||
| merge-multiple: true | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Docker meta | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY_IMAGE }} | ||
| tags: | | ||
| type=sha | ||
| type=ref,event=pr | ||
| type=raw,value=pr-${{ github.event.pull_request.number }} | ||
|
|
||
| - name: Create manifest list and push | ||
| working-directory: ${{ runner.temp }}/digests | ||
| run: | | ||
| docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
| $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.