Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contract: add heatmap format docs #507

Merged
merged 15 commits into from Nov 9, 2022
Merged

Contract: add heatmap format docs #507

merged 15 commits into from Nov 9, 2022

Conversation

ryantxu
Copy link
Member

@ryantxu ryantxu commented May 24, 2022

This is a first attempt to write down more structured notes on heatmap format constraints.

@ryantxu ryantxu requested a review from kylebrandt May 24, 2022 18:58
@ryantxu
Copy link
Member Author

ryantxu commented May 24, 2022

@leeoniya is out this week... but will have more opinions for how to improve this :)

Status: EARLY Draft/Proposal

Heatmaps are used to show the magnitude of a phenomenon as color in two dimensions. The variation in color
may give visual cues about how the phenomenon is clustered or varies over space.
Copy link
Contributor

Choose a reason for hiding this comment

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

For defining the "heatmap" kind, should we state that we exclude "geo spatial" map data from this kind? Seems like wikipedia calls this kind we are describing as "grid heap map". I think it is probably okay not to use "grid" and just call it heatmap and then in the geo case something like "spatial heap map" - but we should have a clear decision on if geo would be included in this kind (to which my guess is "no").

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can ignore geo for now -- we can either add a new kind more appropriate for geo, or perhaps allow the x values to be of type geo (that exists in the frontend, but not in the backend)


The first field represents the X axis, the rest of the fields indicate rows in the heatmap.
The true numeric range of each bucket can be indicated using an "le" label. When absent,
The field display is used for the bucket label.
Copy link
Contributor

Choose a reason for hiding this comment

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

"field display", metadata or field name?

Copy link
Contributor

@bohandley bohandley Nov 9, 2022

Choose a reason for hiding this comment

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

Is field display for the bucket label the same as the label object in a field?

For example, this field display would be
{__name__="go_gc_duration_seconds_sum", instance="localhost:9095", job="prometheus"}

{
          "name": "Value",
          "type": "number",
          "typeInfo": {
            "frame": "float64"
          },
          "labels": {
            "__name__": "go_gc_duration_seconds_sum",
            "instance": "localhost:9095",
            "job": "prometheus"
          },

but this one that has le could be described just by using the le label and doesn't need the whole field display?

"labels": {
            "__name__": "prometheus_http_request_duration_seconds_bucket",
            "handler": "/",
            "instance": "localhost:9095",
            "job": "prometheus",
            "le": "+Inf"
          },

Is this accurate @leeoniya?

Note that multiple "value" fields can included to represent multiple dimensions within the same cell.
The first value field is used in the display, unless explicilty configured

The field names for yMax|yMin|y indicate the aggregation period or the supplied values.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this case sensitive? I don't care if it is or not, just that we pick.

Copy link
Contributor

Choose a reason for hiding this comment

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

In transformations, the case sensitivity is the same, I suggest with stick with lower case y and uppercase M, yMin, yMax

</tr>
</table>

This format requires uniform cell sizing
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand want this means...? Perhaps if expressed in terms of fields/rows?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ryantxu Perhaps, "This format requires uniform cell sizing. The size of the cell is defined by the columns in each row that are chosen as the xMax|xMin|x and the yMax|yMin|y. We can see that the Number column(yMax|yMin|y) increases by 100(each cell is roughly 100 higher than the previous cell on the y axis) for each row containing a similar Time value(these stacked cells all have roughly the same location along the x axis). This produces a uniform cell size."

Copy link
Member Author

Choose a reason for hiding this comment

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

@bohandley -- i just got everything in sync. Please work with @leeoniya to figure out what is accurate and feel free to push to this branch and update whatever we need to make it more clear

## Heatmap sparse (HeatmapSparse)

This format is simplar to Heatmap scanlines, except that each cell is independent from its adjacent values.
Unlike scanlines, this allows resolutions to change over time. When
Copy link
Contributor

Choose a reason for hiding this comment

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

trailing "when" ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comparison from the uniformity of cells over time in scanlines to the variability of cells along the x axis(Time) for Heatmap sparse.

@kylebrandt
Copy link
Contributor

All the examples have time - does there have to be Time, or can "X axis" be something else?

@CLAassistant
Copy link

CLAassistant commented Jun 15, 2022

CLA assistant check
All committers have signed the CLA.

@kylebrandt kylebrandt added the area/dataplane Dataplane Project (Data type contract) label Oct 4, 2022
* rename README to contract

* update docs for scanline uniform cells and difference between sparse and scanlines
@bohandley bohandley marked this pull request as ready for review November 9, 2022 17:37
@bohandley bohandley requested a review from a team as a code owner November 9, 2022 17:37
@bohandley bohandley requested review from wbrowne and marefr and removed request for a team November 9, 2022 17:37
* [Multi](./timeseries.md#time-series-multi-format-timeseriesmulti)
* [Numeric](./numeric.md)
* [Wide](./numeric.md#numeric-wide-format-numericwide)
* [Many](./numeric.md#numeric-many-format-numericmany)
Copy link
Contributor

Choose a reason for hiding this comment

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

This was changed to numeric multi in recent PR https://github.com/grafana/grafana-plugin-sdk-go/pull/551/files

Copy link
Contributor

Choose a reason for hiding this comment

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

LIke this?

     * [Multi](./timeseries.md#time-series-multi-format-timeseriesmulti)
* [Numeric](./numeric.md)
     * [Wide](./numeric.md#numeric-wide-format-numericwide)
     * [Multi](./numeric.md#numeric-many-format-numericmany)

* [Multi](./timeseries.md#time-series-multi-format-timeseriesmulti)
* [Numeric](./numeric.md)
* [Wide](./numeric.md#numeric-wide-format-numericwide)
* [Many](./numeric.md#numeric-many-format-numericmany)
Copy link
Contributor

@kylebrandt kylebrandt Nov 9, 2022

Choose a reason for hiding this comment

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

Suggested change
* [Many](./numeric.md#numeric-many-format-numericmany)
* [Multi](./numeric.md#numeric-multi-format-numericmulti)

Copy link
Contributor

Choose a reason for hiding this comment

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

(Both Name and Link)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, got it, let me do that again

@bohandley bohandley merged commit 4438c11 into main Nov 9, 2022
@bohandley bohandley deleted the heatmap-frame-type branch November 9, 2022 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dataplane Dataplane Project (Data type contract)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants