-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix #1
- Loading branch information
Showing
22 changed files
with
592 additions
and
107 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Metrics Input | ||
inputs: | ||
http: | ||
enabled: on | ||
configs: | ||
mode: dev | ||
port: 8080 | ||
tls: | ||
status: off | ||
pemPath: cert/server.pem | ||
keyPath: cert/server.key | ||
path: / | ||
api_key: "" | ||
|
||
log: | ||
enabled: on | ||
paths: | ||
- /var/log/*.log | ||
|
||
# Metrics Cache Driver | ||
cache: | ||
type: memory | ||
|
||
# Metrics Output | ||
output: | ||
console: | ||
enabled: on | ||
|
||
prometheus: | ||
enabled: on | ||
endpoint: /metrics | ||
|
||
graphite: | ||
enabled: off | ||
|
||
penguin: | ||
enabled: off | ||
|
||
# Log configs | ||
log: | ||
# Log level, it can be debug, info, warn, error, panic, fatal | ||
level: info | ||
# output can be stdout or abs path to log file /var/logs/beetle.log | ||
output: stdout | ||
# Format can be json | ||
format: json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 2020 Clivern. All rights reserved. | ||
// Use of this source code is governed by the MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
package backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 2020 Clivern. All rights reserved. | ||
// Use of this source code is governed by the MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
package backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 2020 Clivern. All rights reserved. | ||
// Use of this source code is governed by the MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
package backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2020 Clivern. All rights reserved. | ||
// Use of this source code is governed by the MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
package controller | ||
|
||
import ( | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
// Daemon function | ||
func Daemon(messages <-chan string) { | ||
for message := range messages { | ||
log.Info(message) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2020 Clivern. All rights reserved. | ||
// Use of this source code is governed by the MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
package controller | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/gin-gonic/gin" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
// HealthCheck controller | ||
func HealthCheck(c *gin.Context) { | ||
status := "ok" | ||
|
||
log.WithFields(log.Fields{ | ||
"correlation_id": c.Request.Header.Get("X-Correlation-ID"), | ||
"status": status, | ||
}).Info(`Health check`) | ||
|
||
c.JSON(http.StatusOK, gin.H{ | ||
"status": status, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2020 Clivern. All rights reserved. | ||
// Use of this source code is governed by the MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
package controller | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
// Listener controller | ||
func Listener(c *gin.Context, messages chan<- string) { | ||
messages <- "wip1" | ||
|
||
c.Status(http.StatusAccepted) | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2020 Clivern. All rights reserved. | ||
// Use of this source code is governed by the MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
package controller | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/prometheus/client_golang/prometheus/promhttp" | ||
) | ||
|
||
// Metrics controller | ||
func Metrics() http.Handler { | ||
return promhttp.Handler() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2020 Clivern. All rights reserved. | ||
// Use of this source code is governed by the MIT | ||
// license that can be found in the LICENSE file. | ||
|
||
package controller | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
// Watcher function | ||
func Watcher(messages chan<- string) { | ||
for { | ||
messages <- "wip2" | ||
time.Sleep(1 * time.Second) | ||
} | ||
} |
Oops, something went wrong.