The most important usecase for composite aggregations is pagination, this allows you to retrieve all buckets even if you have a lot of buckets and therefore ordinary aggregations run into limits.
A composite aggregation can have several sources, so you can use a date_histogram and e.g. a terms source for the application:
"composite" : {
"sources" : [
{ "date": { "date_histogram" : { "field": "timestamp", "fixed_interval": "1h" } } },
{ "application": { "terms" : { "field": "app" } } }
]
}
Are you planning to store the results to e.g. further analyze it? Transform is build on top of composite aggs, made for usescases like yours. This saves custom code, is already build for robustness and scale (and there is a nice UI to get you started easily).