Platinum Partner
news,cloud,infrastructure,heroku

The Simplest Way To Collect Application Data On Heroku

Curator's Note: The content of this article was originally written by Masa over at the Treasure Data  blog.

At Treasure Data, we constantly try to simplify how our customers collect and interact with their data.

Over the past several months, we reached out to two dozens or so customers and listened to their feedback. One pattern emerged: they spend a lot of time on data collection and wanted something simpler.

So, we rolled up our sleeves and built a feature to simplify data collection even more: from now on, our Heroku customers can store data on Treasure Data by just printing to stdout in a specified format.

Treasure Data's Heroku Log Drain Integration

The format is very simple:

@[db_name.table_name] json_in_one_line

e.g., if you wanted to store the event { "first_name": "Bob", "last_name": "Smith" } into the table users in the database service, you just write

@[service.users] { "first_name": "Bob", "last_name": "Smith" }

into stdout. Hence, in Ruby,

puts '@[service.users] { "first_name": "Bob", "last_name": "Smith" }'

in Java,

System.out.println("@[service.users] { \"first_name\": \"Bob\", \"last_name\": \"Smith\" }")

in PHP,

echo '@[service.users] { "first_name": "Bob", "last_name": "Smith" }'.PHP_EOL;

in Node.js,

process.stdout.stream('@[service.users] { "first_name": "Bob", "last_name": "Smith" }')

and so on.

As you noticed, this new interface is language agnostic: all languages let you print out to stdout out of the box, and that’s all you need to get started with Treasure Data on Heroku now.

So, if you are a Heroku user, just run

$ heroku addons:add treasure-data:nano

and start collecting data today.

Masa

Masa, the engineer who built this new feature, likes to bike everywhere, rain or shine.



Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}