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

Problem in Config #1

Closed
aerosadegh opened this issue May 10, 2020 · 5 comments
Closed

Problem in Config #1

aerosadegh opened this issue May 10, 2020 · 5 comments

Comments

@aerosadegh
Copy link

Hi
I want to use the plugin but, I cann't Config that.

I use Telegraf plugin http_listener_v2 on my server that grafana also was placed on it.

That Telegraf plugin was receives data and worked properly but this plugin seems don't send any data.

Please help me to fix this problem.
Thanks a lot.

@MacroPower
Copy link
Owner

Hey, could you please try placing an analytics panel on a dashboard and loading it with a network inspector open to see if a request is being attempted?

Using the http_listener is smart but I'm not sure if the JSON data_format will work with the output I'm sending. I might give it a try later this week to see if I can get something working, but I think I will need to change the returned object structure.

@aerosadegh
Copy link
Author

aerosadegh commented May 12, 2020

Thank you again.

I check Console in the Inspect Element:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://example.com:8080/telegraf. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://example.com:8080/telegraf. (Reason: CORS request did not succeed).
Can I fix this problem or you must change something in your plugin?

Exactly!
Your data structure needs to change for me.
When I try to Inject your JSON data-format to InfluxDB , I missed data in "user" field and some other keys.
Could you consider a suitable "line protocol" or other data_format to your plugin?

@MacroPower
Copy link
Owner

MacroPower commented Jun 9, 2020

Hello @aerosadegh , sorry this took so long. I've just updated the plugin to support Grafana 7, and while I was at it I flattened the output object. This is what the JSON looks like now:

{
 "server": "http://example.com:8080/telegraf",
 "description": "new-dashboard-copy",
 "key": "fCZ4jTmMk",
 "hidden": false,
 "postEnd": true,
 "host": "localhost:3000",
 "update": "",
 "isSignedIn": true,
 "id": 1,
 "login": "admin",
 "email": "admin@localhost",
 "name": "admin",
 "lightTheme": false,
 "orgCount": 1,
 "orgId": 1,
 "orgName": "Main Org.",
 "orgRole": "Admin",
 "isGrafanaAdmin": true,
 "gravatarUrl": "/avatar/46d229b033af06a191ff2267bca9ae56",
 "timezone": "browser",
 "locale": "en-US",
 "helpFlags1": 0,
 "hasEditPermissionInFolders": true,
 "time": 1591727672
}

I'm working on getting together an example Telegraf config to include as well :)

@MacroPower
Copy link
Owner

MacroPower commented Jun 9, 2020

Hello again,

I have added an example telegraf config in a new "example" directory, click here. Please feel free to play around with the options. I have the output set to file, just so it's a bit easier to test:

image

I also added a new option in the plugin's settings to disable cors, but I recommend that you instead solve the problem via putting telegraf behind a reverse proxy with proper certs.

The new version is not on the plugin repo yet, but you can manually grab it here: https://github.com/MacroPower/macropower-analytics-panel/releases/tag/v0.0.3

@MacroPower
Copy link
Owner

Telegraf support is now included in the official release https://grafana.com/grafana/plugins/macropower-analytics-panel

Please open another issue if you have any problems or questions!

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

No branches or pull requests

2 participants