GSoC 2025: Final Report | Grafana Data Source Plugin for istSOS4

Final Report

Title: Grafana Data Source Plugin for istSOS4
Organization: Istsos under OSGeo
Student Name: Mostafa Magdy
Mentor Name: Daniele Strigaro, Massimiliano Cannota, and Claudio Primerano
Program: Google Summer of Code 2025

Project Description

During Google Summer of Code 2025, I worked on the project “Grafana Data Source Plugin for istSOS4” for istSOS, part of the OSGeo Foundation. The goal of the project was to create an advanced Grafana plugin for istSOS4 that supports full OGC SensorThings API queries with complete parametrization.

What I Have Done

1. Configuration Interface

I developed a configuration interface to set up your server, authentication credentials, and default pagination fallback values for entities and expanded observation entity that will be used when no $Top values are specified.

2. Query Editor Interface

I created a query editor interface to configure most of the standard specifications including:

  • Filter
  • Expand
  • Select
  • Top
  • Skip
  • Entity ID
  • A text area for writing fully customized queries

Filtering Framework

The following types of filters are currently supported:

  • Basic filters: Common fields like IDs, names, and descriptions for almost all entities except observations (observations do not contain specific names or descriptions)
  • Temporal filters: Filter the phenomenon time and result time for datastreams
  • Spatial filters: Intersect and within geometric queries such as Point, Polygon, and LineString for locations and datastream observed areas
  • Measurement filters: Sensor-specific data filtering like unit and symbol measurements for datastream unit of measurement
  • Observation filters: Result, phenomenon time, and result time for observation entity
  • Entity filters: Manage relationships between entities (e.g., select datastreams based on specific sensors, things, and observed properties)

Expand options are customized based on the selected entity, which can be found in the constants.ts file. You have the option to write fully customized and complex filters using the customized option.

3. TerraDrawMap + Leaflet Integration

I integrated TerraDrawMap with Leaflet to draw complex geometries like polygons instead of writing them in WKT format. You can simply use the integrated map to query your spatial entity or attribute (currently locations and observed areas in datastreams).

For visualizing locations properly, the plugin installs the orchestracities-map-panel, which supports visualization of complex geometries, allowing you to create dashboards to visualize thing locations comprehensively.

4. Variables Support and Variable Chaining

  • Dashboard template variables: For dynamic queries
  • Variable chaining support: Create fully customizable and dynamic dashboards based on chained variables (variables that depend on other variables)

Note: You must write variables within single quotes for the values to be interpreted by the plugin when creating queries using the customized option.

For example, to filter Datastreams based on Things:

/Datastreams?$filter=Thing/id eq '$Things'

Using the implemented features, you can create:

Dynamic Panels & Dashboards

The ability to create panels and dashboards to visualize:

  • Datastream observations: Time-series data visualization
  • Locations and historical locations of things: Using orchestracities-map-panel that supports complex geometry visualizations

Example Dashboards:

Current State of the Project

The goal was to create a Grafana plugin for istSOS4 that supports full OGC SensorThings API queries with complete parametrization. Most important parameters now exist in the plugin, with the option to create customized ones. The plugin is ready to be used by the istSOS community and other standard communities’ implementers.

What I Have Learned

Throughout Google Summer of Code 2025, I learned a great deal about the SensorThings API standard and its implementation within the istSOS community. I gained valuable experience in:

  • Grafana SDK
  • TypeScript
  • Design patterns
  • Docker configurations
  • Open-source collaboration

Potential Future Work

  1. Enhance CRS transformations: Support all coordinate reference system formats by fetching non-stored formats from epsg.io (currently limited formats are available in the utils.ts file)
  2. Implement comprehensive caching mechanism: Improve performance through better data caching
  3. Transform the plugin into a chatbot: Enable natural language query construction (e.g., “Hello, I want all datastreams from the thing with ID x” would generate the query: Datastreams/$filter=Thing/id eq x)

Conclusion

As Google Summer of Code 2025 comes to a close, I am proud of the progress made on the Grafana plugin project. The code has been merged into its dedicated repository and is ready for use. I learned a great deal throughout the project and am excited to continue contributing to the open-source community, especially the istSOS community.

Acknowledgments

I would like to thank my mentors Daniele, Massimiliano, and Claudio for their guidance and support throughout Google Summer of Code 2025. Their feedback was invaluable and consistently pushed me toward improvement. I would also like to thank the OSGeo Foundation for providing me with the opportunity to work on this project. I am grateful for the experience.

Useful Links

1 Like