Giter VIP home page Giter VIP logo

Comments (6)

mikhail-vl avatar mikhail-vl commented on June 10, 2024 1

@ianpmurphy Thank you for the details.

@vitPinchuk Please try to reproduce the following steps.

from volkovlabs-rss-datasource.

mikhail-vl avatar mikhail-vl commented on June 10, 2024

@ianpmurphy I have a couple of questions for you to understand the issue:

  • Do you use Grafana OSS, Cloud or Enterprise?
  • Do you use internal newsfeed or something we can try externally?

Data Source Caching is a Enterprise feature, which we don't have. We are looking into reproducing cache issue using Grafana OSS.

from volkovlabs-rss-datasource.

ianpmurphy avatar ianpmurphy commented on June 10, 2024

This is an on-prem grafana server pulling in an on-prem rss feed. The caching doesn't just take time to expire entries, it doesn't work at all. Sometimes a feed entry will update a few hours later, but others will not update for months. Seriously, months.

There doesn't seem to be any way to get the module to update what its displaying and I've tried everything.

from volkovlabs-rss-datasource.

mikhail-vl avatar mikhail-vl commented on June 10, 2024

@ianpmurphy It's the first time we hear about this issue. No-one reported this issue before.

What is your Grafana version?
Is it possible that it's cached in your browser? Can you try with different browser?
We just released a new version 4.0.0. Could you please try it and let us know.

from volkovlabs-rss-datasource.

ianpmurphy avatar ianpmurphy commented on June 10, 2024

I just tried the following:

  • I modified some rss content (its a simple .rss text file in a folder on iis)
  • I verified that the web page was serving the updated rss file
  • I updated to the latest grafana version
  • I updated the volkom plugin to version 4.0.0 of whats now known as business news
  • I opened a dashboard with an instance of the volkov rss - it still displays the pre-edit values.

from volkovlabs-rss-datasource.

vitPinchuk avatar vitPinchuk commented on June 10, 2024

Hi @ianpmurphy
I made a simple rss in node.js with 2 routers.
The 1st returns a file that I can change, and the 2nd always returns a random number of items.
I have used both routes, all my changes are applied correctly after a page refresh.
The panel does not cache the data.

image
image

Here a few examples
my xml file

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">

<channel>
  <title>W3Schools Home Page</title>
  <link>https://www.w3schools.com</link>
  <description>Free web building tutorials</description>
  <item>
    <title>RSS Tutorial</title>
    <link>https://www.w3schools.com/xml/xml_rss.asp</link>
    <description>New RSS tutorial on W3Schools</description>
  </item>
  <item>
    <title>XML Tutorial 1</title>
    <link>https://www.w3schools.com/xml</link>
    <description>New XML tutorial on W3Schools</description>
  </item>
  <item>
    <title>XML Tutorial 2</title>
    <link>https://www.w3schools.com/xml</link>
    <description>New XML tutorial on W3Schools</description>
  </item>
  <item>
    <title>XML Tutorial 3</title>
    <link>https://www.w3schools.com/xml</link>
    <description>New XML tutorial on W3Schools</description>
  </item>
   <item>
    <title>XML Tutorial 4</title>
    <link>https://www.w3schools.com/xml</link>
    <description>New XML tutorial on W3Schools</description>
  </item>
</channel>

</rss>

view on dashboard
image

I updated file

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">

<channel>
  <title>W3Schools Home Page</title>
  <link>https://www.w3schools.com</link>
  <description>Free web building tutorials</description>
  <item>
    <title>RSS Tutorial</title>
    <link>https://www.w3schools.com/xml/xml_rss.asp</link>
    <description>New RSS tutorial on W3Schools</description>
  </item>
  <item>
    <title>XML Tutorial 1</title>
    <link>https://www.w3schools.com/xml</link>
    <description>New XML tutorial on W3Schools</description>
  </item>
   <item>
    <title>XML Tutorial 4</title>
    <link>https://www.w3schools.com/xml</link>
    <description>New XML tutorial on W3Schools</description>
  </item>
</channel>

</rss>

I see corret data

image

There is code as example. You can try run it local and checked
index.js file

const express = require("express");
const xmlbuilder = require("xmlbuilder");
const fs = require("fs");
const path = require("path");

const app = express();
const port = 8001;

app.get("/feed", (req, res) => {
  const xml = generateRandomXml();
  res.type("application/rss+xml");
  res.send(xml);
});

app.get("/rss", (req, res) => {
  const filePath = path.join(__dirname, "xml", "rss.xml");
  fs.readFile(filePath, "utf8", (err, data) => {
    if (err) {
      console.error(err);
      res.status(500).send("Internal Server Error");
    } else {
      res.type("application/xml");
      res.send(data);
    }
  });
});

function generateRandomXml() {
  const root = xmlbuilder.create("rss");
  root.att("version", "2.0");

  const channel = root.ele("channel");
  channel.ele("title", "Random RSS Feed");
  channel.ele("link", "https://example.com");

  for (let i = 0; i < Math.floor(Math.random() * 25 + 1); i++) {
    const item = channel.ele("item");
    item.ele("title", `Item ${i}`);
    item.ele("description", `This is item ${i}`);
  }

  return root.end({ pretty: true });
}

app.listen(port, () => {
  console.log(`Server is running on port ${port}`);
});

package.json file

{
  "dependencies": {
    "express": "^4.19.2",
    "fs": "^0.0.1-security",
    "kill-port": "^2.0.1",
    "path": "^0.12.7",
    "xmlbuilder": "^15.1.1"
  },
  "scripts": {
    "start": "node index.js"
  }
}

the app structure
image

rss.xml file in xml folder

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">

<channel>
  <title>W3Schools Home Page</title>
  <link>https://www.w3schools.com</link>
  <description>Free web building tutorials</description>
  <item>
    <title>RSS Tutorial</title>
    <link>https://www.w3schools.com/xml/xml_rss.asp</link>
    <description>New RSS tutorial on W3Schools</description>
  </item>
  <item>
    <title>XML Tutorial 1</title>
    <link>https://www.w3schools.com/xml</link>
    <description>New XML tutorial on W3Schools</description>
  </item>
   <item>
    <title>XML Tutorial 4</title>
    <link>https://www.w3schools.com/xml</link>
    <description>New XML tutorial on W3Schools</description>
  </item>
</channel>

</rss>

1.Make folder with app name
2. create package.json
3. create index.js file
4. make into App folder folder with name "xml"
5. place rss.xml file into "xml" folder
6. run in terminal npm i
7. app start witn npm run start
works in port 8001

from volkovlabs-rss-datasource.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.