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

Support format dropdown and support for rendering traces #329

Merged
merged 5 commits into from
Mar 21, 2023

Conversation

gingerwizard
Copy link
Collaborator

@gingerwizard gingerwizard commented Mar 21, 2023

This PR adds support for rendering traces in Explore and the traces panel. This is achieved through several changes:

  1. Maps, Tuples, and Arrays are now converted to json.RawMessage. This allows tags to rendered correctly. I think this is an improvement and shouldn't impact previous approach - which returned them as a string.
  2. For traces to be rendered we need the preferred visualization type to be set - see here and here. We have no good way of detecting the user is querying traces so we introduce a drop down where the user can specify the Format of the response. The default is Auto which means the current behaviour - so no backward compatibility break. If the user specifies the format it overrides the value sent to the server.

Note we maintain full backwards compatibility.

image

image

Thus also closes #300

@gingerwizard gingerwizard requested a review from a team as a code owner March 21, 2023 14:45
@gingerwizard
Copy link
Collaborator Author

@bossinc my tests pass locally. Can you put the CI failures here please.

@bossinc
Copy link
Collaborator

bossinc commented Mar 21, 2023

@gingerwizard

Running target: Lint
exec: golangci-lint "run" "./..."
pkg/plugin/driver_test.go:219:16: Error return value of `json.Unmarshal` is not checked (errcheck)
	json.Unmarshal(bytes, &rawJSON)
	              ^
Error: running "golangci-lint run ./..." failed with exit code 1```

Copy link
Collaborator

@bossinc bossinc left a comment

Choose a reason for hiding this comment

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

looks great!

@bossinc bossinc merged commit 625ac5d into grafana:main Mar 21, 2023
@mustafaakin
Copy link

Great development, I previously opened a discussion on Grafana but did not think opening an issue here. grafana/grafana#62924

I followed the instructions here to test it locally https://grafana.com/tutorials/build-a-data-source-plugin/ and but from the on the UI I see Plugin unavailable and same in logs and the additional this line: (I use M1 mac)

logger=plugin.loader t=2023-03-22T11:19:39.45338+03:00 level=error msg="Could not start plugin" pluginId=grafana-clickhouse-datasource err="fork/exec /Users/mustafa/projects
       │ /tmp/grafana-plugins/clickhouse-datasource/dist/gpx_clickhouse_darwin_arm64: no such file or directory"

I did not see any info on DEV_GUIDE.md about it. I might be missing a thing.

My plugin/dist folder is as follows:

CHANGELOG.md          README.md             img                   module.js.LICENSE.txt plugin.json
LICENSE               dashboards            module.js             module.js.map

@mshustov
Copy link
Collaborator

@mustafaakin maybe Grafana team will help you to run the plugin with Docker. In the meantime, you can try to run Grafana from sources following the guide https://github.com/grafana/grafana/blob/main/contribute/developer-guide.md
Don't forget to add to defaults.ini a path to the plugin folder https://github.com/grafana/grafana/blob/main/conf/defaults.ini#L27 and set allow_loading_unsigned_plugins=clickhouse-datasource

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.

Let user to specify "format as" in query builder
4 participants