Usage Example - sitMCella/toggl-trello-kpi GitHub Wiki

The following page shows a complete example use case and will guide you through the application work flow.

Build the application

Build the application using Golang. Use the proper GOOS and GOARCH parameters from https://golang.org/doc/install/source#environment.

env GOOS=[host_operating_system] GOARCH=[host_cpu] go build -o toggl-trello-kpi cmd/main.go

Grafana Dashboard configuration

The first step requires you to configure the Grafana Dashboard. Read the Grafana-Configuration page.

Run the application with the following command line parameter in order to create a Grafana Dashboard using the configuration specified in the file configuration/settings.yml.

./toggl-trello-kpi -choice=8

Download the Trello cards information as CSV file

Run the following command to download the Trello cards information as a CSV file. The name of the CSV file is "trello_entries.csv":

./toggl-trello-kpi -choice=2

Move the CSV file in the directory "data":

mkdir data
mv trello_entries.csv data/

The following is an example of the file "trello_entries.csv":

Id,Name,Closed,Labels,Project,Customer,Team,Type
61474e97857267779c89fd4a,KPI-2 Implement the initial design of the application.,false,"Acme Corp,DevOps,Acme App,Implementation",Acme App,Acme Corp,DevOps,Implementation
6147505e1f9bd20d809547a8,KPI-3 Investigate the tools and frameworks.,false,"Acme Corp,DevOps,Acme App,Study",Acme App,Acme Corp,DevOps,Study
61474d4b26e8682cf6884bf4,KPI-1 Work on the initial design of the applicaiton.,false,"DevOps,Acme Corp,Design,Acme App",Acme App,Acme Corp,DevOps,Design
61476l5jbouu44td35j9ph7i,KPI-4 Configure the initial Kubernetes infrastructure.,false,"Acme Corp,DevOps,Acme App,Implementation",Acme App,Acme Corp,DevOps,Implementation
6147yy3339pef66dynwxd9bt,KPI-5 Meeting on the design of the first feature.,false,"DevOps,Acme Corp,Design,Acme App",Acme App,Acme Corp,DevOps,Design
6147r399pdd5559hwsk6dssq,KPI-6 Investigate and compare the libraries to use for the first feature.,false,"Acme Corp,DevOps,Acme App,Study",Acme App,Acme Corp,DevOps,Study
6147uhr09w7123hwx0fu8sjy,KPI-7 Implement the first feature.,false,"Acme Corp,DevOps,Acme App,Implementation",Acme App,Acme Corp,DevOps,Implementation
6147wecm3cui12ui0l37n6p9,KPI-8 Fix the application accessibility issue.,false,"Umbrella Corporation,DevOps,Umbrella App,Incident",Umbrella App,Umbrella Corporation,DevOps,Incident
6147c3431eanv10bgyh6kuw1,KPI-9 Upgrade the Kubernetes environment.,false,"Umbrella Corporation,DevOps,Umbrella App,Implementation",Umbrella App,Umbrella Corporation,DevOps,Implementation
61478xt78v4d26rgy83c3ntc,KPI-10 Meeting on the application design.,false,"Cyberdyne Systems,DevOps,Cyberdyne App,Design",Cyberdyne App,Cyberdyne Systems,DevOps,Design
6147j12gz5o96mrodde0w304,KPI-11 Meeting on the design of the next feature.,false,"DevOps,Acme Corp,Design,Acme App",Acme App,Acme Corp,DevOps,Design
6147p5gi4ntnfbapu7xlp9xl,KPI-12 Configure the CI/CD pipeline.,false,"DevOps,Acme Corp,Implementation,Acme App",Acme App,Acme Corp,DevOps,Implementation
6147d2361cy448ifyfr1ob7a,KPI-13 Verify library inconsistency in the QA environment.,false,"Umbrella Corporation,DevOps,Umbrella App,Incident",Umbrella App,Umbrella Corporation,DevOps,Incident
6147xkoi8wp0146wix9xvljd,KPI-14 Implement the next feature.,false,"Acme Corp,DevOps,Acme App,Implementation",Acme App,Acme Corp,DevOps,Implementation
61472f8vs9g48o9i41p78tez,KPI-15 Investigate the tools and frameworks.,false,"Cyberdyne Systems,DevOps,Cyberdyne App,Study",Cyberdyne App,Cyberdyne Systems,DevOps,Study
6147bir88ugqa311nqh48nrx,KPI-16 Fix the database data inconsistency.,false,"Umbrella Corporation,DevOps,Umbrella App,Incident",Umbrella App,Umbrella Corporation,DevOps,Incident

Download the Toggl entries information as CSV file

Run the following command to download the Toggl entries information as a CSV file. The name of the CSV file is "toggl_time_entries.csv":

./toggl-trello-kpi -choice=1 2021 02

Note that the application command requires you to specify the year and the number of the month as command line parameters.

Move the CSV file in the directory "data":

mv toggl_time_entries.csv data/toggl_time_entries_february.csv

The following is an example of the file "data/toggl_time_entries_february.csv":

Id,Description,Start,Stop,Duration,Billable,Workspace_id,Project_id,Project_name,Tags,Trello_card_id
5476794780,Work on an initial design of the application.,2021-02-16T09:00:00Z,2021-02-16T12:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",
5321676357,Investigate the tools and framweork to use for the initial implementation.,2021-02-16T13:00:00Z,2021-02-16T18:00:00Z,18000,false,946245,945251863,Acme App,"DevOps engineer",
5942555324,Investigate the tools and framweork to use for the initial implementation.,2021-02-17T09:00:00Z,2021-02-17T12:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",
4524674311,Implement the application based on the initial design.,2021-02-17T13:00:00Z,2021-02-17T17:00:00Z,14400,false,946245,945251863,Acme App,"DevOps engineer",
4253985632,Implement the application based on the initial design.,2021-02-18T09:00:00Z,2021-02-18T12:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",
5029885919,Work on the initial configuration of the Kubernetes environment.,2021-02-18T13:00:00Z,2021-02-18T18:00:00Z,18000,false,946245,945251863,Acme App,"DevOps engineer",
5472768404,Meeting on the design of the first feature.,2021-02-19T09:00:00Z,2021-02-19T11:00:00Z,7200,false,946245,945251863,Acme App,"DevOps engineer",
5396795871,Work on the initial configuration of the Kubernetes environment.,2021-02-19T11:00:00Z,2021-02-19T12:00:00Z,3600,false,946245,945251863,Acme App,"DevOps engineer",
3425256994,Investigate the libraries to use for the first feature.,2021-02-22T09:00:00Z,2021-02-22T11:00:00Z,7200,false,946245,945251863,Acme App,"DevOps engineer",
4712135746,Compare the libraries to use for the first feature.,2021-02-22T11:00:00Z,2021-02-22T12:00:00Z,3600,false,946245,945251863,Acme App,"DevOps engineer",
1027830889,Compare the libraries to use for the first feature.,2021-02-22T13:00:00Z,2021-02-22T16:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",
9311361845,Work on the initial configuration of the Kubernetes environment.,2021-02-22T16:00:00Z,2021-02-22T18:00:00Z,7200,false,946245,945251863,Acme App,"DevOps engineer",
6919651667,Meeting on the libraries to use for the first feature.,2021-02-23T09:00:00Z,2021-02-23T11:00:00Z,7200,false,946245,945251863,Acme App,"DevOps engineer",
3771914091,Work on the application accessibility issue.,2021-02-23T11:00:00Z,2021-02-23T13:00:00Z,7200,false,946245,945251863,Umbrella App,"DevOps engineer",
6672367132,Implement the first feature.,2021-02-23T14:00:00Z,2021-02-23T18:00:00Z,14400,false,946245,945251863,Acme App,"DevOps engineer",
6112679676,Upgrade the Kubernetes environment.,2021-02-24T09:00:00Z,2021-02-24T13:00:00Z,10800,false,946245,945251863,Umbrella App,"DevOps engineer",
6894504973,Upgrade the Kubernetes environment.,2021-02-24T13:00:00Z,2021-02-24T15:00:00Z,7200,false,946245,945251863,Umbrella App,"DevOps engineer",
1579597143,Implement the first feature.,2021-02-24T15:00:00Z,2021-02-23T18:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",

Assign the Trello Card IDs to the Toggl entries

Open the file "data/toggl_time_entries_february.csv" and manually add the value of the Trello Card ID from the file "data/trello_entries.csv" as the last parameter for each Toggl entry.

The file "data/toggl_time_entries_february.csv" should be updated as following, based on the current example:

Id,Description,Start,Stop,Duration,Billable,Workspace_id,Project_id,Project_name,Tags,Trello_card_id
5476794780,Work on an initial design of the application.,2021-02-16T09:00:00Z,2021-02-16T12:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",61474d4b26e8682cf6884bf4
5321676357,Investigate the tools and framweork to use for the initial implementation.,2021-02-16T13:00:00Z,2021-02-16T18:00:00Z,18000,false,946245,945251863,Acme App,"DevOps engineer",6147505e1f9bd20d809547a8
5942555324,Investigate the tools and framweork to use for the initial implementation.,2021-02-17T09:00:00Z,2021-02-17T12:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",6147505e1f9bd20d809547a8
4524674311,Implement the application based on the initial design.,2021-02-17T13:00:00Z,2021-02-17T17:00:00Z,14400,false,946245,945251863,Acme App,"DevOps engineer",61474e97857267779c89fd4a
4253985632,Implement the application based on the initial design.,2021-02-18T09:00:00Z,2021-02-18T12:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",61474e97857267779c89fd4a
5029885919,Work on the initial configuration of the Kubernetes environment.,2021-02-18T13:00:00Z,2021-02-18T18:00:00Z,18000,false,946245,945251863,Acme App,"DevOps engineer",61476l5jbouu44td35j9ph7i
5472768404,Meeting on the design of the first feature.,2021-02-19T09:00:00Z,2021-02-19T11:00:00Z,7200,false,946245,945251863,Acme App,"DevOps engineer",6147yy3339pef66dynwxd9bt
5396795871,Work on the initial configuration of the Kubernetes environment.,2021-02-19T11:00:00Z,2021-02-19T12:00:00Z,3600,false,946245,945251863,Acme App,"DevOps engineer",61476l5jbouu44td35j9ph7i
3425256994,Investigate the libraries to use for the first feature.,2021-02-22T09:00:00Z,2021-02-22T11:00:00Z,7200,false,946245,945251863,Acme App,"DevOps engineer",6147r399pdd5559hwsk6dssq
4712135746,Compare the libraries to use for the first feature.,2021-02-22T11:00:00Z,2021-02-22T12:00:00Z,3600,false,946245,945251863,Acme App,"DevOps engineer",6147r399pdd5559hwsk6dssq
1027830889,Compare the libraries to use for the first feature.,2021-02-22T13:00:00Z,2021-02-22T16:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",6147r399pdd5559hwsk6dssq
9311361845,Work on the initial configuration of the Kubernetes environment.,2021-02-22T16:00:00Z,2021-02-22T18:00:00Z,7200,false,946245,945251863,Acme App,"DevOps engineer",61476l5jbouu44td35j9ph7i
6919651667,Meeting on the libraries to use for the first feature.,2021-02-23T09:00:00Z,2021-02-23T11:00:00Z,7200,false,946245,945251863,Acme App,"DevOps engineer",6147r399pdd5559hwsk6dssq
3771914091,Work on the application accessibility issue.,2021-02-23T11:00:00Z,2021-02-23T13:00:00Z,7200,false,946245,945251863,Umbrella App,"DevOps engineer",6147wecm3cui12ui0l37n6p9
6672367132,Implement the first feature.,2021-02-23T14:00:00Z,2021-02-23T18:00:00Z,14400,false,946245,945251863,Acme App,"DevOps engineer",6147uhr09w7123hwx0fu8sjy
6112679676,Upgrade the Kubernetes environment.,2021-02-24T09:00:00Z,2021-02-24T13:00:00Z,10800,false,946245,945251863,Umbrella App,"DevOps engineer",6147c3431eanv10bgyh6kuw1
6894504973,Upgrade the Kubernetes environment.,2021-02-24T13:00:00Z,2021-02-24T15:00:00Z,7200,false,946245,945251863,Umbrella App,"DevOps engineer",6147c3431eanv10bgyh6kuw1
1579597143,Implement the first feature.,2021-02-24T15:00:00Z,2021-02-23T18:00:00Z,10800,false,946245,945251863,Acme App,"DevOps engineer",6147uhr09w7123hwx0fu8sjy

Currently the application does not offer any tools that might help on the assignment of the Trello Card ID for the Toggl entries.

Create a Bash script for injecting the data in the database

Create a Bash script with file name "data/insert_data.sh" with the following content:

cd ..
./toggl-trello-kpi -choice=3 data/trello_entries.csv trello_card
./toggl-trello-kpi -choice=3 data/toggl_time_entries_february.csv toggl_time

This Bash script will be used for injecting the data in the database.

Run the application

Execute the following command for running the database and the Grafana dashboard:

docker-compose -f docker-compose.yml up

Wait for the database and Grafana to be up and running.

Inject the data in the database

Execute the following command:

cd data
./insert_data.sh

Access Grafana

Open the following URL in the Browser:

http://localhost:3000

The Grafana login page should open. Use the following username and passowrd:

username: admin
password: admin

Open the Dashboard "Toggl and Trello" in Grafana.

The following is the Grafana dashboard. The screenshot shows the Toggl data from two consecutive months.

Grafana Dashboard