Logging Events using HTTP

Since I cant post in discussion (:roll_eyes:) ill just post here. I would like an easy way to log events that happen in a Roblox game (errors, moderation, in-game purchases, etc) externally through HTTPService.

Now, I dont really have the money for paying a server host. So would using paste bin be a viable way to do this? Now I would want it to be synced for all servers (for errors). Seeing as you cant update a paste through POST requests (i think) you would have to first get the old paste and create a new one with the old paste and the new logs and then delete the old one. Now for it to be synced across all servers you would have to use a global data store and store all of the logs from all servers. Then you would need one server to tie them all together and update the paste. How difficult would this be? Is there an easier way to do this?

5 Likes

An easy way to accomplish this would be to just plug “Google Analytics” into roblox. Here is a great article on it:
https://developer.roblox.com/en-us/articles/Using-Google-Analytics
It is especially useful, since you can create your own custom events, that can log anything you want to your Analytics page.

I’m not sure if you can request the data back from GA into your game, but it certainly makes the logging easy.

You can alternatively use PlayFab. I personally prefer GA, but you should check them both out of sure.
https://developer.roblox.com/en-us/articles/using-the-analytics-service

4 Likes

Wow! I had no idea this existed for Roblox games. Thanks ill check it out! Also yeah I wouldn’t really need to request the data back, only really need for logging.

1 Like

As Excess said you can just use Google Analytics. Unless you’re like me who has been doing web development since I was 9 when I taught myself.
I make my own websites and log things on there as it makes it nice and easy for me to make sure the data is mine, along with being able to format it however I like.

@ExcessEnergy Happy birthday! :birthday:

Thanks so much dude! Like you said, you can always just do it the hard way and create your own server. This is pretty time consuming if you don’t already have the skill set to do it though

1 Like

Yeah I know how to make static sites but not much more than that. I would prefer to have my own website for it but idk how I would do that for free. I currently use netlify which is a really good free hosting website but I have no idea how I would setup the logging.

I might be able to do it with netlify’s lambda functions. But idk how to set that up. Functions overview | Netlify Docs

(I apologize in advance for the wall of text.)

tl;dr

Netlify’s Lambda functions seem to be fairly straight forward to set up, if you follow their documentation. Personally, I would use AWS Lambda myself, and would suggest you do the same. If you wish, I can help you with setting up AWS for logging; no charge to you from me. Otherwise, if you don’t want to use AWS for any reason, use Google Analytics.


Alrighty, on to the giant wall of text I posted (again, I apologize for that)…


It appears that Netlify’s Lambda functions are stored in the ./functions (by default, anyway) directory of a GitHub/GitLab/BitBucket repository linked to Netlify. For now, Netlify’s functions seem to only support JavaScript and Go functions, so if you don’t know either of those I think you’re out of luck with using Netlify’s Lambda functions.

Personally, I wouldn’t use Netlify’s functions. Netlify’s functions run on Amazon Web Service’s Lambda service (aka AWS Lambda). Although it’s not completely free (though if you’re smart, you can likely significantly reduce your costs), you’d likely get more customizability and functionality with using AWS Lambda yourself (since AWS Lambda also supports Python, .NET Core (basically C#), Java, and Ruby, if you know any of those languages).

If you’d like assistance with setting up Amazon Web Services for logging, I’d be more than happy to help. Although I’m by no means an AWS expert (or even aficionado), I certainly know my way around AWS and can certainly help you (note my “Web Developer” tag). Note that you will need to provide your own AWS account; for your security, I will only provide help via messages and I will not access your AWS account (and AWS does require a credit card for account activation, though you will not be charged during activation). Additionally, if you do choose to use AWS, the following services will be used (for reference, all prices are in USD and are based on the AWS us-west-2 (Oregon) service region):

  • Amazon API Gateway - $1.00 USD per 1,000,000 (1 million) HTTP requests, per month; I can assist you in making the most of this (with you needing 10,000 requests before you’re even charged a cent).
  • Amazon Simple Storage Service (aka S3) - $0.023 (2.3 cents) per gigabyte stored, per month stored; $0.005 (1/2 a cent) per 1,000 PUT, POST, COPY, and LIST requests; and $0.0004 per 1,000 GET, SELECT, and other requests; for text, even just a gigabyte of storage should be far more than enough before you download the logs to your computer, let alone get charged anything. As for the requests, I don’t foresee any substantial cost coming from the POST requests your functions would be making.
  • AWS Lambda - $0.20 (20 cents) per 1 million function invocations and $0.0000166667 (about 1/5 of a cent) per GB-second of compute time*; since Lambda has a (very generous) free tier available to all current AWS users, you’re unlikely to run into any costs here.
  • AWS Cloudwatch - $0.25 (25 cents) per GB of logs ingested and $0.03 (3 cents) per GB of logs stored per month; if you’re only using AWS Lambda and Amazon API Gateway, you’ll be unlikely to run into any costs here, since Cloudwatch also offers a fairly generous free tier.
  • AWS Data Transfer - $0.09 (9 cents) per GB out from AWS to the internet (data egress) and $0.00 (free) per GB in to AWS from the internet (data ingress); both are per month; if you’re only using AWS for logs, you should be fine with this cost and transferring text out of AWS isn’t terribly expensive; additionally, your first GB out per month is free.
  • AWS Cost Management - $2.00 per budget per month; this will act as a ‘last line of defense’ against you getting any surprise charges. You should not get any charges here, as your first 2 budgets are free.

As I alluded to earlier, I’d be more than happy to help set this up for you and at no charge; just send me a message and I can send you a bit more info about the possible costs of using AWS, a better explanation of how each service will be used, and you can make a final decision about using AWS, prior to us getting it set up if you chose to continue.

If you really want to be sure that you won’t pay anything (and you don’t need to flexibility of AWS), I’d recommend using Google Analytics as mentioned in the post you marked as the solution to your problem.

2 Likes

First of wow! Thanks for this! But I will just stick to google analytics for now. I will definitely contact you in the future if I want to get that all set up.

1 Like