Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Datasource: Implement the query API #148

Merged
merged 1 commit into from Aug 11, 2022

Conversation

aocenas
Copy link
Member

@aocenas aocenas commented Aug 10, 2022

Basic code to get a request from the front end, send a request to Fire and then parse and package into DataFrame and send back.

The format of the data frame is a bit simple as the data for the profile does not match our dataFrame structure that well and in the future that may be changed.

Label(): string {
return this.name + " - " + this.sampleType;
}
export interface ProfileTypeMessage {
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed this to just use the message from the back end instead of packaging into data object. There does not seem that much benefit right now.


type Props = QueryEditorProps<DataSource, Query, MyDataSourceOptions>;

export function QueryEditor(props: Props) {
const [profileTypes, setProfileTypes] = useState<CascaderOption[]>([]);
const [profileTypes, setProfileTypes] = useState<ProfileTypeMessage[]>([]);
Copy link
Member Author

@aocenas aocenas Aug 10, 2022

Choose a reason for hiding this comment

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

Cascader option are generated from this later on. Having this in raw messages makes it easier to search through them.

LabelSelector: string;
ProfileType?: ProfileType;
labelSelector: string;
profileTypeId: string;
Copy link
Member Author

Choose a reason for hiding this comment

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

Sending just the ID seems a bit more sensible than the while type, and backend only requires the ID anyway.

Copy link
Contributor

@joey-grafana joey-grafana left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@aocenas aocenas merged commit 29838f5 into main Aug 11, 2022
@aocenas aocenas deleted the aocenas/datasource-implement-querying branch August 11, 2022 09:24
simonswine pushed a commit to simonswine/pyroscope that referenced this pull request Jun 30, 2023
Datasource: Implement the query API
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants