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

Chore: Migrate #99348 from grafana/grafana #52

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Conversation

yangkb09
Copy link
Contributor

Fixes: #36

Ref: #35

PR in grafana/grafana: grafana/grafana#99348

@yangkb09 yangkb09 self-assigned this Jan 30, 2025
@yangkb09 yangkb09 added this to the 1.0.0 milestone Jan 30, 2025
Comment on lines +116 to +120
if (!this._metricsMetadata && !ds.languageProvider.metricsMetadata) {
await ds.languageProvider.loadMetricsMetadata();
this._metricsMetadata = ds.languageProvider.metricsMetadata;
}

Copy link
Contributor Author

@yangkb09 yangkb09 Jan 30, 2025

Choose a reason for hiding this comment

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

i removed the wrapper

if (ds.languageProvider instanceof PromQlLanguageProvider) {

because we're already checking if (ds && above on 106

const suffix: string = metric.split('_').pop() ?? '';
// the string is not equal to bucket
const notClassic = suffix !== 'bucket';
if (metadata?.[metric]?.type === 'histogram' && notClassic) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yangkb09 yangkb09 merged commit de821a6 into main Jan 30, 2025
4 of 5 checks passed
@yangkb09 yangkb09 deleted the 36/addmetadataheuristic branch January 30, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add metadata heuristic
1 participant