Skip to content

Conversation

@kavehshahedi
Copy link
Contributor

@kavehshahedi kavehshahedi commented Mar 24, 2025

What it does

Followed by introducing the configurable reports data providers, this commit proposes a new data provider type called MIME, which is related to different types of configurable MIME reports, such as images, HTML, text, pdf, excel, etc.

How to test

Once a new configurable MIME report is created, the fetched output's type should be MIME.

P.S.: For now, all the reports have the type of NONE; They should be updated subsequently (check the Follow-ups section below).

Follow-ups

  1. The incubator project should be updated based on this feature. Accordingly, classes such as ImageReportDataProvider should change their provider type to MIME.
  2. A new endpoint should be implemented in the trace server data providers service, enabling users to query the MIME reports from the server.

Review checklist

  • As an author, I have thoroughly tested my changes and carefully followed the instructions in this template

*
* @since 10.3
*/
REPORT,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This alone won't be sufficient. FE clients won't be able to display the if they receive such a data provider descriptor. The type here describes what data it is. Then the TSP will need to be augmented with endpoints and data structures that provides the details for visualization. For example, TIME_GRAPH data providers, tells clients that there is an endpoint to query the tree and states. Also, the query parameters and returned data structures are defined in the TSP.

For reports such endpoints, query parameters and output data structures are not specified in the TSP yet and needs to be added.

The configurable reports purpose is to create new data provider instances of known, in TSP specified data providers.

If you compare the implementation to the InAndOut analysis, the configuration endpoint allows to create derived data providers with a known type, for example it spawns, for example, XY_TREE charts, DATA_TREE data providers.

So, for your image report, you need to have a type that indicates a image report. Then there needs to be an endpoint in the TSP to query such data provider.

@kavehshahedi kavehshahedi force-pushed the report-data-provider-type branch 2 times, most recently from 2ddafd1 to 820af76 Compare March 27, 2025 15:22
@kavehshahedi kavehshahedi changed the title tmf: Introduce "REPORT" data provider type tmf: Introduce "IMAGE" data provider type Mar 27, 2025
@MatthewKhouzam
Copy link
Contributor

MatthewKhouzam commented Mar 28, 2025

would it be interesting to have a mime type later so image can be one type of report. e.g. Audio or multipart.

I see the dataprovider endpoint as being dual

paths:
  /download:
    get:
      summary: Download a file
      description: Allows the user to download a specific file with a specified MIME type.
      operationId: downloadFile
      responses:
        '200':
          description: The file is successfully downloaded.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
              example: 'Your file content here.'
        '404':
          description: File not found.
        '500':
          description: Internal server error.
      parameters:
        - in: query
          name: mimeType
          required: false
          schema:
            type: string
            description: The MIME type of the file (optional, default to application/octet-stream)
          example: 'application/pdf'

thoughts?

@bhufmann
Copy link
Contributor

bhufmann commented Apr 7, 2025

would it be interesting to have a mime type later so image can be one type of report. e.g. Audio or multipart.

I see the dataprovider endpoint as being dual

paths:
  /download:
    get:
      summary: Download a file
      description: Allows the user to download a specific file with a specified MIME type.
      operationId: downloadFile
      responses:
        '200':
          description: The file is successfully downloaded.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
              example: 'Your file content here.'
        '404':
          description: File not found.
        '500':
          description: Internal server error.
      parameters:
        - in: query
          name: mimeType
          required: false
          schema:
            type: string
            description: The MIME type of the file (optional, default to application/octet-stream)
          example: 'application/pdf'

thoughts?

@MatthewKhouzam
First of all, this PR is to define the changes to the DataProviderDescriptor that describes the new data provider for the reports. What you described is the trace server API. What would you suggest for the DataProviderDescripter that enable us to use achieve such TSP endpoint.

I see several option for DataProviderDescriptor:

  1. Add a flat list to the descriptor type
    • REPORT_IMAGE
    • REPORT_PDF
    • REPORT_MULTIPART
  2. Add one type and a sub-type field
  • New type: REPORT
  • New sub-type field: IMAGE, PDF, MULTIPART
  • Or use a mime-type as subtype field

Secondly, looking on the TSP side, we need to understand if there should be (or need to be) multiple endpoints. At the first glance, it seems better to have one endpoint, e.g. /reports/ and depending on the type / subtype it returns application/octet-stream, application/pdf, etc. This has to be clear in the TSP specification, that on type/sub-type produces certain mime-type and NOT that clients an request for each type also each mime-type.

The other thing we could always download such reports a octet stream and from the descriptor we would know the mime-type and how to handle the report resource.

@kavehshahedi kavehshahedi force-pushed the report-data-provider-type branch from 1a1e4f8 to 92fb9be Compare April 10, 2025 19:20
@kavehshahedi kavehshahedi changed the title tmf: Introduce "IMAGE" data provider type tmf: Introduce "MIME" data provider type Apr 10, 2025
MatthewKhouzam
MatthewKhouzam previously approved these changes Apr 10, 2025
@MatthewKhouzam
Copy link
Contributor

I find this MUCH cleaner. Thanks Kaveh!

@kavehshahedi kavehshahedi force-pushed the report-data-provider-type branch 2 times, most recently from 0e08c85 to 1342912 Compare April 11, 2025 03:08
@kavehshahedi kavehshahedi force-pushed the report-data-provider-type branch from 1342912 to c562532 Compare April 17, 2025 15:02
Followed by introducing the configurable reports data providers, this commit proposes
a new data provider type called "MIME", which is related to different types of configurable
MIME reports, such as images, HTML, text, pdf, excel, etc.

[Added] A new data provider type called "MIME"

Signed-off-by: Kaveh Shahedi <kaveh.shahedi@ericsson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants