gitlab-deployment-annotations

command module
v0.0.0-...-a819324 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Annotations for grafana from gitlab deployments

Go

Provides a grafana datasource to get annotations for each deployment in gitlab. Useful to see whether code you deployed had any impact.

Screenshot

Usage

$ go build
$ export GITLAB_URL=https://gitlab.example.com
$ export GITLAB_TOKEN=apitoken 
$ export HTTP_ADDRESS=:8080
$ ./gitlab-deployment-annotations

Log into grafana (http://localhost:3000) and add a SimpleJSON datasource and point it to your datasource, e.g. http://localhost:8080

Add annotations to a dashboard using your datasource and configure the query (which accepts JSON), which allows you to select the project you want to display, for example:

{"project_id": 16, "environment": "Live"}

Development

  1. Build a grafana container image with the simple-json-datasource plugin preinstalled using this Dockerfile:
FROM grafana/grafana
RUN grafana-cli --pluginsDir "$GF_PATHS_PLUGINS" plugins install grafana-simple-json-datasource

$ docker build -t gf .

  1. Run a local instance of grafana

$ docker run --net host gf

  1. Run and configure the datasource (see usage)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址