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

docs: initial updates to state timeline documentation #84224

Merged
merged 13 commits into from Mar 19, 2024

Conversation

mdcruz
Copy link
Contributor

@mdcruz mdcruz commented Mar 11, 2024

What is this feature?

Updates to the state timeline docs to include:

  • how to configure a state timeline (to be added as a video)
  • supported data formats and example
  • when to use a state timeline

Why do we need this feature?

To explain to our users how to configure a state timeline easily and when to use it.

Who is this feature for?

Grafana OSS and Cloud users

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@mdcruz mdcruz requested a review from imatwawana as a code owner March 11, 2024 18:15
@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.0.x milestone Mar 11, 2024
@mdcruz mdcruz added the no-changelog Skip including change in changelog/release notes label Mar 11, 2024
@leeoniya
Copy link
Contributor

leeoniya commented Mar 11, 2024

for the data format, each state ends when the next state begins or when there is a null value.

we very recently added support for a second time field that can be used to indicate state endings, because null values (or "no data" states) can be difficult to insert using our transforms or query changes. (#84130)

@@ -19,9 +19,41 @@ weight: 100

# State timeline

State timelines show discrete state changes over time. Each field or series is rendered as its unique horizontal band. State regions can either be rendered with or without values. This visualization works well with string or boolean states but can also be used with time series. When used with time series, the thresholds are used to turn the numerical values into discrete state regions.
A state timeline panel displays data in a way that shows the state changes over time. When using a state timeline, the data is presented as a series of horizontal bars or bands called state regions. State regions can be rendered with or without values, and the state region’s length indicates a particular state's duration or frequency within a given time range.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is the first time i've seen the term "state regions". it may be confusing because this panel also supports region annotations. this is not a request to change the terminology, just a comment. i dont have a better name for them 😅

"horizontal bands" may alternatively be called "lanes"

Copy link
Collaborator

Choose a reason for hiding this comment

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

The "state regions" terminology exists in these docs all the way back to when this visualization was introduced in v8.0. I'm thinking since it's been here all this time, it would be more confusing to change it at this point unless we get significant feedback that it's confusing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The more I stare at the words "horizontal" and "length", the more I wonder if these are the correct words here. If we're talking about something we're measuring from left to right in a two-dimensional context, then that's really a "width" (like the way we'd refer to H and W of an image to control it's size). I've suggested removing the word "horizontal" entirely in my edit below because I don't think it's necessarily adding anything in terms of meaning.

If "length" makes sense to everyone else, I'm not intent on changing it; it just struck me as odd.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, it can be either, really. "length in time", and "width in pixels"

Copy link
Collaborator

@imatwawana imatwawana left a comment

Choose a reason for hiding this comment

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

This is a great start, @mdcruz! This really helps clarify why you'd want to use a state timeline and what kind of data you need to use one. I'll review this again once you've put the video in so I can just make sure the balance of the page still looks good and to catch any copy edits I missed on this review.

@@ -19,9 +19,41 @@ weight: 100

# State timeline

State timelines show discrete state changes over time. Each field or series is rendered as its unique horizontal band. State regions can either be rendered with or without values. This visualization works well with string or boolean states but can also be used with time series. When used with time series, the thresholds are used to turn the numerical values into discrete state regions.
A state timeline panel displays data in a way that shows the state changes over time. When using a state timeline, the data is presented as a series of horizontal bars or bands called state regions. State regions can be rendered with or without values, and the state region’s length indicates a particular state's duration or frequency within a given time range.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The more I stare at the words "horizontal" and "length", the more I wonder if these are the correct words here. If we're talking about something we're measuring from left to right in a two-dimensional context, then that's really a "width" (like the way we'd refer to H and W of an image to control it's size). I've suggested removing the word "horizontal" entirely in my edit below because I don't think it's necessarily adding anything in terms of meaning.

If "length" makes sense to everyone else, I'm not intent on changing it; it just struck me as odd.

@mdcruz
Copy link
Contributor Author

mdcruz commented Mar 12, 2024

for the data format, each state ends when the next state begins or when there is a null value.

we very recently added support for a second time field that can be used to indicate state endings, because null values (or "no data" states) can be difficult to insert using our transforms or query changes. (#84130)

Thank you, @leeoniya! I'll add this to the docs :)

mdcruz and others added 3 commits March 12, 2024 13:56
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
mdcruz and others added 2 commits March 14, 2024 09:08
…ne/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
Copy link
Contributor Author

@mdcruz mdcruz left a comment

Choose a reason for hiding this comment

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

@imatwawana I've added another state timeline example to show two time columns without null values, to reflect the latest changes that @leeoniya worked on here: #84130

@imatwawana
Copy link
Collaborator

@imatwawana I've added another state timeline example to show two time columns without null values, to reflect the latest changes that @leeoniya worked on here: #84130

Looks great!

@mdcruz mdcruz force-pushed the update-state-timeline-docs branch from a55807c to b262eba Compare March 18, 2024 14:06
Comment on lines 40 to 63
1. Click the Grafana menu icon and, in the sidebar, click Dashboards.

1. On the Dashboards page, click New in top right corner and select New Dashboard in the drop-down or select an existing dashboard.

1. Click + Add visualization.

1. Under the visualization type dropdown, change the visualization type from Time series to State timeline.

1. In the Query tab below the graph, select your data source of choice. For example, if you have the [Grafana TestData data source](https://grafana.com/docs/grafana/latest/datasources/testdata/) configured, select CSV content from the scenario dropdown.

1. Copy the following CSV data as an example:

```
Timestamps,Server A,Server B
2024-02-29 8:00:00,Up,Up
2024-02-29 8:15:00,null,Up
2024-02-29 8:30:00,Down,null
```

1. Under Transform data tab, click + Add transformation and click [Convert field type](https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/transform-data/#convert-field-type).

1. Convert the Timestamps field to be of type time.

1. Add customization to your state timeline by updating the different [state timeline options](#state-timeline-options).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's chat about this addition. We don't want to be repeating what is a fairly simple process (creating a visualization) over and over in the docs. We have docs that explain how to add visualizations that we can point folks to. Is the focus here the transformation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@imatwawana Can you point me to that doc explaining how to add visualization? I can link that instead. For the transformation, I have covered this as part of the video so we can remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Create a dashboard describes how to create a dashboard including adding a visualization and a data source.

@mdcruz mdcruz changed the title DRAFT: docs: initial updates to state timeline documentation docs: initial updates to state timeline documentation Mar 19, 2024
Copy link
Collaborator

@imatwawana imatwawana left a comment

Choose a reason for hiding this comment

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

Awesome!

@imatwawana imatwawana added backport v10.2.x backport v10.3.x Mark PR for automatic backport to v10.3.x backport v10.4.x labels Mar 19, 2024
Copy link
Contributor

This PR must be merged before a backport PR will be created.

2 similar comments
Copy link
Contributor

This PR must be merged before a backport PR will be created.

Copy link
Contributor

This PR must be merged before a backport PR will be created.

@imatwawana imatwawana merged commit 2f53906 into main Mar 19, 2024
20 checks passed
@imatwawana imatwawana deleted the update-state-timeline-docs branch March 19, 2024 16:07
grafana-delivery-bot bot pushed a commit that referenced this pull request Mar 19, 2024
* docs: initial updates to state timeline documentation

* docs: apply linting

* Apply suggestions from code review

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add feedback from PR review

* docs: apply linting

* Wording and formatting edits

* Fixed grammar

* Update docs/sources/panels-visualizations/visualizations/state-timeline/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add two examples for state timeline to show null values and two timestamps

* docs: add steps to configuring a state timeline

* docs: add state timeline video

* docs: add link to creating dashboards

* Changed link text and added version interpolation syntax

---------

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
(cherry picked from commit 2f53906)
grafana-delivery-bot bot pushed a commit that referenced this pull request Mar 19, 2024
* docs: initial updates to state timeline documentation

* docs: apply linting

* Apply suggestions from code review

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add feedback from PR review

* docs: apply linting

* Wording and formatting edits

* Fixed grammar

* Update docs/sources/panels-visualizations/visualizations/state-timeline/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add two examples for state timeline to show null values and two timestamps

* docs: add steps to configuring a state timeline

* docs: add state timeline video

* docs: add link to creating dashboards

* Changed link text and added version interpolation syntax

---------

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
(cherry picked from commit 2f53906)
grafana-delivery-bot bot pushed a commit that referenced this pull request Mar 19, 2024
* docs: initial updates to state timeline documentation

* docs: apply linting

* Apply suggestions from code review

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add feedback from PR review

* docs: apply linting

* Wording and formatting edits

* Fixed grammar

* Update docs/sources/panels-visualizations/visualizations/state-timeline/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add two examples for state timeline to show null values and two timestamps

* docs: add steps to configuring a state timeline

* docs: add state timeline video

* docs: add link to creating dashboards

* Changed link text and added version interpolation syntax

---------

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
(cherry picked from commit 2f53906)
imatwawana pushed a commit that referenced this pull request Mar 19, 2024
docs: initial updates to state timeline documentation (#84224)

* docs: initial updates to state timeline documentation

* docs: apply linting

* Apply suggestions from code review

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add feedback from PR review

* docs: apply linting

* Wording and formatting edits

* Fixed grammar

* Update docs/sources/panels-visualizations/visualizations/state-timeline/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add two examples for state timeline to show null values and two timestamps

* docs: add steps to configuring a state timeline

* docs: add state timeline video

* docs: add link to creating dashboards

* Changed link text and added version interpolation syntax

---------

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
(cherry picked from commit 2f53906)

Co-authored-by: Marie Cruz <mdcruz@users.noreply.github.com>
imatwawana pushed a commit that referenced this pull request Mar 19, 2024
docs: initial updates to state timeline documentation (#84224)

* docs: initial updates to state timeline documentation

* docs: apply linting

* Apply suggestions from code review

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add feedback from PR review

* docs: apply linting

* Wording and formatting edits

* Fixed grammar

* Update docs/sources/panels-visualizations/visualizations/state-timeline/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add two examples for state timeline to show null values and two timestamps

* docs: add steps to configuring a state timeline

* docs: add state timeline video

* docs: add link to creating dashboards

* Changed link text and added version interpolation syntax

---------

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
(cherry picked from commit 2f53906)

Co-authored-by: Marie Cruz <mdcruz@users.noreply.github.com>
imatwawana pushed a commit that referenced this pull request Mar 19, 2024
docs: initial updates to state timeline documentation (#84224)

* docs: initial updates to state timeline documentation

* docs: apply linting

* Apply suggestions from code review

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add feedback from PR review

* docs: apply linting

* Wording and formatting edits

* Fixed grammar

* Update docs/sources/panels-visualizations/visualizations/state-timeline/index.md

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>

* docs: add two examples for state timeline to show null values and two timestamps

* docs: add steps to configuring a state timeline

* docs: add state timeline video

* docs: add link to creating dashboards

* Changed link text and added version interpolation syntax

---------

Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
(cherry picked from commit 2f53906)

Co-authored-by: Marie Cruz <mdcruz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport v10.2.x backport v10.3.x Mark PR for automatic backport to v10.3.x backport v10.4.x no-changelog Skip including change in changelog/release notes type/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants