Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

cloudwatch metric log is not supported currently #271

Open
user10x opened this issue Sep 18, 2020 · 6 comments
Open

cloudwatch metric log is not supported currently #271

user10x opened this issue Sep 18, 2020 · 6 comments

Comments

@user10x
Copy link

user10x commented Sep 18, 2020

Could we have cloudwatch metric log support? From the grafana.cloudwatch.target library it seems like that's not supported. It will be cool to add that support for a log panel

@user10x
Copy link
Author

user10x commented Oct 5, 2020

@trotttrotttrott This is something I figured out learning more about jssonet. Would you like me to add this as an example if I could contribute to this opensource project and kinda giving users the capability to use Clouwdwatch logs. Might be a good first issue for me?
build: jsonnet -J vendor --ext-str env="" -S some-k8s-k8s.jsonnet

Jsnnet file contents:
local grafana = import 'grafonnet/grafana.libsonnet';
local GraphPanel = grafana.graphPanel;

local cwAppErrorLogsQuery = |||
field @timestamp, @logstream, @message
| filter log like /error/
| sort @timestamp desc
| limit 100
| display @timestamp, log, @message
|||;

local cwLogsPanel(title, cwQuery) = LogPanel.new(
title=title,
datasource='CloudWatch',
time_from=null,
time_shift=null,
showLabels=false,
showTime=true,
sortOrder='Descending',
wrapLogMessage=true,
span=12,
height=null
) {
type: 'logs',
options::+ {
"wrapLogMessage": false,
},
targets: [
{
region: 'default',
queryMode: 'Logs',
logGroupNames: [
std.format('/aws/containerinsights/%s/application',std.extVar("env"))
],
expression: cwQuery,
}
],
} ;

local d = dashboard.new(
'K8s-example-dashboard',
schemaVersion=17,
tags=['python','analytics'],
editable=true,
)
.addPanels(
[
cwLogsPanel('last error Logs',cwAppErrorLogsQuery) { gridPos: { h: 5, w: 4, x: 0, y: 0 } }
]
)
;

@user10x
Copy link
Author

user10x commented Oct 5, 2020

Otherwise I can close this issue, since i know how the issue i created could be achieved

@user10x
Copy link
Author

user10x commented Oct 5, 2020

@roidelapluie FYI, just hoping to put this as an example. would be kinda cool if i can share the way i build jssonet dashboard.

@user10x
Copy link
Author

user10x commented Oct 15, 2020

@trotttrotttrott really wish if someone could reply for new contributors

@malcolmholmes
Copy link
Contributor

@NickHalden if what you are describing improves support for a core feature of Grafana, then please make a PR.

Alternatively, consider adding it to the dashboard spec, from which all future Grafonnet versions will be generated.

@SebastianCanonaco
Copy link

@user10x were you able to achieve this? I need to create a panel with the logs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants