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

tyk_analytics Alias mapping #38

Open
coatezy opened this issue May 17, 2017 · 8 comments

Comments

@coatezy
Copy link

commented May 17, 2017

I'm pretty new to Tyk and Pump but after having a dig around what is stored in Redis and the mappings here I was just wondering why Alias is not defined in the pump mappings?

I'd like to define our users ID in the alias so we can link analytics to our users.

Happy to open a PR if this is something you are open too, but thought I'd ask first as there my be a geniune reason why Alias has not been included.

@coatezy coatezy changed the title tyk_analytics Alias tyk_analytics Alias mapping May 17, 2017

@yourpalal

This comment has been minimized.

Copy link

commented May 18, 2017

Hi, I wanted this feature as well, and added it to a fork, alnong with an option to exclude the api_key field from ES output. I didn't PR because of the slightly hackish configuration method I used, but this change could easily be adapted for an alias-only change.

omxhealth@ca2c3ba

@coatezy

This comment has been minimized.

Copy link
Author

commented May 18, 2017

Thanks @yourpalal! That is exactly what I was planning on doing. Did you have any problems building? I am hitting the following errors when trying to build with Go 1.8.1.

go build -v ./...
vendor/github.com/garyburd/redigo/redis/pool.go:28:2: use of internal package not allowed
vendor/gopkg.in/mgo.v2/auth.go:38:2: use of internal package not allowed
vendor/gopkg.in/mgo.v2/bson/json.go:7:2: use of internal package not allowed

I've not got much experience with Go though so I may just be doing something wrong. 🙈

@yourpalal

This comment has been minimized.

Copy link

commented May 18, 2017

Hmmm I don't have much experience with go either and it must have worked at the time, since I definitely built it. Trying again now gives me the same error as you, so I'm not sure what's up! sorry!

@coatezy

This comment has been minimized.

Copy link
Author

commented May 18, 2017

Good to know it's not just me. The last build on Travis also passed 28 days ago though. It can't be a Go version issue as I've tried the following and they all return the same errors.

  • 1.7.4_2
  • 1.8
  • 1.8.1

I'll report back if/when I get it building.

@mvdan

This comment has been minimized.

Copy link
Contributor

commented May 18, 2017

tyk-pump builds fine here on master on both 1.8.1 and tip. I think those kinds of issues arise when your Go installation is somehow messed up, but that probably isn't it if you're both hitting it.

Have you tried go build . or go install ., i.e. using . instead of ./...?

@mvdan

This comment has been minimized.

Copy link
Contributor

commented May 18, 2017

Could also be because you guys are using the wrong import path for the build: https://stackoverflow.com/questions/34973883/how-do-i-fix-the-error-message-use-of-an-internal-package-not-allowed-when-go

In other words, you have to build github.com/TykTechnologies/tyk-pump instead of github.com/omxhealth/tyk-pump. Make sure the path in your $GOPATH is the original too.

@coatezy

This comment has been minimized.

Copy link
Author

commented May 18, 2017

go build . worked. 🤦‍♂

Thanks @mvdan!

@coatezy

This comment has been minimized.

Copy link
Author

commented May 19, 2017

If I was to add Alias and submit a PR what would be preferable? A configurable property that is disabled by default across all pumps but can be enabled like extended_stats in the Elasticsearch pump, or add it to each pump but not configurable.

buger added a commit that referenced this issue Aug 23, 2019

fixed in elasticsearch analytics to publish the alias (#145)
This PR is for publishing the alias into the Elasticsearch. We can use the alias for different purposes such as identifying the users in the analytics.
 [Github issue](#38) and [community forum ](https://community.tyk.io/t/user-identifier-in-analytic-logs/1621/3) are described this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.