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 track_all_path support for the prometheus pump #713

Closed
wants to merge 1 commit into from

Conversation

sweep-ai[bot]
Copy link

@sweep-ai sweep-ai bot commented Aug 16, 2023

Description

This PR adds support for the track_all_path feature in the Prometheus pump of the Tyk Pump project. The track_all_path feature allows for better control over the processing of analytics records, addressing the cardinality issue in the pump.

Summary of Changes

  • Added a new boolean field called TrackAllPaths to the PrometheusConf struct in pumps/prometheus.go.
  • Added a check for TrackAllPaths before processing each record in the WriteData function of pumps/prometheus.go.
  • Added tests in pumps/prometheus_test.go to validate the behavior of the TrackAllPaths check.

Please review and merge this PR to resolve the cardinality issue in the Prometheus pump.

Fixes #712.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/add-track-all-path-support_1

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Aug 16, 2023
@sweep-ai
Copy link
Author

sweep-ai bot commented Aug 16, 2023

GitHub actions yielded the following error.

The command that failed is go vet .. Here are the relevant lines from the logs:

# github.com/TykTechnologies/tyk-pump/pumps
##[error]pumps/prometheus.go:210:4: syntax error: unexpected type, expecting field name or embedded type
##[error]pumps/prometheus.go:239:43: syntax error: unexpected context in argument list; possibly missing comma or )
go vet errored
##[error]Process completed with exit code 1.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

@buger buger closed this Aug 16, 2023
@sweep-ai
Copy link
Author

sweep-ai bot commented Aug 16, 2023

GitHub actions yielded the following error.

The command that failed is /__t/goreleaser-action/1.20.0/x64/goreleaser release --clean -f ci/goreleaser/goreleaser.yml --snapshot. Here are the relevant lines from the logs:

�[1;91m  ⨯�[0m �[1mrelease failed after 3m38s�[0m               �[1;91merror�[0m=failed to build for linux_amd64_v1: exit status 1: go: downloading github.com/gocraft/health v0.0.0-20170925182251-8675af27fef0
go: downloading github.com/kelseyhightower/envconfig v1.4.0
go: downloading github.com/TykTechnologies/graphql-go-tools v1.6.2-0.20230320143102-7a16078ce517
go: downloading github.com/TykTechnologies/storage v1.0.8
go: downloading github.com/buger/jsonparser v1.1.1
go: downloading github.com/fatih/structs v1.1.0
go: downloading github.com/oschwald/maxminddb-golang v1.11.0
go: downloading google.golang.org/protobuf v1.30.0
go: downloading github.com/TykTechnologies/gorm v1.20.7-0.20210910090358-06148e82dc85
go: downloading github.com/gofrs/uuid v3.3.0+incompatible
go: downloading github.com/DataDog/datadog-go v4.7.0+incompatible
go: downloading github.com/TykTechnologies/gorpc v0.0.0-20210624160652-fe65bda0ccb9
go: downloading github.com/TykTechnologies/murmur3 v0.0.0-20230310161213-aad17efd5632
go: downloading github.com/aws/aws-sdk-go-v2 v1.16.14
go: downloading github.com/aws/aws-sdk-go-v2/config v1.9.0
go: downloading github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.9.0
go: downloading github.com/cenkalti/backoff/v4 v4.0.2
go: downloading github.com/influxdata/influxdb-client-go/v2 v2.6.0
go: downloading github.com/influxdata/influxdb v1.8.10
go: downloading github.com/logzio/logzio-go v0.0.0-20200316143903-ac8fc0e2910e
go: downloading github.com/moesif/moesifapi-go v1.0.6
go: downloading github.com/olivere/elastic/v7 v7.0.28
go: downloading github.com/olivere/elastic v6.2.31+incompatible
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/prometheus/client_golang v1.16.0
go: downloading github.com/quipo/statsd v0.0.0-20160923160612-75b7afedf0d2
go: downloading github.com/resurfaceio/logger-go/v3 v3.2.1
go: downloading github.com/robertkowalski/graylog-golang v0.0.0-20151121031040-e5295cfa2827
go: downloading github.com/segmentio/analytics-go v0.0.0-20160711225931-bdb0aeca8a99
go: downloading github.com/segmentio/kafka-go v0.3.6
go: downloading golang.org/x/net v0.7.0
go: downloading gopkg.in/olivere/elastic.v3 v3.0.56
go: downloading gopkg.in/olivere/elastic.v5 v5.0.85
go: downloading gopkg.in/olivere/elastic.v6 v6.2.31
go: downloading gorm.io/driver/mysql v1.0.3
go: downloading gorm.io/driver/postgres v1.0.5
go: downloading gorm.io/driver/sqlite v1.1.3
go: downloading golang.org/x/sys v0.9.0
go: downloading github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
go: downloading github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137
go: downloading github.com/cespare/xxhash/v2 v2.2.0
go: downloading github.com/tidwall/sjson v1.0.4
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading github.com/jensneuse/abstractlogger v0.0.4
go: downloading gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
go: downloading github.com/aws/smithy-go v1.13.2
go: downloading github.com/aws/aws-sdk-go-v2/credentials v1.5.0
go: downloading github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.7.0
go: downloading github.com/aws/aws-sdk-go-v2/internal/ini v1.2.5
go: downloading github.com/aws/aws-sdk-go-v2/service/sso v1.5.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sts v1.8.0
go: downloading github.com/helloeave/json v1.15.3
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.3.3
go: downloading github.com/deepmap/oapi-codegen v1.8.2
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/beeker1121/goque v0.0.0-20170321141813-4044bc29b280
go: downloading github.com/shirou/gopsutil v3.20.11+incompatible
go: downloading go.uber.org/atomic v1.9.0
go: downloading github.com/mailru/easyjson v0.7.7
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/client_model v0.3.0
go: downloading github.com/prometheus/common v0.42.0
go: downloading github.com/prometheus/procfs v0.10.1
go: downloading github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
go: downloading github.com/joho/godotenv v1.4.0
go: downloading github.com/jehiah/go-strftime v0.0.0-20151206194810-2efbe75097a5
go: downloading github.com/segmentio/backo-go v0.0.0-20160424052352-204274ad699c
go: downloading github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c
go: downloading github.com/xdg/scram v1.0.3
go: downloading github.com/golang/snappy v0.0.3
go: downloading github.com/go-sql-driver/mysql v1.5.0
go: downloading github.com/jackc/pgx/v4 v4.9.0
go: downloading github.com/mattn/go-sqlite3 v1.14.3
go: downloading github.com/tidwall/gjson v1.11.0
go: downloading github.com/r3labs/sse/v2 v2.8.1
go: downloading nhooyr.io/websocket v1.8.7
go: downloading github.com/jensneuse/byte-template v0.0.0-20200214152254-4f3cf06e5c68
go: downloading github.com/jensneuse/pipeline v0.0.0-20200117120358-9fb4de085cd6
go: downloading github.com/eclipse/paho.mqtt.golang v1.2.0
go: downloading github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30
go: downloading go.uber.org/zap v1.18.1
go: downloading go.mongodb.org/mongo-driver v1.11.2
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.4.0
go: downloading github.com/jinzhu/inflection v1.0.0
go: downloading github.com/jinzhu/now v1.1.2
go: downloading github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839
go: downloading github.com/syndtr/goleveldb v0.0.0-20190318030020-c3a204f8e965
go: downloading github.com/josharian/intern v1.0.0
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.4
go: downloading github.com/xdg/stringprep v1.0.3
go: downloading golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
go: downloading golang.org/x/text v0.7.0
go: downloading github.com/jackc/pgconn v1.7.0
go: downloading github.com/jackc/pgtype v1.5.0
go: downloading github.com/jackc/pgio v1.0.0
go: downloading github.com/tidwall/match v1.1.1
go: downloading github.com/tidwall/pretty v1.2.0
go: downloading gopkg.in/cenkalti/backoff.v1 v1.1.0
go: downloading github.com/klauspost/compress v1.13.6
go: downloading github.com/qri-io/jsonschema v0.2.1
go: downloading github.com/nats-io/nkeys v0.3.0
go: downloading github.com/nats-io/nuid v1.0.1
go: downloading go.uber.org/multierr v1.6.0
go: downloading github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d
go: downloading github.com/jackc/chunkreader/v2 v2.0.1
go: downloading github.com/jackc/pgpassfile v1.0.0
go: downloading github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b
go: downloading github.com/qri-io/jsonpointer v0.1.1
go: downloading github.com/Masterminds/sprig v2.22.0+incompatible
go: downloading github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver v1.5.0
go: downloading github.com/google/uuid v1.2.0
go: downloading github.com/huandu/xstrings v1.3.2
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/mitchellh/copystructure v1.1.1
go: downloading github.com/xdg-go/scram v1.1.1
go: downloading github.com/xdg-go/stringprep v1.0.3
go: downloading golang.org/x/sync v0.2.0
go: downloading github.com/mitchellh/reflectwalk v1.0.1
go: downloading github.com/xdg-go/pbkdf2 v1.0.0
# github.com/TykTechnologies/tyk-pump/pumps
pumps/prometheus.go:210:4: syntax error: unexpected type, expecting field name or embedded type
pumps/prometheus.go:239:43: syntax error: unexpected context in argument list; possibly missing comma or )

Please note that the error message indicates a syntax error in the file pumps/prometheus.go at line 210 and line 239.

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: Add track_all_path support for the prometheus pump
1 participant