Plugins 〉Sun and Moon


Developer

Christian Fetzer

Sign up to receive occasional product news and updates:


Grafana Cloud
Grafana Cloud
  • Grafana, of course
  • 10k series Prometheus metrics
  • 50 GB logs
  • 50 GB traces
  • 2,232 app o11y host hours
  • ...and more
Create free account

No credit card needed, ever.


Data Source
community

Sun and Moon

  • Overview
  • Installation
  • Change log
  • Related content

Build Status Coverage Status

Sun and Moon Datasource Plugin for Grafana

SunAndMoon is a Datasource Plugin for Grafana that calculates the position of Sun and Moon as well as the Moon illumination using SunCalc.

Additionally it provides annotations for sunrise, sunset, twilight, moonrise, moonset and others.

SunAndMoon

Configuration

All values are location dependent, the reference location needs to be configured in the datasource settings.

SunAndMoon Configuration

License

This projected is licensed under the terms of the MIT license.

Installing Sun and Moon on Grafana Cloud:

For more information, visit the docs on plugin installation.

Installing on a local Grafana:

For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.

1. Install the Data Source

Use the grafana-cli tool to install Sun and Moon from the commandline:

grafana-cli plugins install 

The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.

2. Configure the Data Source

Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section.

Next, click the Add data source button in the upper right. The data source will be available for selection in the Type select box.

To see a list of installed data sources, click the Plugins item in the main menu. Both core data sources and installed data sources will appear.

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

0.3.3 - 2024-07-09

Fixed

  • Prepare for compatibility with Grafana 12.0.

0.3.2 - 2024-06-09

Added

  • Provide maximum sun altitude value.

0.3.1 - 2024-06-08

Fixed

  • Compatibility with Grafana 11.0.

0.3.0 - 2022-11-11

Fixed

  • Noon and Midnight notifications did not show correct values for non default timezones.
  • The 'Min interval' query option was not taken into account.

Added

  • Events / annotations can be queried as metrics. This allows to visualize for example today's sunrise/sunset time on dashboards. (#20)
  • Dashboard options such as units are automatically set.

Changed

  • The annotations were migrated to the new react based plugin framework introduced in Grafana 7.2 and the plugin is no longer compatible with older versions of Grafana.
  • A single query now supports multiple metrics.

0.2.1 - 2020-11-27

Added

  • Allow per query override of location. (#35, #5)

0.2.0 - 2020-11-20

Fixed

  • Glitches in graphs caused by out of order data. (#29, grafana/#28804)
  • Annotations are no longer shown. (#31)
  • A metric is now preselected when using the datasource on a new panel.

Added

  • Location is now automatically configured.

Changed

  • The plugin was migrated to the new plugin framework introduced in Grafana 7.0 and is no longer compatible with older versions of Grafana.

0.1.6 - 2020-05-24

Fixed

  • Compatibility with Grafana 7.0.

0.1.5 - 2019-08-01

Fixed

  • Annotations were incorrectly tagged with a single tag per character (e.g. s, u, n instead of sun). (grafana/#15987)
  • Compatibility with Grafana v3.
  • Compatibility with Grafana v6.3.

0.1.4 - 2019-03-08

Added

0.1.3 - 2019-02-24

Fixed

  • Update SunCalc dependency to 1.8.0 with improved precision for moonrise/moonset calculations. (#8)
  • Update build dependencies to the latest versions. (#12)

0.1.2 - 2016-12-12

Fixed

  • Compatibility with Grafana 4.0. (#6)

0.1.1 - 2016-07-01

Fixed

  • Only the first of multiple configured annotations was displayed. (#2)

0.1.0 - 2016-06-27

Added

  • Initial version with sun and moon calculation and annotations.