Skip to content

Add alerting support #689

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

Open
wants to merge 14 commits into
base: 0.7.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
/coverage/
/dist/
/node_modules/

# Ignore packaged plugins
*.zip
12 changes: 12 additions & 0 deletions Magefile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build mage
// +build mage

package main

import (
// mage:import
build "github.com/grafana/grafana-plugin-sdk-go/build"
)

// Default configures the default target.
var Default = build.BuildAll
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CC := go
PKG_NAME := "uam_gtom"
VERSION := "1.0.0"
TRASH := dist $(PKG_NAME) *.zip
Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Package name inconsistency and versioning concerns.

The package name "uam_gtom" doesn't match the repository name "GrafanaJsonDatasource" or the backend plugin ID "jsonds-backend" used in pkg/main.go.

CC := go
- PKG_NAME := "uam_gtom"
+ PKG_NAME := "jsonds"
VERSION := "1.0.0"
TRASH := dist $(PKG_NAME) *.zip

Also consider implementing dynamic versioning rather than hardcoding the version.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CC := go
PKG_NAME := "uam_gtom"
VERSION := "1.0.0"
TRASH := dist $(PKG_NAME) *.zip
CC := go
PKG_NAME := "jsonds"
VERSION := "1.0.0"
TRASH := dist $(PKG_NAME) *.zip


# Be sure to check https://grafana.com/developers/plugin-tools/publish-a-plugin/package-a-plugin?current-package-manager=yarn

package: clean build
mv dist/ $(PKG_NAME)
zip $(PKG_NAME)-$(VERSION).zip $(PKG_NAME) -r
rm -rf $(PKG_NAME)

build: frontend backend

frontend:
yarn build

backend:
mage -v build:linux

.PHONY: clean

clean:
rm -rf $(TRASH)
92 changes: 92 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
module github.com/simPod/GrafanaJsonDatasource

go 1.23
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify Go version compatibility

The module specifies Go 1.23, which appears to be a future version (as of April 2024, Go 1.22 is the latest stable release). This might cause compatibility issues when building or running the plugin in environments using currently available Go versions.

Consider using a released Go version (e.g., 1.22) to ensure wider compatibility. Please verify the required Go version for the Grafana Plugin SDK being used.


🌐 Web query:

What is the latest stable version of Go as of April 2024?

💡 Result:

The latest stable version of Go as of April 2024 was Go 1.22. The most recent minor release at that time was Go 1.22.2, issued on April 3, 2024[7].

Key details about Go 1.22:

  • Introduced safer loop variable semantics to prevent accidental sharing bugs[10].
  • Added support for ranging over integers and HTTP routing pattern enhancements[10].
  • Included updates to the math/rand/v2 package and new go/version package[10].

This release adhered to Go’s six-month major release cycle, with Go 1.23 following in August 2024[1][7]. As per Go’s support policy, each major version is supported until two subsequent releases are available, ensuring critical fixes for approximately one year[1][7].

Citations:


Action: Adjust Go version in go.mod for compatibility

  • The go.mod file currently specifies:
    go 1.23
    
  • As verified, the latest stable version of Go as of April 2024 is 1.22 (with 1.22.2 as the current minor release). Using Go 1.23 may lead to compatibility issues in environments where only the stable version (1.22) is available.
  • Please confirm that the Grafana Plugin SDK doesn’t require any features exclusive to a newer version and update the Go version in go.mod to a released version (e.g., go 1.22) if no specific advantages are utilized.


require github.com/grafana/grafana-plugin-sdk-go v0.245.0

require (
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/apache/arrow/go/v15 v15.0.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cheekybits/genny v1.0.0 // indirect
github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/elazarl/goproxy v0.0.0-20230731152917-f99041a5c027 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/getkin/kin-openapi v0.124.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/swag v0.22.8 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/flatbuffers v23.5.26+incompatible // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/grafana/otel-profiling-go v0.5.1 // indirect
github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-plugin v1.6.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/invopop/yaml v0.2.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/magefile/mage v1.15.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattetti/filebuffer v1.0.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/prometheus/client_golang v1.20.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 // indirect
github.com/unknwon/com v1.0.1 // indirect
github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3 // indirect
github.com/urfave/cli v1.22.15 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.53.0 // indirect
go.opentelemetry.io/contrib/propagators/jaeger v1.28.0 // indirect
go.opentelemetry.io/contrib/samplers/jaegerremote v0.22.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading