pyroscope icon indicating copy to clipboard operation
pyroscope copied to clipboard

Separate endpoint for listing applications

Open kolesnikovae opened this issue 2 years ago • 1 comments

Currently /label-values endpoint is used to list the applications. This is inconvenient by number of reasons, first of all due to the fact that the cloud storage accesses the data differently, and use of storage.LabelValuesGetter interface is confusing.

We already have a storage method implementing the logic: https://github.com/pyroscope-io/pyroscope/blob/f8dd42c047276bf1d2046c1576b2e94dfd38c47f/pkg/storage/storage_labels.go#L87

This also relates to https://github.com/pyroscope-io/pyroscope/pull/1239, which adds /apps endpoint.

Implementation note: it makes sense to return an array of objects, as we may want to add some extra app details in future:

[
  {
     "name": "application-a.cpu",
  },
  {
     "name": "application-a.mem",
  }
]

So, later we can add more fields, for example:

[
  {
     "name": "application-a",
     "profileTypes": [
        "cpu",
        "mem"
     ],
     "language": "clang"
     "tags": [ "owner:me" ]
  }
]

kolesnikovae avatar Jul 14 '22 15:07 kolesnikovae

/cc @korniltsev

petethepig avatar Jul 14 '22 16:07 petethepig