VictoriaMetrics icon indicating copy to clipboard operation
VictoriaMetrics copied to clipboard

vmui: add select of Tenant ID

Open Loori-R opened this issue 2 years ago • 3 comments

Add select of Tenant ID to Settings You can either enter a custom value or choose from a list of options. The selected tenantID value is saved in the URL params. Upon page load, the tenantID value from the URL params is applied if it exists. The default value is 0

Loori-R avatar Jan 18 '23 14:01 Loori-R

Codecov Report

Base: 57.55% // Head: 57.57% // Increases project coverage by +0.01% :tada:

Coverage data is based on head (f291758) compared to base (465a285). Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3673      +/-   ##
==========================================
+ Coverage   57.55%   57.57%   +0.01%     
==========================================
  Files         310      310              
  Lines       52158    52158              
==========================================
+ Hits        30018    30028      +10     
+ Misses      20251    20245       -6     
+ Partials     1889     1885       -4     
Impacted Files Coverage Δ
lib/fasttime/fasttime.go 50.00% <0.00%> (-21.43%) :arrow_down:
lib/mergeset/table.go 63.76% <0.00%> (-0.09%) :arrow_down:
lib/storage/storage.go 71.26% <0.00%> (+0.11%) :arrow_up:
lib/storage/partition.go 61.76% <0.00%> (+0.26%) :arrow_up:
app/vmselect/promql/aggr_incremental.go 87.72% <0.00%> (+2.39%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Jan 18 '23 14:01 codecov[bot]

@Loori-R , is there a feature request linked to this pull request?

valyala avatar Jan 18 '23 15:01 valyala

@valyala, there is no feature request

Loori-R avatar Jan 18 '23 16:01 Loori-R

@Loori-R , could you update the following aspects of this feature?

  • To move the tenantID selector to the top header of vmui.
  • To show the tenantID selector only if the following conditions are met simulatenously:
    • vmui is loaded from the url containing tenantID, e.g. from /select/<tenantID>/[prometheus/]{vmui,graph}/ url . The url can differ if vmui is loaded via a proxy such as vmauth, which can use arbitrary different url. In this case the tenantID selector isn't needed.
    • vmui is able to successfully query the list of tenantIDs by requesting the /admin/tenants?start=...&end=... url on the selected time range according to https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format . The /admin/tenants url can be unavailable for querying if vmselect is hidden behind a proxy such as vmauth.
    • The returned list of tenantIDs contains more than a single entry. There is no sense in showing the selector if only a single tenantID is available.
  • The tenantID selector should provide auto-completion support from the list of tenantIDs obtained from /admin/tenants
  • When user selects the tenantID, then the server url (aka datasource url) should be updated accordingly and all the information displayed on the currently opened page should be re-loaded from the updated server url. The selected tenantID should be stored in the page url, so the url could be copy-n-pasted to another browser window and display the same page for the selected tenant.

valyala avatar Jan 20 '23 20:01 valyala

@valyala updated

Loori-R avatar Jan 23 '23 17:01 Loori-R

@Loori-R , could you resolve merge conflicts?

valyala avatar Jan 26 '23 18:01 valyala

resolved merge conflicts

Loori-R avatar Jan 27 '23 09:01 Loori-R

@Loori-R , thanks for implementing this feature!

valyala avatar Jan 27 '23 23:01 valyala

FYI, this pull request has been included in v1.87.0.

valyala avatar Feb 02 '23 04:02 valyala