-
Notifications
You must be signed in to change notification settings - Fork 712
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
Report data structure documentation #2025
Report data structure documentation #2025
Conversation
9b85635
to
278a356
Compare
site/plugins.md
Outdated
### Time Window | ||
A report may have an attribute called `Window`. | ||
This is the time window, expressed as duration, within which the data contained in the report are considered valid. | ||
The default window is 15 seconds |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@ekimekim Considering you would have appreciated this sort of documentation recently, would you mind reviewing it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of open questions. A few formatting comments.
site/plugins.md
Outdated
} | ||
``` | ||
|
||
Nodes are stored in dictionary. The ID of nodes representing hosts or containers have the format `ID;<type>`, with type equal `host` or `container` accordingly. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
|
||
- `latest` - the latest values to display. | ||
- `latestControls` - the latest available controls. | ||
- `metrics` - the collection of metrics to display in the UI. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
|
||
- `timestamp` is the timestamp of when the control was exposed. | ||
- `value` is an object containing the control value. At the moment, only the state is available. | ||
- `Dead` is a boolean to know the state (active, dead) of a control. It is useful to show controls only when they are in a usable state. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `Dead` is a boolean to know the state (active, dead) of a control. It is useful to show controls only when they are in a usable state. | ||
|
||
### Metadata Templates | ||
Metadata Templates describe of a particular metadata. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `from` indicates where to look for the metadata. The possible values are: | ||
- `latest` | ||
- `sets` | ||
- `counters` |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
|
||
- `metric-template-id` and `id` identify a particular metric template. | ||
- `label` contains the label that will be used by Scope UI. | ||
- `format` describes who the metrics is formatted. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `label` contains the label that will be used by Scope UI. | ||
- `format` describes who the metrics is formatted. | ||
- `percent` the metric value is a percentage. | ||
- `filesize` the metric value is a file size (e.g. memory usage). |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
} | ||
``` | ||
|
||
### Metrics |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
|
||
- `metadata-template-identifier` and `id` identify a particular metadata template. | ||
- `label` contains the label that will be used by Scope UI. | ||
- `priority` is a floating point value used to decide the display ordering (lower values are displayed before higher ones). |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
"another-metadata-template-id": {...} | ||
} | ||
``` | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@alepuccetti Ping |
@2opremio I will get back to this soon. Lately, I was busy debugging and testing the ebpf program distro agnostic. |
278a356
to
0776d9d
Compare
I added a new commit for an easier review, I will squash it before merge. |
2918e8b
to
f6e4b16
Compare
c6f0244
to
720365e
Compare
@alepuccetti ping |
I am on vacation, I will be back the 15th.
On Sat, Mar 11, 2017 at 4:47 PM Alfonso Acosta ***@***.***> wrote:
@alepuccetti <https://github.com/alepuccetti> ping
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2025 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGRc72Lr0kehwIUV5wSk3VY6UvqOdyxUks5rkm2ugaJpZM4K5oHq>
.
--
Alessandro Puccetti
|
site/plugins.md
Outdated
To pair metadata with its template, it is necessary to use the `metadata-template-id` as a key to identify that particular piece of data. Example: | ||
|
||
```json | ||
"metadata-templates": { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
A report can contain many types of information. | ||
If you go back to the [Reporter Interface](#reporter-interface) section, you see the top-level `Plugins` attribute. | ||
Along with that, a report may contain multiple topologies. | ||
An example of a report containing few topologies is the following: |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
|
||
### Topologies | ||
Topologies can be of various types. | ||
Each topology consists of a list of nodes and other information about the topology. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `table_templates` - contains the templates used to render tables into the Scope UI. | ||
- `metric_templates` - contains the templates used to render metrics into the Scope UI. | ||
|
||
**Note**: These attribute are not required. But a topology with no `nodes` does not have any information to render, `metadata_templates`, as well as `table_templates`, are needed to know how to render the information carried by `nodes` in the Scope UI. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
|
||
### Nodes | ||
A Node contains information about a specific element of a topology. | ||
For example the Host topology will contain nodes describing all the hosts in it. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
### Nodes | ||
A Node contains information about a specific element of a topology. | ||
For example the Host topology will contain nodes describing all the hosts in it. | ||
The same is for containers and Container topology, pods and Pod topology and so on. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
} | ||
``` | ||
|
||
- `timestamp` is the timestamp of when the control was exposed. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `metadata-template-identifier` and `id` identify a particular metadata template. | ||
- `label` contains the label that will be used by Scope UI. | ||
- `dataType` specifies the type of data, this will determine how the value is displayed. Possible values for this attribute are: number, ip, and datetime. | ||
- `priority` is a floating point value used to decide the display ordering (lower values are displayed before higher ones). If it is omitted the UI display the value as last. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `label` contains the label that will be used by Scope UI. | ||
- `prefix` is used to identify which metadata templates belong to the table. | ||
|
||
If you want to display data in a table, you have to define a table template and prepend the table prefix to all the metadata templates that identifies the data you want to put in such table. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
The following is an example of a report with a metric and a its metric template: | ||
|
||
```json | ||
"metric_templates": { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
This is the time window, expressed as duration, within which the data contained in the report are considered valid. | ||
The default window is 15 seconds. | ||
You may change the window value using the option `-app.window <SECONDS>` when launching scope. | ||
However, using values less than 15 seconds increases the change of information not be correctly displayed. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
720365e
to
68d9dcb
Compare
I rebased the branch, squashed the commits & added a couple of new fixes from the review above. |
site/plugins.md
Outdated
This is the time window, expressed as duration, within which the data contained in the report are considered valid. | ||
The default window is 15 seconds. | ||
You may change the window value using the option `-app.window <SECONDS>` when launching scope. | ||
However, using values less than 15 seconds increases the chance of information not being correctly displayed. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
**See Also** | ||
### <a id="report-data-structures"></a>Report Data structures | ||
A report can contain many types of information. | ||
If you go back to the [Reporter Interface](#reporter-interface) section, you see the top-level `Plugins` attribute. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
### Topologies | ||
Topologies can be of various types. | ||
Each topology consists of some general information and a list of nodes. | ||
The available topologies are: |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
Each topology consists of some general information and a list of nodes. | ||
The available topologies are: | ||
|
||
- `Endpoint` nodes are (address, port) tuples on each host. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
### Controls | ||
Controls describe interfaces that expose actions that the user can perform on different objects (e.g. host, container, etc.). | ||
Controls are an element of nodes. In this way, each control in a node is attached to it and performs an action on the object described by the node itself. Below is an example of how controls are represented in the JSON report. | ||
In the report the attribute `latest_controls` contains all the controls exposed by scope and/or plugins, but only those alive will be listed in the attribute `controls`. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
### Metadata | ||
All metadata entries are placed within nodes in the section named `latest`. | ||
This section contains the latest values to display and consists of `timestamp` and `value`. | ||
Both should be written as strings in the json (with the double quotes). |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `dataType` specifies the type of data, this will determine how the value is displayed. Possible values for this attribute are: "number", "ip", "datetime" and "" for strings. | ||
- `priority` is a floating point value used to decide the display ordering (lower values are displayed before higher ones). If omitted, the UI will display it last. | ||
- `from` indicates where to look for the metadata. The possible values are: | ||
- `latest` |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `metric-template-id` and `id` identify a particular metric template. | ||
- `label` contains the label that will be used by Scope UI. | ||
- `format` describes how the metrics is formatted. | ||
- `percent` the metric value is a percentage. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@ekimekim: please take a second look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot better but still missing some important information.
- `Pods` nodes represent all Kubernetes pods running on hosts running probes. | ||
- `Service` nodes represent all Kubernetes services running on hosts running probes. | ||
- `Deployment` nodes represent all Kubernetes deployments running on hosts running probes. | ||
- `ReplicaSet` nodes represent all Kubernetes ReplicaSets running on hosts running probes. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
``` | ||
|
||
Nodes are stored in a dictionary. | ||
The ID of nodes representing hosts or containers has the format `ID;<type>`, with type equal to the literal string `host` or `container` respectively. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
} | ||
``` | ||
|
||
- `metadata-template-identifier` and `id` identify a particular metadata template. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `from` indicates where to look for the metadata. The possible values are: | ||
- `latest` | ||
- `sets` | ||
- `counters` |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@ekimekim please take a look again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing worth mentioning I just thought of. But everything currently here looks good. I'm happy to merge as is.
site/plugins.md
Outdated
@@ -467,6 +467,8 @@ In particular, a node may contain: | |||
- `latest` - an id-value map containing the latest values. Each id has only one value. | |||
- `latestControls` - the latest available controls. | |||
- `metrics` - the collection of metrics to display in the UI. Each metric has multiple timestamped values. | |||
- `sets` - a string->set-of-strings map, for example a list of local networks. | |||
- `counters` - a string->int map. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small tweaks to the text
site/plugins.md
Outdated
@@ -16,7 +16,8 @@ The following topics are discussed: | |||
* [Naming Nodes](#naming-nodes) | |||
* [A Guide to Developing Plugins](#plugins-developing-guide) | |||
* [Setting up the Structure](#structure) | |||
* [Defining the Reporter Interface](#reporter-interface) | |||
* [Defining the Reporter Interface](#defining-reporter-interface) | |||
* [Report Data Structures](#report-data-structures) | |||
|
|||
Any kind of metrics can be generated and inserted into Scope using custom plugins. Metrics generated through your plugin are displayed in the user interface alongside the standard set of metrics that are found in Weave Scope. | |||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
Topologies can be of various types. | ||
Each topology consists of some general information and a list of nodes. | ||
These are the available topologies: | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
All metadata entries are placed within nodes in the section named `latest`. | ||
This section contains the latest values to display and consists of `timestamp` and `value`. | ||
Both should be written as json strings (with double quotes). | ||
Scope uses `metadata_templates` to know how to display such data. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
|
||
### Metadata Templates | ||
Metadata Templates describe a particular metadata item. | ||
This description is used to extract metadata from a node and display it on Scope UI. | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `id` is a string identifying the particular metadata template (here `traffic-control-pktloss`) and is also used as a key to the template value. | ||
- `label` contains the label that will be used by Scope UI. | ||
- `dataType` specifies the type of data, this will determine how the value is displayed. Possible values for this attribute are: "number", "ip", "datetime" and "" for strings. | ||
- `priority` is a floating point value used to decide the display ordering (lower values are displayed before higher ones). If omitted, the UI will display it last. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
|
||
### Table Templates | ||
Table Templates describe a table and how to identify which metadata templates belong to the table. | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `prefix` is used to identify which metadata templates belong to the table. | ||
|
||
If you want to display data in a table, you have to define a table template and prepend the table prefix to all the metadata templates that identify the data you want to put in such table. | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
Scope uses the `metric_templates` to know how to display such data. To pair a metric with its template, it is necessary to use the `metric-template-id` as key to identify that particular metric. | ||
Metrics are suitable for information such as CPU and memory usage, HTTP requests rate, I/O operations, etc. | ||
The following is an example of a report with a metric preceded by its metric template: | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
- `metric-template-id` and `id` identify a particular metric template. | ||
- `label` contains the label that will be used by Scope UI. | ||
- `format` describes how the metrics is formatted. | ||
- `percent` the metric value is a percentage. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
site/plugins.md
Outdated
The default window is 15 seconds. | ||
You may change the window value using the option `-app.window <SECONDS>` when launching scope. | ||
However, using values smaller than 15 seconds increases the chance of information not being correctly displayed. | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This patch adds the report's data structures outline and specifications for the topologies, the nodes, the metadata templates, the table templates, the metric templates, the controls, the metadata, the metrics and the time window.
From Anita Buehrle's review
4a4a248
to
1bc0bca
Compare
Thanks for the review, I rebased & pushed a new commit with changes from @abuehrle's review. |
lint complains in CircleCI after the rebase, even after a CircleCI build without cache:
I don't understand why: this PR only changes the documentation, not the code. |
At a guess: this may be another case of a bug I feel I've seen before (maybe only locally? i don't recall) where "no code files changed" somehow becomes "check all files". I'll check it out. In the meantime, feel free to ignore the failing lint check and we can merge once @abuehrle is happy. |
LGTM |
For the record, CircleCI was happy with this PR once it got merged into master: https://circleci.com/gh/weaveworks/scope/7076 |
This PR adds documentation for the primary data structures used to create a report. It will be of great help to developers that want to build their plugins.
I did this work on the website. Do you want me to add the same information on https://github.com/weaveworks/scope/blob/master/examples/plugins/README.md?
Relevant to #1963
/cc @2opremio @abuehrle