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

Fields: Regex - Operator UI updates and double-quotes #1028

Conversation

gtk-grafana
Copy link
Contributor

@gtk-grafana gtk-grafana commented Jan 30, 2025

This PR adds descriptions to the operators, fixes some bugs with generating regex fields, e2e coverage, and converts fields and metadata to use doublequotes instead of backticks.

NOTE: We had to copy the fetchDetectedFields from core Grafana since that PR missed the 11.5 cutoff. The implementation in this PR is not tested but it is a direct lift from the PR linked above, I'm hoping that we can upgrade quickly and remove this tech debt. The good news is that Grafana 11.3 should still work with this feature.

Parent branch: #1023
Child branch: #1029

@gtk-grafana gtk-grafana mentioned this pull request Jan 30, 2025
@gtk-grafana gtk-grafana marked this pull request as ready for review January 30, 2025 23:20
@gtk-grafana gtk-grafana requested a review from a team as a code owner January 30, 2025 23:20
@gtk-grafana gtk-grafana marked this pull request as draft January 31, 2025 15:19
@gtk-grafana
Copy link
Contributor Author

Let's wait on review of this until the child PRs are ready, and we'll work our way from the bottom to the top

@gtk-grafana gtk-grafana self-assigned this Feb 4, 2025
@gtk-grafana gtk-grafana added the enhancement New feature or request label Feb 4, 2025
@gtk-grafana gtk-grafana added this to the 1.0.8 milestone Feb 4, 2025
const filters = variable.state.filters.filter((f) => f.key !== currentKey);
const otherFiltersString = this.renderVariableFilters(variableType, filters);
const uninterpolatedExpression = this.getFieldsTagValuesExpression(variableType);
const expr = uninterpolatedExpression.replace(PENDING_FIELDS_EXPR, otherFiltersString);
const interpolated = sceneGraph.interpolate(this, expr);
return getFieldsKeysProvider(interpolated, this, sceneGraph.getTimeRange(this).state.value, variableType);
console.log('getFieldsTagKeysProvider', {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, removed in child branch

const otherFiltersString = this.renderVariableFilters(variableType, filters);
const uninterpolatedExpression = this.getFieldsTagValuesExpression(variableType);
const expr = uninterpolatedExpression.replace(PENDING_FIELDS_EXPR, otherFiltersString);
const interpolated = sceneGraph.interpolate(this, expr);

// @todo remove existing equal/notequal values
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also removed in child branch

@gtk-grafana gtk-grafana marked this pull request as ready for review February 4, 2025 14:22
… gtk-grafana/issues/1009/regex-fields-from-explore__operator-ui
… gtk-grafana/issues/1009/regex-fields-from-explore__operator-ui
gtk-grafana and others added 2 commits February 5, 2025 07:04
Co-authored-by: Matias Chomicki <[email protected]>
* feat: combine metadata and fields variables

Co-authored-by: Matias Chomicki <[email protected]>
@gtk-grafana gtk-grafana merged commit ec11d60 into gtk-grafana/issues/1009/regex-fields-from-explore Feb 5, 2025
2 of 3 checks passed
gtk-grafana added a commit that referenced this pull request Feb 5, 2025
* Fields: Regex - Supporting regex fields from Explore (#1023)
* Fields: Regex - Operator UI updates and double-quotes (#1028)
* Fields: Regex - Combining metadata and fields (#1029)
* Fields: Regex - custom multi-select levels variable  (#1030)

---------

Co-authored-by: Matias Chomicki <[email protected]>
@gtk-grafana gtk-grafana mentioned this pull request Feb 5, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants