-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Metric metadata endpoint #25359
Metric metadata endpoint #25359
Conversation
Haven't reviewed in detail, but I was just wanting this. Thanks for reading my mind! |
Reviewed 22 of 22 files at r1, 6 of 6 files at r2, 1 of 1 files at r3. pkg/kv/txn_coord_sender.go, line 167 at r1 (raw file):
nit: s/Units/Unit/ everywhere. pkg/server/status_test.go, line 416 at r3 (raw file):
You should be able to not use the zero value for that. pkg/server/serverpb/admin.proto, line 564 at r2 (raw file):
Spurious whitespace. pkg/server/serverpb/admin.proto, line 742 at r2 (raw file):
Spurious space. pkg/server/status/recorder.go, line 325 at r2 (raw file):
pkg/server/status/recorder.go, line 333 at r2 (raw file):
nit: trailing dot and leading space. pkg/storage/metrics.go, line 369 at r1 (raw file):
not pkg/util/metric/metric.go, line 90 at r1 (raw file):
AxisLabel and MetricType should be enums and since go doesn't have that, integers. Take a look here for inspiration. pkg/util/metric/registry.go, line 113 at r2 (raw file):
Comments from Reviewable |
Overall I think this is a great direction to go in. I left a bunch of comments about the implementation and some about specifics on the updates to existing metadata. Also, I have two general thoughts: I think most of the usages of Many of the metrics listed as a Reviewed 22 of 22 files at r1, 6 of 6 files at r2, 1 of 1 files at r3. pkg/rpc/clock_offset.go, line 51 at r3 (raw file):
These three metrics could use more specific labels. pkg/security/certificate_manager.go, line 36 at r3 (raw file):
These are actually not durations, they are a point in time. They could also use more specific labels. pkg/server/admin.go, line 152 at r3 (raw file):
s/metric's/metrics'/ pkg/server/node.go, line 69 at r3 (raw file):
This could use a more specific label. pkg/server/status_test.go, line 427 at r3 (raw file):
It would be helpful to have something to point to which metric, but maybe there isn't anything. pkg/server/serverpb/admin.proto, line 565 at r3 (raw file):
Please remove these empty lines. pkg/server/serverpb/admin.proto, line 742 at r3 (raw file):
Please remove the spaces on this empty line. pkg/server/status/recorder.go, line 178 at r3 (raw file):
I don't think this is a count. pkg/server/status/recorder.go, line 308 at r3 (raw file):
Our style is to use full sentences with a period in comments. pkg/server/status/recorder.go, line 318 at r3 (raw file):
Maybe worth returning an error here instead? pkg/server/status/runtime.go, line 58 at r3 (raw file):
This and the below percentages aren't counts. pkg/server/status/runtime.go, line 82 at r3 (raw file):
The units here don't match with the comment on the enum value, which will be more obvious if the units are all real units. pkg/server/status/runtime.go, line 148 at r3 (raw file):
Not a duration but rather a point in time. pkg/storage/metrics.go, line 90 at r3 (raw file):
I don't think this is measuring commands. pkg/storage/metrics.go, line 222 at r3 (raw file):
This seems to be measuring values, not keys. I'm not at all clear on how they could be different. Perhaps MVCC comes into play? pkg/storage/metrics.go, line 233 at r3 (raw file):
Likewise, the units on this and the next metric are incompatible with the enum comment. pkg/storage/metrics.go, line 245 at r3 (raw file):
This is a point in time, not a duration. pkg/storage/metrics.go, line 451 at r3 (raw file):
This label seems incongruous with the units... pkg/storage/metrics.go, line 813 at r3 (raw file):
Looks to be a count of transactions. pkg/ts/tspb/timeseries.proto, line 131 at r1 (raw file):
pkg/ts/tspb/timeseries.proto, line 133 at r1 (raw file):
s/simple/unitless/ pkg/ts/tspb/timeseries.proto, line 138 at r1 (raw file):
This enum mixes units (bytes) with measures (duration). I would suggest that we stick to units, since that's more specific and relevant for this usage. So if duration metrics are measured in nanoseconds, this enum value should be pkg/ts/tspb/timeseries.proto, line 146 at r1 (raw file):
Likewise, I don't think "axis" is appropriate here. pkg/ts/tspb/timeseries.proto, line 147 at r1 (raw file):
From usage this seems to be encoding the same information as the prometheus metric type. What's the intended usage of this? It seems to deviate from the pattern of the rest of the metadata. pkg/ts/tspb/timeseries.proto, line 135 at r3 (raw file):
Why are all these comments just "Units..."? pkg/ui/src/views/shared/components/metricQuery/index.tsx, line 28 at r3 (raw file):
I think this will need to be a manual mapping to account for the technical debt of the previous code. pkg/util/metric/counter_with_rates.go, line 58 at r3 (raw file):
Is this change safe? If there's not a failing test from it I suppose it's likely fine, but I wonder what the purpose of the old code was. pkg/util/metric/metric.go, line 24 at r1 (raw file):
It seems odd to have the dependency arrow in this direction. I think it would be preferable to not have code in pkg/util/metric/metric.go, line 75 at r1 (raw file):
Are these methods on pkg/util/metric/metric.go, line 105 at r1 (raw file):
I'm not sure it's adding much value listing all the labels here. These are a wide and growing set, putting the value inline with the title & description seems more appropriate. pkg/util/metric/metric.go, line 182 at r1 (raw file):
sp? pkg/util/metric/metric.go, line 193 at r1 (raw file):
It seems very odd to me to have a method named pkg/util/metric/metric.go, line 278 at r1 (raw file):
I'm pretty uncomfortable with these argument mutations. pkg/util/metric/registry.go, line 116 at r3 (raw file):
I'm pretty uncomfortable with this argument mutation. Comments from Reviewable |
Review status: all files reviewed at latest revision, 43 unresolved discussions, some commit checks failed. pkg/server/status/recorder.go, line 323 at r3 (raw file):
(This is about removing the dependency from Instead of calling type MetadataSource interface {
GetMetadata() metric.Metadata
}
func metadataToProto(meta metrics.Metadata) tspb.MetricsMetadata {
return tspb.MetricsMetadata{
Name: m.Name,
Help: m.Help,
Units: m.Units,
AxisLabel: m.AxisLabel,
MetricType: m.MetricType,
}
}
mr.mu.nodeRegistry.Each(func (name str, mtr interface{}) {
if metadataSrc, ok := mtr.(MetadataSource); ok {
metrics[name] = metadataToProto(metadataSrc.GetMetadata())
}
}) pkg/util/metric/metric.go, line 24 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
I'm going to agree with this; the pkg/util/metric/metric.go, line 90 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
MetricType yes, AxisLabel no - AxisLabel should remain a string and be inlined like Name and Help (see Andrew's comment below). MetricAxisUnits should also be defined here as a separate enumeration in order to break the util -> tspb dependency. pkg/util/metric/metric.go, line 105 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Agreed, these should be inlined; while there is some repetition, it's not enough in my opinion to justify moving to constant. pkg/util/metric/metric.go, line 193 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
This should also be removed as part of breaking the pkg/util/metric/metric.go, line 278 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
I agree in this case, it's not at all clear that the metadata parameter will be mutated. Instead, I would suggest adding an explicit GetMetadata() method to each metric type that fills in the type without mutating. For example: func (h *Histogram) GetMetadata() Metadata {
baseMetadata := h.Metadata
baseMetadata.MetricType = "Histogram"
return baseMetadata
} This has no mutations as Metadata is a value type. Notice that, as per both mine and Andrew's comments above about removing the dependency pkg/util/metric/registry.go, line 116 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
I think the mutation itself is fine in this case, the argument name "dest" is clear that the parameter is being mutated. That said, naming this method something like "WriteMetricsMetadata" would be more appropriate; essentially, using a verb that implies modification. However, see both mine and Andrew's comments above about removing the dependency Comments from Reviewable |
@mrtracy @couchand Do either of you have opinions about breaking the dependency I've created by creating a This new proto could define the entire Metadata struct, which I think is beneficial because it:
I've already done the work to ensure we can import the Prometheus field, so wanted to check the viability of the solution before moving forward. |
Review status: 1 of 33 files reviewed at latest revision, 44 unresolved discussions, all commit checks successful. pkg/kv/txn_coord_sender.go, line 167 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. pkg/rpc/clock_offset.go, line 51 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/security/certificate_manager.go, line 36 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/admin.go, line 152 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/node.go, line 69 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/status_test.go, line 416 at r3 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. pkg/server/status_test.go, line 427 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Without a name, there's nothing to work with. I added this mainly as a formality. Because that's the case, do you think it's worth including at all? pkg/server/serverpb/admin.proto, line 564 at r2 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. pkg/server/serverpb/admin.proto, line 742 at r2 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. pkg/server/serverpb/admin.proto, line 565 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/serverpb/admin.proto, line 742 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/status/recorder.go, line 325 at r2 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. pkg/server/status/recorder.go, line 333 at r2 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. pkg/server/status/recorder.go, line 178 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Added Const type pkg/server/status/recorder.go, line 308 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/status/recorder.go, line 318 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
I duplicated this code from a few lines above it. Glad to change it, but let me know if I should change it in both places. pkg/server/status/recorder.go, line 323 at r3 (raw file): Previously, mrtracy (Matt Tracy) wrote…
I opted to solve this by creating pkg/server/status/runtime.go, line 58 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/status/runtime.go, line 82 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/status/runtime.go, line 148 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/storage/metrics.go, line 369 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. pkg/storage/metrics.go, line 90 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/storage/metrics.go, line 222 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/storage/metrics.go, line 233 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/storage/metrics.go, line 245 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/storage/metrics.go, line 451 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/storage/metrics.go, line 813 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/util/metric/counter_with_rates.go, line 58 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Talked to @tschottdorf who was on the pkg/util/metric/metric.go, line 24 at r1 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Removed the bad dependency cycle by creating pkg/util/metric/metric.go, line 75 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Removed pkg/util/metric/metric.go, line 90 at r1 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Done. pkg/util/metric/metric.go, line 105 at r1 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Done. pkg/util/metric/metric.go, line 182 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/util/metric/metric.go, line 193 at r1 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Done. pkg/util/metric/metric.go, line 278 at r1 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Done. pkg/util/metric/registry.go, line 113 at r2 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. pkg/util/metric/registry.go, line 116 at r3 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Changed name, but opted for different approach for breaking pkg/ts/tspb/timeseries.proto, line 131 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ts/tspb/timeseries.proto, line 133 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ts/tspb/timeseries.proto, line 138 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ts/tspb/timeseries.proto, line 146 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ts/tspb/timeseries.proto, line 147 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
De-duplicated by importing Prometheus MetricType into pkg/ts/tspb/timeseries.proto, line 135 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Fixed this everywhere. I just inherited it from the existing code, but have improved the description in pkg/ui/src/views/shared/components/metricQuery/index.tsx, line 28 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Removed these changes and will address them in a future PR when this information actually integrates with the custom chart tool. Comments from Reviewable |
Integrated all feedback. This reflects two substantial changes. metric.proto
Importing Prometheus's client_model protoIn support of
|
It looks like you upgraded yarn.lock, even though you didn't touch any ui components in this commit. That should be reverted. Otherwise, this looks to be in pretty good shape. I had some questions about the "Key" fields on the response, if you could clarify their intended usage I would appreciate it! Review status: 1 of 33 files reviewed at latest revision, 44 unresolved discussions, some commit checks failed. pkg/server/status_test.go, line 424 at r7 (raw file):
Add a sanity check here that there are more than 0 metricsMetadata objects returned. This will pass trivially if GetMetricsMetadata returns nothing. Might even be safe to assert on the exact number; it would need to be updated each time somebody adds a metric, but that's good confirmation that the metric was successfully added. pkg/server/serverpb/admin.proto, line 561 at r7 (raw file):
What is the purpose of these two "Key" maps? I'm not sure how they're intended to be used, especially since they just appear to be copying the enumeration maps from metrics.proto. Where are you intending to use the string values for these units? pkg/util/metric/metric.proto, line 62 at r7 (raw file):
needs a newline at EOF Comments from Reviewable |
Review status: 1 of 32 files reviewed at latest revision, 47 unresolved discussions, all commit checks successful. pkg/server/status_test.go, line 424 at r7 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Never would have thought of that! Thank you. My apprehension with creating a const for the value is that:
However, if there's another solution or you think enumerating the number of metrics is worth doing, let me know and I can figure something out. pkg/server/serverpb/admin.proto, line 561 at r7 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Derp. Definitely deserves comments. #25765 is a feature request to make generating metric documentation simpler, which we'll be able to complete by using this endpoint. By including these key maps, we'll be able to more trivially/reliably create documentation from this endpoint, even if the enum grows/changes. pkg/util/metric/metric.proto, line 62 at r7 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Done. Comments from Reviewable |
I'll preemptively give this an LGTM assuming the sanity check is added to that test, everything else looks good so far as I can tell from a code review. Review status: 1 of 32 files reviewed at latest revision, 47 unresolved discussions, some commit checks failed. pkg/server/status_test.go, line 424 at r7 (raw file): Previously, sploiselle (Sean Loiselle) wrote…
Hmm, if the number of metrics isn't constant, than just do a sanity check - just set the number to something like 200 (there should be at least that many), just to make sure the number isn't zero. pkg/server/serverpb/admin.proto, line 561 at r7 (raw file): Previously, sploiselle (Sean Loiselle) wrote…
Gotcha. Comments from Reviewable |
Reviewed 3 of 34 files at r4, 3 of 9 files at r5, 16 of 26 files at r7, 3 of 5 files at r8, 7 of 7 files at r9, 1 of 1 files at r10. pkg/rpc/clock_offset.go, line 62 at r10 (raw file):
s/Latencies/Latency/ pkg/server/status_test.go, line 427 at r3 (raw file): Previously, sploiselle (Sean Loiselle) wrote…
this is probably about as good as we can get... pkg/server/serverpb/admin.proto, line 561 at r7 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Maybe the API endpoint should just return the stringified form? That would be more useful than forcing the user to do the mapping. pkg/server/status/runtime.go, line 82 at r3 (raw file): Previously, sploiselle (Sean Loiselle) wrote…
umm... I don't think that solved the problem: there's still a mismatch. pkg/storage/metrics.go, line 233 at r3 (raw file): Previously, sploiselle (Sean Loiselle) wrote…
It's still seconds vs nanoseconds... pkg/storage/metrics.go, line 738 at r10 (raw file):
All the other ones are "Processing Time", why is this one different? pkg/util/metric/metric.proto, line 48 at r10 (raw file):
I'd at least comment here and maybe add to the enum name the units of time since the epoch, since both seconds and milliseconds are common. pkg/util/metric/metric.proto, line 59 at r10 (raw file):
I'm not sure it's very clear what the difference between Comments from Reviewable |
Review status: pkg/rpc/clock_offset.go, line 62 at r10 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/status_test.go, line 424 at r7 (raw file): Previously, mrtracy (Matt Tracy) wrote…
Added a check to ensure that there are at least 200 metrics returned. pkg/server/serverpb/admin.proto, line 561 at r7 (raw file): Previously, couchand (Andrew Couch) wrote…
The primary use case is still to power the chart catalog, in which I was planning to use the actual enum value. I could convert them back from strings to the correct enum, but that feels like putting complexity in the wrong place. FWIW, I'm planning to write the tool to turn these into docs, and am glad to be the user handling the complexity. LMK if you'd prefer another approach like including both the enum and the string value or something. pkg/server/status/runtime.go, line 82 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Derp. Missed the Help text on the original pass. Added a I also removed mention of the units from the help text because they were used inconsistently when the units were nanoseconds, and they served more of a function historically when the unit wasn't explicitly set when the metadata was created. With an explicit statement of the metric's units, it's duplicative. pkg/storage/metrics.go, line 233 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Same thing here with adding seconds and removing mention of units from help, as well as fixing the Unit. pkg/storage/metrics.go, line 738 at r10 (raw file): Previously, couchand (Andrew Couch) wrote…
Oversight. Fixed. pkg/util/metric/metric.proto, line 48 at r10 (raw file): Previously, couchand (Andrew Couch) wrote…
Good catch here. There are timestamps in both seconds and nanoseconds, so that's fixed by adding I also filed an issue about second-based metrics (incl. timestamps) not rendering correctly in charts with the Duration unit. pkg/util/metric/metric.proto, line 59 at r10 (raw file): Previously, couchand (Andrew Couch) wrote…
How about "Measurement" and "Unit"? I tired Label, but that felt like it created an ambiguity with I think this works well because you could say, "I measured [measurement] in/as a [unit]", e.g. "I measured age in seconds." or "I measured MVCC Values as a count." Comments from Reviewable |
I think my main concern is about throwing in those static string maps. They don't seem to be adding specific value but they are introducing an overhead in the service definition. Otherwise, just left a bunch of lints on comments. Thanks! Reviewed 1 of 34 files at r4, 1 of 26 files at r7, 1 of 5 files at r8, 25 of 26 files at r11, 1 of 1 files at r12. pkg/rpc/clock_offset.go, line 55 at r12 (raw file):
not your change but there's a typo here pkg/server/serverpb/admin.proto, line 561 at r7 (raw file): Previously, sploiselle (Sean Loiselle) wrote…
We shouldn't be creating this explicitly, since the protobuf toolchain can already provide this functionality and is better positioned to do so. If a user is using the proto definitions, they already have this. If the user isn't using the proto definitions, we're serving them better by providing the stringified form. Adding these maps is a half-solution that serves no one best. pkg/util/metric/metric.go, line 53 at r12 (raw file):
Looks like this comment needs updating pkg/util/metric/metric.go, line 56 at r12 (raw file):
likewise pkg/util/metric/metric.proto, line 59 at r10 (raw file): Previously, sploiselle (Sean Loiselle) wrote…
Great. The grammarian in me wants it to be "measure" rather than "measurement" but I guess I won't push too hard on that. pkg/util/metric/metric.proto, line 36 at r12 (raw file):
update comment plz pkg/util/metric/metric.proto, line 48 at r12 (raw file):
Looks like this is the only one in ALL_CAPS pkg/util/metric/metric.proto, line 53 at r12 (raw file):
Looks like both these enum values' comments need updating Comments from Reviewable |
Review status: pkg/rpc/clock_offset.go, line 55 at r12 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/server/serverpb/admin.proto, line 561 at r7 (raw file): Previously, couchand (Andrew Couch) wrote…
I removed these entirely. I can work on solving this problem when I'm ready to pull the content into the docs site. pkg/util/metric/metric.go, line 53 at r12 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/util/metric/metric.go, line 56 at r12 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/util/metric/metric.proto, line 59 at r10 (raw file): Previously, couchand (Andrew Couch) wrote…
I heavily considered measure but because it's a homonym/graph of the verb, I decided to go with the totally unambiguous noun. pkg/util/metric/metric.proto, line 36 at r12 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/util/metric/metric.proto, line 48 at r12 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/util/metric/metric.proto, line 53 at r12 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. Comments from Reviewable |
Add formerly implicit properties to metric.Metadata struct to simplify generating charts Release note (general change): metric.Metadata now lets authors define options that are useful when being used in charts, Measurement (which will work as an axis label) and Units (which control which chart unit to display the metric's data).
Expose all metric metadata through an /_admin/ endpoint to make charts easier to create Relase note (general change): All metric's metadata is now available at `<Admin UI>/_admin/metricmetada`
To ensure that charts can be consistently and meaningfully interpreted, this test ensures that all metrics have Name, Help, AxisLabel, and MetricType set. Release note: None
bors r+ |
25359: Metric metadata endpoint r=sploiselle a=sploiselle This PR integrates two changes: - Makes explicit more metric metadata properties - Adds an endpoint to make all metric metadata externally consumbale ## Explicit Metric Metadata Timeseries metrics had two implicit metadata properties: - Units, which is the unit of data collected (Count, Bytes, or Duration) - AxisLabel, which is the element measured by the metric (i.e. what the Y-axis represents) Because these properties are used to display charts to users and do not change for the lifetime of the metric, they should be defined when the when the metric is created. This ensures end users can consistently and meaningfully interpret data in the way the metric's author intended. ### Testing This PR adds a test to `status_test.go` to ensure that all metrics metadata have a Name, Help, and AxisLabel defined. Because Units have a zero value of "Count", the test doesn't check for it being set. ## Metric Metadata Endpoint This PR adds an endpoint at `<Admin UI>/_admin/metricmetadata` that exposes all metric metadata, including the new Units and AxisLabel properties added in the first commit. While this endpoint doesn't have much intrinsic value, it will be leveraged to generate a catalog of timeseries charts. That commit is ready to go, but is large, so wanted to make more incremental changes by splitting them into two PRs. 26949: ui: properly segregate/aggregate app sql stats r=couchand a=couchand Previously we had been a bit lazy about the apps that statement statistics roll into, but feedback highlighted that the app was an important distinction for users. This adds support for apps to the statements list and details pages. The statements list now has a filter above the list to choose an app: <img width="548" alt="screen shot 2018-06-25 at 1 04 56 pm" src="https://user-images.githubusercontent.com/793969/41864643-aeba45bc-7878-11e8-85ff-60d39d71beb6.png"> The details page now lists all apps a query appears in (when viewing all apps) or just the stats relevant to a single app. <img width="466" alt="screen shot 2018-06-25 at 1 05 05 pm" src="https://user-images.githubusercontent.com/793969/41864691-d196db7c-7878-11e8-89d5-32717753a935.png"> Fixes: #26990 27039: sql: fix panic when renaming a scalar source r=justinj a=justinj Quite an edge case, found with RSG. Release note (bug fix): fixed a panic that could occur when renaming a scalar function used as a data source. 27042: cli: Fix ordering of columns in node status r=RaduBerinde a=neeral The header and data for columns updated_at and started_at were swapped. Example output before: ``` $ cockroach node status --insecure +----+--------------------+------------------------------------------+ | id | address | build | updated_at | started_at | is_live | +----+--------------------+------------------------------------------+ | 1 | neeral-M51AC:26257 | v2.1.0-alpha.20180604-872-g50ae724 | 2018-06-28 00:52:49.925433+00:00 | 2018-06-28 00:52:49.925691+00:00 | true | | 2 | neeral-M51AC:25262 | v2.1.0-alpha.20180604-848-ga22c68d-dirty | 2018-06-27 22:18:44.617039+00:00 | 2018-06-28 00:42:54.651608+00:00 | false | | 3 | neeral-M51AC:25263 | v2.1.0-alpha.20180604-849-g1782ff9-dirty | 2018-06-28 00:19:53.20144+00:00 | 2018-06-28 00:53:07.018604+00:00 | true | | 4 | neeral-M51AC:25264 | v2.1.0-alpha.20180604-849-g1782ff9-dirty | 2018-06-28 00:19:59.773341+00:00 | 2018-06-28 00:52:59.80999+00:00 | true | | 5 | neeral-M51AC:25265 | v2.1.0-alpha.20180604-849-g1782ff9-dirty | 2018-06-28 00:20:01.927442+00:00 | 2018-06-28 00:53:01.962355+00:00 | true | +----+--------------------+------------------------------------------+ ``` 27048: build: assert clean for submodules r=benesch a=tschottdorf I saw failing builds due to a dirty `c-deps/protobuf` directory; this isn't cleaned up by the prior version of the script (and it also does not tell you the diff). This new one will. Also added a second `-f` to `git clean` which does not stop in nested repos (excluding submodules). We don't need that but it seemed right to add it. Release note: None 27053: opt: fix panic in generating tuple IN constraints r=justinj a=justinj Fixes #27016. Previously this code would panic if there were no constrainable columns. I've added an equivalent test case to the one provided, but it will be difficult to run the test provided until #27034 lands. I suspect the problem there was with placeholders (it didn't panic with the old code and the placeholders replaced with constants). We should also consider adding prepared statement support to opt_tester so that we can test situations like that in the future. Release note (bug fix): Fix a panic in the optimizer with IN filters. Co-authored-by: Sean Loiselle <[email protected]> Co-authored-by: Andrew Couch <[email protected]> Co-authored-by: Justin Jaffray <[email protected]> Co-authored-by: neeral <[email protected]> Co-authored-by: Tobias Schottdorf <[email protected]>
Build succeeded |
This PR integrates two changes:
Explicit Metric Metadata
Timeseries metrics had two implicit metadata properties:
Because these properties are used to display charts to users and do not change for the lifetime of
the metric, they should be defined when the when the metric is created. This ensures end users can
consistently and meaningfully interpret data in the way the metric's author intended.
Testing
This PR adds a test to
status_test.go
to ensure that all metrics metadata have a Name, Help, and AxisLabel defined. Because Units have a zero value of "Count", the test doesn't check for it being set.Metric Metadata Endpoint
This PR adds an endpoint at
<Admin UI>/_admin/metricmetadata
that exposes all metric metadata, including the new Units and AxisLabel properties added in the first commit.While this endpoint doesn't have much intrinsic value, it will be leveraged to generate a catalog of timeseries charts. That commit is ready to go, but is large, so wanted to make more incremental changes by splitting them into two PRs.