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

grafana-pugin: Grafana plugin updated to use flamegraph_table report #2271

Merged
merged 4 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class DataSource extends DataSourceApi<ParcaQuery, ParcaDataSourceOptions
async getData(from: number, to: number, query: ParcaQuery): Promise<GrafanaParcaData> {
const profileSource = new MergedProfileSource(from, to, query.parcaQuery);
const flamegraphReq = profileSource.QueryRequest();
flamegraphReq.reportType = QueryRequest_ReportType.FLAMEGRAPH_UNSPECIFIED;
flamegraphReq.reportType = QueryRequest_ReportType.FLAMEGRAPH_TABLE;
const topTableReq = profileSource.QueryRequest();
topTableReq.reportType = QueryRequest_ReportType.TOP;

Expand Down
2 changes: 1 addition & 1 deletion ui/packages/app/grafana-datasource-plugin/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ParcaQuery extends DataQuery {
}

export const defaultQuery: Partial<ParcaQuery> = {
parcaQuery: 'process_cpu:cpu:nanoseconds:cpu:nanoseconds:delta{job="default"}',
parcaQuery: 'process_cpu:cpu:nanoseconds:cpu:nanoseconds:delta{}',
};

/**
Expand Down
19 changes: 1 addition & 18 deletions ui/packages/app/grafana-panel-plugin/src/ParcaPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import React, { useState } from 'react';
import { Provider } from 'react-redux';
import { PanelProps } from '@grafana/data';
import { css, cx } from 'emotion';
import { Icon, stylesFactory } from '@grafana/ui';
import { stylesFactory } from '@grafana/ui';
import { ProfileView, VisualizationType, ProfileVisState, GrafanaParcaData, MergedProfileSource } from '@parca/profile';
import { store } from '@parca/store';

Expand Down Expand Up @@ -50,23 +50,6 @@ export const ParcaPanel: React.FC<Props> = ({ data, width, height }) => {
<div className={styles.errorWrapper}>
<span>Something went wrong!</span>
<span>{response.error?.message}</span>
<span>
<br />
<strong>Note</strong>: Please make sure cors configuration of the Parca server allow requests from{' '}
<code>{window.location.origin}</code> origin.
<br />
Ensure that the Parca server is started with either{' '}
<code>--cors-allowed-origins=&apos;{window.location.origin}&apos;</code> or{' '}
<code>--cors-allowed-origins=&apos;*&apos;</code> flag. Please refer the{' '}
<a
href="https://www.parca.dev/docs/grafana-datasource-plugin#allow-cors-requests"
target="_blank"
rel="noreferrer noopener"
>
docs <Icon name="external-link-alt" />
</a>
.
</span>
</div>
);
}
Expand Down