From 20cd085d5630506bea12639e5bd9f1e646eab661 Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 5 May 2022 10:37:24 -0700 Subject: [PATCH 01/37] adding dockerfile and config for dd-agent forking dd-agent repo and targeting dockerfile for flyio Updating dd-agent action to use dd-agent as working directory Merge --- .github/workflows/build-and-publish.yaml | 9 ++++++--- .gitmodules | 3 +++ dd-agent | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .gitmodules create mode 160000 dd-agent diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 6f5fb48..b465ef1 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -41,7 +41,7 @@ jobs: with: go-version: '^1.17.4' - - run: sudo apt-get -qq -y install + - run: sudo apt-get -qq -y install - name: Run GoReleaser uses: goreleaser/goreleaser-action@v1 @@ -81,9 +81,12 @@ jobs: needs: flyio if: startsWith(github.ref, 'refs/tags/v') steps: + - name: download-dd-artifact + working-directory: dd-agent + run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 + working-directory: dd-agent with: - args: deploy --app dd-agent --image gcr.io/datadoghq/agent:7 -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true + args: deploy --app dd-agent --build-args DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --dockerfile ./Dockerfiles/agent/amd64/Dockerfile -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} - diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..48b3731 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "dd-agent"] + path = dd-agent + url = https://github.com/DataDog/datadog-agent diff --git a/dd-agent b/dd-agent new file mode 160000 index 0000000..364843c --- /dev/null +++ b/dd-agent @@ -0,0 +1 @@ +Subproject commit 364843c9e82272dd0b71276b5888d8ff89b1511c From dd4e9a670a5f6cc8745dd01e5b42638fa344ff4a Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 5 May 2022 11:39:03 -0700 Subject: [PATCH 02/37] temp remove filter for dd-agent job to push w/o tagging for testing moving fly cfg out of submodule to commit Merge --- .github/workflows/build-and-publish.yaml | 2 +- dd-fly-cfg/fly.toml | 45 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 dd-fly-cfg/fly.toml diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index b465ef1..9e0205b 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -79,7 +79,7 @@ jobs: flyio-dd-agent: runs-on: ubuntu-latest needs: flyio - if: startsWith(github.ref, 'refs/tags/v') + # if: startsWith(github.ref, 'refs/tags/v') steps: - name: download-dd-artifact working-directory: dd-agent diff --git a/dd-fly-cfg/fly.toml b/dd-fly-cfg/fly.toml new file mode 100644 index 0000000..a21dd1a --- /dev/null +++ b/dd-fly-cfg/fly.toml @@ -0,0 +1,45 @@ +# fly.toml file generated for dd-agent on 2022-05-05T11:33:31-07:00 + +app = "dd-agent" + +kill_signal = "SIGINT" +kill_timeout = 5 +processes = [] + +[env] + PORT = "8080" + +[experimental] + allowed_public_ports = [] + auto_rollback = true + +[[services]] + http_checks = [] + internal_port = 8080 + processes = ["app"] + protocol = "tcp" + script_checks = [] + + [services.concurrency] + hard_limit = 25 + soft_limit = 20 + type = "connections" + + [[services.ports]] + force_https = true + handlers = ["http"] + port = 80 + + [[services.ports]] + handlers = ["tls", "http"] + port = 443 + + [[services.tcp_checks]] + grace_period = "1s" + interval = "15s" + restart_limit = 0 + timeout = "2s" + +[[statics]] + guest_path = "/app/public" + url_prefix = "/static/" From 5e5d2280d249b7ae78fe614bc8d4e4490411a56d Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 5 May 2022 11:45:44 -0700 Subject: [PATCH 03/37] moving fly cfg out of submodule to commit temp remove filter for dd-agent job to push w/o tagging for testing typo updating action Typo checkout repo so we have artifact to build from unshallowing git checkout to gain access to dd-agent submodule in actions typo removed submodule in favor of checking out in github actions from the source copying dockerfile into working directory so it can find necessary files typo adding git ref to dd-agent repo checkout typo typo descend into repo once checked out. root dir is not correct for dockerfile build descend into repo once checked out. root dir is not correct for dockerfile build Updating flyctl deploy command to target Dockerfiles/agent subdirectory curling dd-agent artifact to correct directory typo Testing Dockerfile Pattern --- .github/workflows/build-and-publish.yaml | 14 ++++++++------ dd-agent | 1 - dd-fly-cfg/fly.toml => dd-fly.toml | 0 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 160000 dd-agent rename dd-fly-cfg/fly.toml => dd-fly.toml (100%) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 9e0205b..f4cf603 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -78,15 +78,17 @@ jobs: flyio-dd-agent: runs-on: ubuntu-latest - needs: flyio + # needs: flyio # if: startsWith(github.ref, 'refs/tags/v') steps: - - name: download-dd-artifact - working-directory: dd-agent - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb + - uses: actions/checkout@v2 + with: + repository: 'DataDog/datadog-agent' + ref: '7.35.2' + - run: git fetch --prune --unshallow + - run: cd Dockerfiles/agent && cp amd64/Dockerfile ./dd-agent.Dockerfile && curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 - working-directory: dd-agent with: - args: deploy --app dd-agent --build-args DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --dockerfile ./Dockerfiles/agent/amd64/Dockerfile -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true + args: deploy Dockerfiles/agent/ --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --dockerfile ./dd-agent.Dockerfile -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/dd-agent b/dd-agent deleted file mode 160000 index 364843c..0000000 --- a/dd-agent +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 364843c9e82272dd0b71276b5888d8ff89b1511c diff --git a/dd-fly-cfg/fly.toml b/dd-fly.toml similarity index 100% rename from dd-fly-cfg/fly.toml rename to dd-fly.toml From 7ecc4b7a94105bdf7d671332ec8d286420b6c6be Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 5 May 2022 18:56:22 -0700 Subject: [PATCH 04/37] relying on image again taking out repo, have dd-fly toml so that should be enough typo typo typo Deprecating Dockerfile pattern --- .github/workflows/build-and-publish.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index f4cf603..29594f7 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -81,14 +81,9 @@ jobs: # needs: flyio # if: startsWith(github.ref, 'refs/tags/v') steps: - - uses: actions/checkout@v2 - with: - repository: 'DataDog/datadog-agent' - ref: '7.35.2' - - run: git fetch --prune --unshallow - - run: cd Dockerfiles/agent && cp amd64/Dockerfile ./dd-agent.Dockerfile && curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb + - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 with: - args: deploy Dockerfiles/agent/ --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --dockerfile ./dd-agent.Dockerfile -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true + args: deploy --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --image datadog/agent:7 -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} From 5f6af6a568e6a2f0cfa10cda01eddcefb7daf5db Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 5 May 2022 19:33:59 -0700 Subject: [PATCH 05/37] increase timeout time --- dd-fly.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dd-fly.toml b/dd-fly.toml index a21dd1a..60a40bb 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -35,7 +35,7 @@ processes = [] port = 443 [[services.tcp_checks]] - grace_period = "1s" + grace_period = "30s" interval = "15s" restart_limit = 0 timeout = "2s" From 06a009c8270b21f7d173db6fa4516ae83cb55255 Mon Sep 17 00:00:00 2001 From: Chase Date: Fri, 6 May 2022 08:53:07 -0700 Subject: [PATCH 06/37] Updating port info dd-fly.toml removing tcp checks More fly.toml updates --- dd-fly.toml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/dd-fly.toml b/dd-fly.toml index 60a40bb..648ac78 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -7,7 +7,7 @@ kill_timeout = 5 processes = [] [env] - PORT = "8080" + PORT = "8126" [experimental] allowed_public_ports = [] @@ -15,7 +15,7 @@ processes = [] [[services]] http_checks = [] - internal_port = 8080 + internal_port = 8126 processes = ["app"] protocol = "tcp" script_checks = [] @@ -34,12 +34,6 @@ processes = [] handlers = ["tls", "http"] port = 443 - [[services.tcp_checks]] - grace_period = "30s" - interval = "15s" - restart_limit = 0 - timeout = "2s" - [[statics]] guest_path = "/app/public" url_prefix = "/static/" From c645e0595b78fcb232ee40151f00c0fdea819c14 Mon Sep 17 00:00:00 2001 From: Chase Date: Fri, 6 May 2022 14:36:45 -0700 Subject: [PATCH 07/37] Fixing datadog agent healthcheck --- .github/workflows/build-and-publish.yaml | 4 ++-- dd-fly.toml | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 29594f7..3704597 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -78,8 +78,8 @@ jobs: flyio-dd-agent: runs-on: ubuntu-latest - # needs: flyio - # if: startsWith(github.ref, 'refs/tags/v') + needs: flyio + if: startsWith(github.ref, 'refs/tags/v') steps: - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 diff --git a/dd-fly.toml b/dd-fly.toml index 648ac78..8eebbf3 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -14,11 +14,9 @@ processes = [] auto_rollback = true [[services]] - http_checks = [] internal_port = 8126 processes = ["app"] protocol = "tcp" - script_checks = [] [services.concurrency] hard_limit = 25 @@ -32,7 +30,13 @@ processes = [] [[services.ports]] handlers = ["tls", "http"] - port = 443 + port = 8126 + + [[services.tcp_checks]] + grace_period = "30s" + interval = "15s" + restart_limit = 0 + timeout = "10s" [[statics]] guest_path = "/app/public" From 0b1d4f55a86bcb3019c039867d2d4f266eb7c813 Mon Sep 17 00:00:00 2001 From: Chase Date: Sat, 7 May 2022 07:50:55 -0700 Subject: [PATCH 08/37] removing submodule reference --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 48b3731..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "dd-agent"] - path = dd-agent - url = https://github.com/DataDog/datadog-agent From 4319958133ddb235eb681fd023373d3fdb891153 Mon Sep 17 00:00:00 2001 From: Chase Date: Sun, 8 May 2022 09:14:37 -0700 Subject: [PATCH 09/37] reapplying some changes --- .github/workflows/build-and-publish.yaml | 2 +- app.go | 10 +++------- fly.toml | 3 +++ go.mod | 4 +--- go.sum | 7 +++++++ pkg/daemon/daemon.go | 13 ++++--------- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 3704597..b18fb69 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -72,7 +72,7 @@ jobs: - uses: actions/checkout@v2 - uses: superfly/flyctl-actions@1.1 with: - args: deploy --app kots-lint --image-label ${GITHUB_REF:10} -e DD_AGENT_HOST=dd-agent + args: deploy --app kots-lint --config ./fly.toml --image-label ${GITHUB_REF:10} env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/app.go b/app.go index be4abe0..fd88d62 100644 --- a/app.go +++ b/app.go @@ -10,18 +10,14 @@ import ( "github.com/replicatedhq/kots-lint/pkg/daemon" "github.com/replicatedhq/kots-lint/pkg/kots" "github.com/replicatedhq/kots-lint/pkg/version" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" + "github.com/replicatedcom/saaskit/tracing/datadog" log "github.com/sirupsen/logrus" ) func main() { - tracer.Start( - tracer.WithService("kots-lint"), - tracer.WithServiceVersion(version.GitSHA()), - tracer.WithAgentAddr("dd-agent.internal:8126"), - ) - defer tracer.Stop() + datadog.StartTracer("kots-lint", version.GitSHA()) + defer datadog.StopTracer() rand.Seed(time.Now().UTC().UnixNano()) diff --git a/fly.toml b/fly.toml index 4aee0dc..571ec8c 100644 --- a/fly.toml +++ b/fly.toml @@ -1,5 +1,8 @@ app = "kots-lint" +[env] + DD_AGENT_HOST = "sjc.dd-agent.internal" + USE_DATADOG_APM = true [[services]] internal_port = 8082 diff --git a/go.mod b/go.mod index 785a3d5..9bbb75a 100644 --- a/go.mod +++ b/go.mod @@ -8,16 +8,14 @@ require ( github.com/instrumenta/kubeval v0.0.0-20190918223246-8d013ec9fc56 github.com/mitchellh/mapstructure v1.4.2 github.com/open-policy-agent/opa v0.34.2 - github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/philhofer/fwd v1.1.1 // indirect github.com/pkg/errors v0.9.1 + github.com/replicatedcom/saaskit v0.0.0-20220404234806-42d82ab45c31 github.com/replicatedhq/kots v1.69.2-0.20220427202613-e7b5ac2fe43e github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 github.com/tommy351/gin-cors v0.0.0-20150617141853-dc91dec6313a github.com/xeipuuv/gojsonschema v1.2.1-0.20200118195451-b537c054d4b4 // indirect go.undefinedlabs.com/scopeagent v0.1.15 - gopkg.in/DataDog/dd-trace-go.v1 v1.31.0 gopkg.in/yaml.v2 v2.4.0 helm.sh/helm/v3 v3.7.1 k8s.io/client-go v0.23.1 diff --git a/go.sum b/go.sum index 8fa78d7..cffb277 100644 --- a/go.sum +++ b/go.sum @@ -220,6 +220,7 @@ github.com/aws/aws-sdk-go v1.28.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.34.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= github.com/aws/aws-sdk-go v1.38.2/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.38.45/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.38.49 h1:E31vxjCe6a5I+mJLmUGaZobiWmg9KdWaud9IfceYeYQ= github.com/aws/aws-sdk-go v1.38.49/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -282,9 +283,11 @@ github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/bugsnag-go v1.5.3/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= +github.com/bugsnag/bugsnag-go v2.1.1+incompatible/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +github.com/bugsnag/panicwrap v1.3.2/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/bytecodealliance/wasmtime-go v0.30.0 h1:WfYpr4WdqInt8m5/HvYinf+HrSEAIhItKIcth+qb1h4= github.com/bytecodealliance/wasmtime-go v0.30.0/go.mod h1:q320gUxqyI8yB+ZqRuaJOEnGkAnHh6WtJjMaT2CW4wI= github.com/c9s/goprocinfo v0.0.0-20170724085704-0010a05ce49f/go.mod h1:uEyr4WpAH4hio6LFriaPkL938XnrvLpNPmQHBdrmbIE= @@ -1102,6 +1105,7 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= +github.com/johntdyer/slack-go v0.0.0-20180213144715-95fac1160b22/go.mod h1:u0Jo4f2dNlTJeeOywkM6bLwxq6gC3pZ9rEFHn3AhTdk= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= @@ -1264,6 +1268,7 @@ github.com/mattn/go-shellwords v1.0.11/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lL github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.8 h1:gDp86IdQsN/xWjIEmr9MF6o9mpksUgh0fu+9ByFxzIU= github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= @@ -1573,6 +1578,8 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= +github.com/replicatedcom/saaskit v0.0.0-20220404234806-42d82ab45c31 h1:omR7cHtAQ4f/8MelmsBvm2yYwr4dBXngvrIq2uD16Bg= +github.com/replicatedcom/saaskit v0.0.0-20220404234806-42d82ab45c31/go.mod h1:ae2LAb6COZAKb9oI4bgh52xrq17Ql4lqXfPXHZpGwPQ= github.com/replicatedhq/kots v1.69.2-0.20220427202613-e7b5ac2fe43e h1:Z9InQR6BKsX85tWPu9laBhgn6cwRsYccJCQOwXG6u4g= github.com/replicatedhq/kots v1.69.2-0.20220427202613-e7b5ac2fe43e/go.mod h1:V8kilzb9/V4ieJtyPnS81QBnTP9hxH/8TDqIPb1e+tU= github.com/replicatedhq/kurl v0.0.0-20210414162418-8d6211901244 h1:aSORttMXeqRXgRnIS7kpRfR32c3MBkJGkZ6KoqWimhc= diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 41d111c..8958de9 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -4,9 +4,8 @@ import ( "os" "github.com/gin-gonic/gin" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" - gintrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/gin-gonic/gin" "github.com/replicatedhq/kots-lint/pkg/version" + "github.com/replicatedcom/saaskit/tracing/datadog" "github.com/replicatedhq/kots-lint/pkg/handlers" log "github.com/sirupsen/logrus" cors "github.com/tommy351/gin-cors" @@ -14,12 +13,8 @@ import ( // Run is the main entry point of the kots lint. func Run() { - tracer.Start( - tracer.WithService("kots-lint"), - tracer.WithServiceVersion(version.GitSHA()), - tracer.WithAgentAddr("dd-agent.internal:8126"), - ) - defer tracer.Stop() + datadog.StartTracer("kots-lint", version.GitSHA()) + defer datadog.StopTracer() debugMode := os.Getenv("DEBUG_MODE") if debugMode != "on" { @@ -32,7 +27,7 @@ func Run() { SkipPaths: []string{"/livez"}, }), gin.Recovery(), - gintrace.Middleware("kots-lint"), + datadog.GinMiddleware("kots-lint"), ) r.RedirectTrailingSlash = false From 044dac794bbde374d4816cfb0907fcb141e364a1 Mon Sep 17 00:00:00 2001 From: Chase Date: Sun, 8 May 2022 09:36:18 -0700 Subject: [PATCH 10/37] reapplying some changes --- .github/workflows/build-and-publish.yaml | 2 +- dd-fly.toml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index b18fb69..b03b1a6 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -84,6 +84,6 @@ jobs: - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 with: - args: deploy --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --image datadog/agent:7 -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true + args: deploy --app dd-agent --config ./dd-fly.toml --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb -e DD_API_KEY=${{ secrets.DD_API_KEY }} env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/dd-fly.toml b/dd-fly.toml index 8eebbf3..ccbeed1 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -8,6 +8,11 @@ processes = [] [env] PORT = "8126" + DD_SITE = "datadoghq.com" + DD_APM_NON_LOCAL_TRAFFIC = true + +[build] + image = "datadog/agent:7" [experimental] allowed_public_ports = [] From 13e3455b268eac79c74e44bd60436f8357c8c8ff Mon Sep 17 00:00:00 2001 From: Chase Date: Sun, 8 May 2022 11:30:12 -0700 Subject: [PATCH 11/37] reapplying some changes --- .github/workflows/build-and-publish.yaml | 4 +++- dd-fly.toml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index b03b1a6..64f7d20 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -81,9 +81,11 @@ jobs: needs: flyio if: startsWith(github.ref, 'refs/tags/v') steps: + - uses: actions/checkout@v2 - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 with: - args: deploy --app dd-agent --config ./dd-fly.toml --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb -e DD_API_KEY=${{ secrets.DD_API_KEY }} + args: deploy --app dd-agent --config ./dd-fly.toml env: + DD_API_KEY: ${{ secrets.DD_API_KEY }} FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/dd-fly.toml b/dd-fly.toml index ccbeed1..d982f1d 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -14,6 +14,9 @@ processes = [] [build] image = "datadog/agent:7" +[build.args] + DD_AGENT_ARTIFACT = "./datadog-agent_7-1_amd64.deb" + [experimental] allowed_public_ports = [] auto_rollback = true From d918c4088582036a4bd55366d9a90910dbcc2744 Mon Sep 17 00:00:00 2001 From: Chase Date: Sun, 8 May 2022 11:32:16 -0700 Subject: [PATCH 12/37] typo --- dd-fly.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dd-fly.toml b/dd-fly.toml index d982f1d..d6bdb88 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -15,7 +15,7 @@ processes = [] image = "datadog/agent:7" [build.args] - DD_AGENT_ARTIFACT = "./datadog-agent_7-1_amd64.deb" + DD_AGENT_ARTIFACT="./datadog-agent_7-1_amd64.deb" [experimental] allowed_public_ports = [] From 934cd3547e0be8782a9dd9f61b6ada1a24c4410f Mon Sep 17 00:00:00 2001 From: Chase Date: Sun, 8 May 2022 15:11:27 -0700 Subject: [PATCH 13/37] typo --- .github/workflows/build-and-publish.yaml | 2 +- dd-fly.toml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 64f7d20..d23cbd6 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -85,7 +85,7 @@ jobs: - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 with: - args: deploy --app dd-agent --config ./dd-fly.toml + args: deploy --app dd-agent --config ./dd-fly.toml --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb env: DD_API_KEY: ${{ secrets.DD_API_KEY }} FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/dd-fly.toml b/dd-fly.toml index d6bdb88..ccbeed1 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -14,9 +14,6 @@ processes = [] [build] image = "datadog/agent:7" -[build.args] - DD_AGENT_ARTIFACT="./datadog-agent_7-1_amd64.deb" - [experimental] allowed_public_ports = [] auto_rollback = true From dca87625ee1937877066794e4c568c3235ba1bff Mon Sep 17 00:00:00 2001 From: Chase Date: Sun, 8 May 2022 15:58:10 -0700 Subject: [PATCH 14/37] typo --- .github/workflows/build-and-publish.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index d23cbd6..a0c85ee 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -82,10 +82,8 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v2 - - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 with: - args: deploy --app dd-agent --config ./dd-fly.toml --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb + args: deploy --app dd-agent --config ./dd-fly.toml -e DD_API_KEY=${{ secrets.DD_API_KEY }} env: - DD_API_KEY: ${{ secrets.DD_API_KEY }} FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} From b9a02341bd06a6c1054f31690b47aef6d4778cde Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 09:59:21 -0700 Subject: [PATCH 15/37] typo --- .github/workflows/build-and-publish.yaml | 3 ++- dd-fly.toml | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index a0c85ee..9d93f92 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -82,8 +82,9 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v2 + - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 with: - args: deploy --app dd-agent --config ./dd-fly.toml -e DD_API_KEY=${{ secrets.DD_API_KEY }} + args: deploy --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --image datadog/agent:7 -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/dd-fly.toml b/dd-fly.toml index ccbeed1..8eebbf3 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -8,11 +8,6 @@ processes = [] [env] PORT = "8126" - DD_SITE = "datadoghq.com" - DD_APM_NON_LOCAL_TRAFFIC = true - -[build] - image = "datadog/agent:7" [experimental] allowed_public_ports = [] From 80362e33161ce9f6e1abb3752f526e444b226aea Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 10:10:39 -0700 Subject: [PATCH 16/37] removing extraneous env var --- dd-fly.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/dd-fly.toml b/dd-fly.toml index 8eebbf3..d74bc52 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -6,9 +6,6 @@ kill_signal = "SIGINT" kill_timeout = 5 processes = [] -[env] - PORT = "8126" - [experimental] allowed_public_ports = [] auto_rollback = true From 6f5187b4be818134d581657dcea2aa3b4f0ad1b6 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 10:13:25 -0700 Subject: [PATCH 17/37] temp remove action filters --- .github/workflows/build-and-publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 9d93f92..fc01dd1 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -77,8 +77,8 @@ jobs: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} flyio-dd-agent: - runs-on: ubuntu-latest - needs: flyio + # runs-on: ubuntu-latest + # needs: flyio if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v2 From 51f52eb34949c1413e2019f95b34a24dddd10b0d Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 10:16:14 -0700 Subject: [PATCH 18/37] typo --- .github/workflows/build-and-publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index fc01dd1..91a02b6 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -77,9 +77,9 @@ jobs: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} flyio-dd-agent: - # runs-on: ubuntu-latest + runs-on: ubuntu-latest # needs: flyio - if: startsWith(github.ref, 'refs/tags/v') + # if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v2 - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb From 43a6b1b49d2a00916977529ee537908789524abd Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 10:36:58 -0700 Subject: [PATCH 19/37] moving env vars from fly toml to github action --- .github/workflows/build-and-publish.yaml | 4 ++++ fly.toml | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 91a02b6..26815a4 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -74,6 +74,10 @@ jobs: with: args: deploy --app kots-lint --config ./fly.toml --image-label ${GITHUB_REF:10} env: + DD_ENV: "prod" + DD_AGENT_HOST: "sjc.dd-agent.internal" + USE_DATADOG_APM: true + DD_SERVICE: "kots-lint" FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} flyio-dd-agent: diff --git a/fly.toml b/fly.toml index 571ec8c..2db262e 100644 --- a/fly.toml +++ b/fly.toml @@ -1,9 +1,5 @@ app = "kots-lint" -[env] - DD_AGENT_HOST = "sjc.dd-agent.internal" - USE_DATADOG_APM = true - [[services]] internal_port = 8082 protocol = "tcp" From 80789d100f1f2bae258bbfba178bf9c75346bff5 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 11:10:18 -0700 Subject: [PATCH 20/37] moving env var back --- .github/workflows/build-and-publish.yaml | 4 ---- fly.toml | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 26815a4..91a02b6 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -74,10 +74,6 @@ jobs: with: args: deploy --app kots-lint --config ./fly.toml --image-label ${GITHUB_REF:10} env: - DD_ENV: "prod" - DD_AGENT_HOST: "sjc.dd-agent.internal" - USE_DATADOG_APM: true - DD_SERVICE: "kots-lint" FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} flyio-dd-agent: diff --git a/fly.toml b/fly.toml index 2db262e..be09431 100644 --- a/fly.toml +++ b/fly.toml @@ -1,5 +1,11 @@ app = "kots-lint" +[env] + DD_ENV = "prod" + DD_AGENT_HOST = "sjc.dd-agent.internal" + USE_DATADOG_APM = true + DD_SERVICE = "kots-lint" + [[services]] internal_port = 8082 protocol = "tcp" From e5e5962bd52f581d1e9371ad31f7ecbe06259ce7 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 11:18:41 -0700 Subject: [PATCH 21/37] Updating http port in dd-fly.toml and moving env vars from github action to dd-fly.toml --- .github/workflows/build-and-publish.yaml | 2 +- dd-fly.toml | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 91a02b6..8c794de 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -85,6 +85,6 @@ jobs: - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 with: - args: deploy --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --image datadog/agent:7 -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true + args: deploy --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --image datadog/agent:7 -e DD_API_KEY=${{ secrets.DD_API_KEY }} env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/dd-fly.toml b/dd-fly.toml index d74bc52..e336708 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -4,15 +4,16 @@ app = "dd-agent" kill_signal = "SIGINT" kill_timeout = 5 -processes = [] [experimental] - allowed_public_ports = [] auto_rollback = true +[env] + DD_SITE = "datadoghq.com" + DD_APM_NON_LOCAL_TRAFFIC = true + [[services]] internal_port = 8126 - processes = ["app"] protocol = "tcp" [services.concurrency] @@ -23,7 +24,7 @@ processes = [] [[services.ports]] force_https = true handlers = ["http"] - port = 80 + port = 8126 [[services.ports]] handlers = ["tls", "http"] @@ -34,7 +35,3 @@ processes = [] interval = "15s" restart_limit = 0 timeout = "10s" - -[[statics]] - guest_path = "/app/public" - url_prefix = "/static/" From b3af832b4caa91cda17fda085734d8f28524dee5 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 11:24:36 -0700 Subject: [PATCH 22/37] moving env vars back, failing deploy --- .github/workflows/build-and-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 8c794de..b3c2b77 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -85,6 +85,6 @@ jobs: - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 with: - args: deploy --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --image datadog/agent:7 -e DD_API_KEY=${{ secrets.DD_API_KEY }} + args: deploy --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --image datadog/agent:7 -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} From 567de764c775df1889d5af34038bc9d7bd3fb8c0 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 11:27:01 -0700 Subject: [PATCH 23/37] moving image build into dd-fly.toml --- .github/workflows/build-and-publish.yaml | 3 +-- dd-fly.toml | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index b3c2b77..0e5cf01 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -82,9 +82,8 @@ jobs: # if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v2 - - run: curl https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/datadog-agent_7-1_amd64.deb -o datadog-agent_7-1_amd64.deb - uses: superfly/flyctl-actions@1.1 with: - args: deploy --config ./dd-fly.toml --app dd-agent --build-arg DD_AGENT_ARTIFACT=./datadog-agent_7-1_amd64.deb --image datadog/agent:7 -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true + args: deploy --config ./dd-fly.toml --app dd-agent -e DD_API_KEY=${{ secrets.DD_API_KEY }} -e DD_SITE="datadoghq.com" -e DD_APM_NON_LOCAL_TRAFFIC=true env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/dd-fly.toml b/dd-fly.toml index e336708..e3888f4 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -12,6 +12,9 @@ kill_timeout = 5 DD_SITE = "datadoghq.com" DD_APM_NON_LOCAL_TRAFFIC = true +[build] + image = "datadog/agent:7" + [[services]] internal_port = 8126 protocol = "tcp" From f094c66a9c06682addd188cf48fe959e79b656d5 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 18:20:16 -0700 Subject: [PATCH 24/37] updating datadog agent hostname --- fly.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fly.toml b/fly.toml index be09431..5081f03 100644 --- a/fly.toml +++ b/fly.toml @@ -1,8 +1,8 @@ app = "kots-lint" [env] - DD_ENV = "prod" - DD_AGENT_HOST = "sjc.dd-agent.internal" + DD_ENV = "production" + DD_AGENT_HOST = "d8351925" USE_DATADOG_APM = true DD_SERVICE = "kots-lint" From 7c7b674b8209a5747efe2f0d7c68dcd1e10bc739 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 18:44:16 -0700 Subject: [PATCH 25/37] adding internal tld --- fly.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fly.toml b/fly.toml index 5081f03..bf95c11 100644 --- a/fly.toml +++ b/fly.toml @@ -2,7 +2,7 @@ app = "kots-lint" [env] DD_ENV = "production" - DD_AGENT_HOST = "d8351925" + DD_AGENT_HOST = "d8351925.internal" USE_DATADOG_APM = true DD_SERVICE = "kots-lint" From 2966b0dbfecd89755e7a07c58f531a22e3d92ebd Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 19:14:22 -0700 Subject: [PATCH 26/37] removing datadog from app.go, to follow pattern from other services --- app.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app.go b/app.go index fd88d62..a35dc58 100644 --- a/app.go +++ b/app.go @@ -10,15 +10,11 @@ import ( "github.com/replicatedhq/kots-lint/pkg/daemon" "github.com/replicatedhq/kots-lint/pkg/kots" "github.com/replicatedhq/kots-lint/pkg/version" - "github.com/replicatedcom/saaskit/tracing/datadog" log "github.com/sirupsen/logrus" ) func main() { - datadog.StartTracer("kots-lint", version.GitSHA()) - defer datadog.StopTracer() - rand.Seed(time.Now().UTC().UnixNano()) if err := kots.InitOPALinting("/rego"); err != nil { From 95b48d87193cf96301df6bb83e5b9c1712901fb8 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 9 May 2022 19:20:22 -0700 Subject: [PATCH 27/37] typo --- app.go | 1 - 1 file changed, 1 deletion(-) diff --git a/app.go b/app.go index a35dc58..b99cacc 100644 --- a/app.go +++ b/app.go @@ -9,7 +9,6 @@ import ( "github.com/replicatedhq/kots-lint/pkg/daemon" "github.com/replicatedhq/kots-lint/pkg/kots" - "github.com/replicatedhq/kots-lint/pkg/version" log "github.com/sirupsen/logrus" ) From a641621fffef4ad3f0bfdf80b929b1f9881d60d1 Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 10 May 2022 14:00:41 -0700 Subject: [PATCH 28/37] Starting Datadog Tracer with Debug Enabled --- pkg/daemon/daemon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 8958de9..ac0eded 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -13,7 +13,7 @@ import ( // Run is the main entry point of the kots lint. func Run() { - datadog.StartTracer("kots-lint", version.GitSHA()) + datadog.StartTracerDebug("kots-lint", version.GitSHA()) defer datadog.StopTracer() debugMode := os.Getenv("DEBUG_MODE") From b62ef79c688c0a03beac63a8462a8aedbdc47eb1 Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 10 May 2022 14:26:03 -0700 Subject: [PATCH 29/37] fixing saaskit version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9bbb75a..cf5af90 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/mitchellh/mapstructure v1.4.2 github.com/open-policy-agent/opa v0.34.2 github.com/pkg/errors v0.9.1 - github.com/replicatedcom/saaskit v0.0.0-20220404234806-42d82ab45c31 + github.com/replicatedcom/saaskit v0.0.0-20220510211638-f1332c037b13 github.com/replicatedhq/kots v1.69.2-0.20220427202613-e7b5ac2fe43e github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 diff --git a/go.sum b/go.sum index cffb277..4690c7e 100644 --- a/go.sum +++ b/go.sum @@ -1578,8 +1578,8 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/replicatedcom/saaskit v0.0.0-20220404234806-42d82ab45c31 h1:omR7cHtAQ4f/8MelmsBvm2yYwr4dBXngvrIq2uD16Bg= -github.com/replicatedcom/saaskit v0.0.0-20220404234806-42d82ab45c31/go.mod h1:ae2LAb6COZAKb9oI4bgh52xrq17Ql4lqXfPXHZpGwPQ= +github.com/replicatedcom/saaskit v0.0.0-20220510211638-f1332c037b13 h1:XkuYPFlhEQO3JXMiMBVo84wzb8W0mWqUm8YYqP82xOg= +github.com/replicatedcom/saaskit v0.0.0-20220510211638-f1332c037b13/go.mod h1:ae2LAb6COZAKb9oI4bgh52xrq17Ql4lqXfPXHZpGwPQ= github.com/replicatedhq/kots v1.69.2-0.20220427202613-e7b5ac2fe43e h1:Z9InQR6BKsX85tWPu9laBhgn6cwRsYccJCQOwXG6u4g= github.com/replicatedhq/kots v1.69.2-0.20220427202613-e7b5ac2fe43e/go.mod h1:V8kilzb9/V4ieJtyPnS81QBnTP9hxH/8TDqIPb1e+tU= github.com/replicatedhq/kurl v0.0.0-20210414162418-8d6211901244 h1:aSORttMXeqRXgRnIS7kpRfR32c3MBkJGkZ6KoqWimhc= From 7121bbd73740e281582f9ec4334ff59d17b6d91c Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 10 May 2022 16:14:07 -0700 Subject: [PATCH 30/37] Updating saaskit --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cf5af90..b66c584 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/mitchellh/mapstructure v1.4.2 github.com/open-policy-agent/opa v0.34.2 github.com/pkg/errors v0.9.1 - github.com/replicatedcom/saaskit v0.0.0-20220510211638-f1332c037b13 + github.com/replicatedcom/saaskit v0.0.0-20220510221831-0ff4f30f9a41 github.com/replicatedhq/kots v1.69.2-0.20220427202613-e7b5ac2fe43e github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 diff --git a/go.sum b/go.sum index 4690c7e..36ea5b2 100644 --- a/go.sum +++ b/go.sum @@ -1578,8 +1578,8 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/replicatedcom/saaskit v0.0.0-20220510211638-f1332c037b13 h1:XkuYPFlhEQO3JXMiMBVo84wzb8W0mWqUm8YYqP82xOg= -github.com/replicatedcom/saaskit v0.0.0-20220510211638-f1332c037b13/go.mod h1:ae2LAb6COZAKb9oI4bgh52xrq17Ql4lqXfPXHZpGwPQ= +github.com/replicatedcom/saaskit v0.0.0-20220510221831-0ff4f30f9a41 h1:Wk4CD6DHALjqTR5HCYoitRcAobCAz1CdjcMDlJAdJBs= +github.com/replicatedcom/saaskit v0.0.0-20220510221831-0ff4f30f9a41/go.mod h1:ae2LAb6COZAKb9oI4bgh52xrq17Ql4lqXfPXHZpGwPQ= github.com/replicatedhq/kots v1.69.2-0.20220427202613-e7b5ac2fe43e h1:Z9InQR6BKsX85tWPu9laBhgn6cwRsYccJCQOwXG6u4g= github.com/replicatedhq/kots v1.69.2-0.20220427202613-e7b5ac2fe43e/go.mod h1:V8kilzb9/V4ieJtyPnS81QBnTP9hxH/8TDqIPb1e+tU= github.com/replicatedhq/kurl v0.0.0-20210414162418-8d6211901244 h1:aSORttMXeqRXgRnIS7kpRfR32c3MBkJGkZ6KoqWimhc= From fbb2d294b01c3817f7209398c30574d43ced8231 Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 11 May 2022 10:29:51 -0700 Subject: [PATCH 31/37] updating dd instrumentation across app.go & pkg/daemon/daemon.go --- app.go | 5 +++++ dd-fly.toml | 1 + pkg/daemon/daemon.go | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app.go b/app.go index b99cacc..957af99 100644 --- a/app.go +++ b/app.go @@ -7,6 +7,8 @@ import ( "syscall" "time" + "github.com/replicatedcom/saaskit/tracing/datadog" + "github.com/replicatedhq/kots-lint/pkg/version" "github.com/replicatedhq/kots-lint/pkg/daemon" "github.com/replicatedhq/kots-lint/pkg/kots" log "github.com/sirupsen/logrus" @@ -14,6 +16,9 @@ import ( ) func main() { + datadog.StartTracerDebug("kots-lint", version.GitSHA()) + defer datadog.StopTracer() + rand.Seed(time.Now().UTC().UnixNano()) if err := kots.InitOPALinting("/rego"); err != nil { diff --git a/dd-fly.toml b/dd-fly.toml index e3888f4..2500900 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -11,6 +11,7 @@ kill_timeout = 5 [env] DD_SITE = "datadoghq.com" DD_APM_NON_LOCAL_TRAFFIC = true + DD_APM_ENABLED = true [build] image = "datadog/agent:7" diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index ac0eded..e0ac033 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -4,7 +4,6 @@ import ( "os" "github.com/gin-gonic/gin" - "github.com/replicatedhq/kots-lint/pkg/version" "github.com/replicatedcom/saaskit/tracing/datadog" "github.com/replicatedhq/kots-lint/pkg/handlers" log "github.com/sirupsen/logrus" @@ -13,9 +12,6 @@ import ( // Run is the main entry point of the kots lint. func Run() { - datadog.StartTracerDebug("kots-lint", version.GitSHA()) - defer datadog.StopTracer() - debugMode := os.Getenv("DEBUG_MODE") if debugMode != "on" { gin.SetMode(gin.ReleaseMode) From a966a611e32b4865bb28726334f62918fe6e11a7 Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 11 May 2022 13:49:59 -0700 Subject: [PATCH 32/37] updating hostname & tracer start to daemon --- fly.toml | 2 +- pkg/daemon/daemon.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fly.toml b/fly.toml index bf95c11..8706f3f 100644 --- a/fly.toml +++ b/fly.toml @@ -2,7 +2,7 @@ app = "kots-lint" [env] DD_ENV = "production" - DD_AGENT_HOST = "d8351925.internal" + DD_AGENT_HOST = "sjc.d8351925.internal" USE_DATADOG_APM = true DD_SERVICE = "kots-lint" diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index e0ac033..7f31300 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -12,6 +12,9 @@ import ( // Run is the main entry point of the kots lint. func Run() { + datadog.StartTracer("kots-lint", version.GitSHA()) + defer datadog.StopTracer() + debugMode := os.Getenv("DEBUG_MODE") if debugMode != "on" { gin.SetMode(gin.ReleaseMode) From a0f6802a9409dce76edf325d6452c7459e76e7e4 Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 11 May 2022 13:51:26 -0700 Subject: [PATCH 33/37] go mod tidy --- pkg/daemon/daemon.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 7f31300..a70913e 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -5,6 +5,7 @@ import ( "github.com/gin-gonic/gin" "github.com/replicatedcom/saaskit/tracing/datadog" + "github.com/replicatedhq/kots-lint/pkg/version" "github.com/replicatedhq/kots-lint/pkg/handlers" log "github.com/sirupsen/logrus" cors "github.com/tommy351/gin-cors" From 1a39e68292e02e5aa5bc4a4dcd9fb95541d90a27 Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 11 May 2022 14:01:30 -0700 Subject: [PATCH 34/37] removing redundant tracer start from app.go --- app.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app.go b/app.go index 957af99..b99cacc 100644 --- a/app.go +++ b/app.go @@ -7,8 +7,6 @@ import ( "syscall" "time" - "github.com/replicatedcom/saaskit/tracing/datadog" - "github.com/replicatedhq/kots-lint/pkg/version" "github.com/replicatedhq/kots-lint/pkg/daemon" "github.com/replicatedhq/kots-lint/pkg/kots" log "github.com/sirupsen/logrus" @@ -16,9 +14,6 @@ import ( ) func main() { - datadog.StartTracerDebug("kots-lint", version.GitSHA()) - defer datadog.StopTracer() - rand.Seed(time.Now().UTC().UnixNano()) if err := kots.InitOPALinting("/rego"); err != nil { From a4531a6514bdf647d0b8d1f2a23ebf0d0a391cdc Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 12 May 2022 17:12:35 -0700 Subject: [PATCH 35/37] quotes around true to enable apm --- fly.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fly.toml b/fly.toml index 8706f3f..9e061f9 100644 --- a/fly.toml +++ b/fly.toml @@ -2,8 +2,8 @@ app = "kots-lint" [env] DD_ENV = "production" - DD_AGENT_HOST = "sjc.d8351925.internal" - USE_DATADOG_APM = true + DD_AGENT_HOST = "sjc.dd-agent.internal" + USE_DATADOG_APM = "true" DD_SERVICE = "kots-lint" [[services]] From b8ceaa5db76799877aa2eec38b9d18a46f9907a9 Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 12 May 2022 17:31:29 -0700 Subject: [PATCH 36/37] remove comment on filter for flyio dd agent github action job --- .github/workflows/build-and-publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 0e5cf01..ef34a70 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -78,8 +78,8 @@ jobs: flyio-dd-agent: runs-on: ubuntu-latest - # needs: flyio - # if: startsWith(github.ref, 'refs/tags/v') + needs: flyio + if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v2 - uses: superfly/flyctl-actions@1.1 From fc1c1c8bedb0910339906c8866ebf4a00f85e1a4 Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 12 May 2022 17:32:34 -0700 Subject: [PATCH 37/37] final update --- dd-fly.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dd-fly.toml b/dd-fly.toml index 2500900..9bb7099 100644 --- a/dd-fly.toml +++ b/dd-fly.toml @@ -10,8 +10,7 @@ kill_timeout = 5 [env] DD_SITE = "datadoghq.com" - DD_APM_NON_LOCAL_TRAFFIC = true - DD_APM_ENABLED = true + DD_APM_NON_LOCAL_TRAFFIC = "true" [build] image = "datadog/agent:7"