Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

The Simplest Way To Collect Application Data On Heroku

DZone's Guide to

The Simplest Way To Collect Application Data On Heroku

· Cloud Zone
Free Resource

Linkerd, the open source service mesh for cloud native applications. Get the complete guide to using Linkerd and Kubernetes to build scalable, resilient applications.

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.



Linkerd, the open source service mesh for cloud native applications. Get the complete guide to using Linkerd and Kubernetes to build scalable, resilient applications.

Topics:

Published at DZone with permission of Sadayuki Furuhashi, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}