Grafana - Derived fields in Loki data source with multiple capture groups - grafana

I'm trying to add a derived field that consist of multiple parts. The help text in Grafana suggests that it should be possible to access multiple capture groups, but all I can find is the ${__value.raw} variable. Are there other undocumented variables to access other capture groups?

Related

Helm Template Processing Order

I'm trying to figure out the precise processing order for templates within Helm (v3.8.1 and newer). Specifically, I'm looking for the order in which individual files are processed - if any.
I'm trying to figure out the best means to render some common-use values based on child charts' values. I have some subcharts that will need to interoperate, and I'm aware of the availability of the "global" map in order to publish values consumable by all charts. I've not tested modifying the contents of "global" programmatically, but I expect this should be possible.
Regardless, what I'm getting at is that using static variables defined in values.yaml (global, specifically, or even subcharts' value overrides) may not be enough in order to achieve the interoperation I need for all of these subcharts.
Specifically, I would like for each subchart, as it's processed, to compute specific values that could be consumed for interoperation and then publish them to the "global" map (i.e. global.subchart1.someValue, global.subchart2.someOtherValue, etc).
For instance: one of my subcharts is an LDAP provider, but an external LDAP could also be used, so the LDAP URL is something that needs to be "computed" to either be the external one (manually-specified), or the internal component's one.
This type of modification would allow me to consume those values (if available) wherever interoperation is required, via a single source of truth.
I'm looking for something like this:
Parse the top-level chart's Chart.yaml
Parse and process the top-level chart's non-template files (_* files)
Repeat the prior two steps for all subcharts, recursively
Parse the top-level chart's values.yaml
Parse and process/render the top-level chart's remaining template files
Repeat the prior two steps for all subcharts, recursively
Ideally, also including the order in which files are processed (I'm currently presuming they're processed alphabetically).
I realize this is probably not the ideal scenario, but I do want the ability for each subchart to be able to export information akin to "my service is exported on this port, with this user and password" (yes, I'm aware that secrets would likely be required here, etc...), or "this is the search DN for the LDAP users", etc.

Is it possible to have 2 different data sources in grafana dashboard

Is it possible to have 2 different sources i.e influxdb and prometheus in a single dashboard in grafana.
Yes, each panel or variable on a dashboard can use different data source.
Variables can use different data source and you can use it on panel no matter what data source uses. It allows you to mix information to have a better dashboard with more details.
Also, you have three especial data sources:
Grafana built-in data source that generates random walk data.
Mixed query multiple data sources in the same panel.
Dashboard use a result set from another panel in the same dashboard.
More info about data sources here
Yes, you can select the desired data sources in several points of the dashboard configuration (like panels and variables) and you can use different values for each one.

Grafana and Prometheus: add metrics automatically

I'm using Grafana and Prometheus to monitor our server. We have a lot of database procedures like "select_users" or "insert_task". In order to monitor how many pending database procedure calls are there in the server, we add data points for every procedure call in Prometheus dynamically. Now we have data points like "pending_select_users", "pending_insert_task" in Prometheus.
However, since there are so many database procedures(and the number will increase during developing), it's not very practical for us to add metrics in Grafana for each data point manually. Is there a way we can add metrics dynamically in Grafana? Since all the data point have a common name prefix("pending_"), can we add metrics in Grafana with wildcard? Or is there a better way to do this?
Since Grafana uses JSON as the underlying dashboard DSL, you could dynamically create dashboards, every time you add a new metric, and import it (via API) into Grafana.
I'd add an automation on top of your Prometheus targets, scrape the metrics, and if new metrics (with the required prefix) are found without a matching dashboard, the automation would create it and import it into Grafana.
Grafana API: http://docs.grafana.org/http_api/ (specifically for Dashbboards).
The solution described by #Eitan is definitely feasible. The same goes for using a library like grafonnet to generate dashboards dynamically.
But the simplest approach in my opinion would be to create a variable in Grafana that contains all the label values you are interested in. Something like
label_values(metric_name{label_name=~"prefix*"}, label_name)
should work for that. And then use the repeating panels / rows feature of Grafana to repeat a set of panels for every value in the variable. Though this could get out of hand if you have dozens / hundreds of distinct values.
https://grafana.com/docs/grafana/latest/variables/repeat-panels-or-rows/
https://grafana.com/blog/2020/06/09/learn-grafana-how-to-automatically-repeat-rows-and-panels-in-dynamic-dashboards/
If you want to generate just a single dashboard from your Proimetheus metrics sample, you can use this service:
http://eljah.tatar/micrometer2grafana/

How to enrich metric data by external sources?

Example
I am getting series for a metric with a label called "store" which contains the "storeId". Now I would like to add another label "storeName" and fill it with external information (API-call/CSV/other Prometheus "metric"/merging from mysql/...). Is this possible? If so, which ways can I take?
Goal
is to show the resulting metric in Grafana graph-panels so that it contains names rather than IDs.

Tableau: how can I filter dimensions/metrics on the dashboard based on the user's previous selection

I just started working with Tableau and I fail to find a way to filter dimensions/metrics on the dashboard based on the user's previous selection.
We use MongoDB NoSQL database to store various events sent from our system.
Event consist of Key-Value pairs (translated to metrics and dimensions), each event has a unique Id (EventType) and a list of parameters.
The number of parameters per EventType is constant but vary between event types.
When we connect the Events catalog to Tableau (using MongoDB BI connector) we receive a flat table with all possible keys while only the ones that apply to the specific event has a value.
Since we have a lot of event types and a large number of possible keys (between them) this cause problems when using the dashboard.
The user see a flat list of all possible dimensions and metrics with no correlation between them.
He can not know which metric apply to which eventType.
How can I can guide Tableau to present/highlight only the relevant dimensions / metrics, based on the EventType selected by the user?
You click on the down arrow in the top right of the filter and then select Only Show Relevant Values.
Click for screenshot