Skip to content
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

Adding Postgres dashboards in metricbeat #7734

Closed
wants to merge 16 commits into from

Conversation

dov0211
Copy link

@dov0211 dov0211 commented Jul 25, 2018

Postgres dashboard added in metricbeat

@dov0211
Copy link
Author

dov0211 commented Jul 25, 2018

image

@ruflin
Copy link
Member

ruflin commented Jul 26, 2018

Nice, thanks for the contribution. Any chance you could add this screenshot to the docs? See apache here for an example: https://github.com/elastic/beats/blob/master/metricbeat/module/apache/_meta/docs.asciidoc

The image file will belong here: https://github.com/elastic/beats/tree/master/metricbeat/docs/images

To check locally how the docs will look, you can run make docs-preview. It will take quite some time to build all the docs.

You also need to run make update in the metricbeat directory. The reason is that it will change the module overview pages to show that Postgres also has a dashboard 🎉

@ruflin ruflin requested a review from jsoriano August 6, 2018 05:23
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Thanks @dov0211 for working on this! 🙂

I personally don't like gauges so much for service dashboards in which you can change the interval of time selected, you only see one value for all the period, and if the interval changes it is not always clear what the value represents.
I prefer to see the historical data with line charts so you can see more easily the evolution of values along the period selected. It can be for example interesting to see the evolution of deadlocks, or if they have periodic peaks.

@ruflin ruflin added the Team:Integrations Label for the Integrations team label Nov 21, 2018
@ruflin
Copy link
Member

ruflin commented Nov 21, 2018

@dov0211 Any updates on this one?

@dov0211
Copy link
Author

dov0211 commented Nov 25, 2018

@ruflin will look at this one this week

@dov0211
Copy link
Author

dov0211 commented Nov 26, 2018

image
@ruflin @jsoriano
Let me know if this one is better

@dov0211
Copy link
Author

dov0211 commented Dec 5, 2018

image

@ruflin ruflin added the needs_backport PR is waiting to be backported to other branches. label Jan 18, 2019
@ruflin
Copy link
Member

ruflin commented Jan 18, 2019

@jsoriano Could you check the above to see if this can be merged. Would be great to have a postgres dashboard.

@tbragin
Copy link
Contributor

tbragin commented Jan 23, 2019

@dov0211 Thanks for working on this! I wonder if we can make titles on the dashboards more consistent from the spacing and capitalization perspective. Right now I see mix of first letter capitalized vs not capitalized, spaces around "-" and no spaces around "-"...

@ruflin
Copy link
Member

ruflin commented Apr 3, 2019

@dov0211 Can we reactive this PR? Would be still great to get this dashboard in.

@dov0211
Copy link
Author

dov0211 commented Apr 3, 2019

yes, I should have the bandwidth working on that next week

}, nil
}

func (m *MetricSet) Fetch() ([]common.MapStr, error) {
func (m *MetricSet) Fetch(reporter mb.ReporterV2) {

Choose a reason for hiding this comment

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

exported method MetricSet.Fetch should have comment or be unexported

}

// KeyPattern contains the information required to query keys
type KeyPattern struct {

Choose a reason for hiding this comment

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

type name will be used as key.KeyPattern by other packages, and that stutters; consider calling this Pattern

}

// KeyPattern contains the information required to query keys
type KeyPattern struct {

Choose a reason for hiding this comment

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

type name will be used as key.KeyPattern by other packages, and that stutters; consider calling this Pattern

// Save PID without command-line to avoid continued errors for this process
logp.Err("Unable to get command-line for pid %d: %v", pid, err)
// GetProcess returns the process metadata.
func (proc *ProcessesWatcher) GetProcess(pid int) *process {

Choose a reason for hiding this comment

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

exported method GetProcess returns unexported type *procs.process, which can be annoying to use

}

// LoginRecord represents a login record.
type LoginRecord struct {

Choose a reason for hiding this comment

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

type name will be used as login.LoginRecord by other packages, and that stutters; consider calling this Record

}

// LoginRecord represents a login record.
type LoginRecord struct {

Choose a reason for hiding this comment

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

type name will be used as login.LoginRecord by other packages, and that stutters; consider calling this Record

RPMTAG_URL = 1020
RPMTAG_ARCH = 1022
RPMTAG_SIZE = 1009
RPMTAG_INSTALLTIME = 1008

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

RPMTAG_LICENSE = 1014
RPMTAG_URL = 1020
RPMTAG_ARCH = 1022
RPMTAG_SIZE = 1009

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

RPMTAG_SUMMARY = 1004
RPMTAG_LICENSE = 1014
RPMTAG_URL = 1020
RPMTAG_ARCH = 1022

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

RPMTAG_RELEASE = 1002
RPMTAG_SUMMARY = 1004
RPMTAG_LICENSE = 1014
RPMTAG_URL = 1020

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

RPMTAG_VERSION = 1001
RPMTAG_RELEASE = 1002
RPMTAG_SUMMARY = 1004
RPMTAG_LICENSE = 1014

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

DEAD_PROCESS UtType = 8
ACCOUNTING UtType = 9

UT_LINESIZE = 32

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

INIT_PROCESS UtType = 5
LOGIN_PROCESS UtType = 6
USER_PROCESS UtType = 7
DEAD_PROCESS UtType = 8

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

OLD_TIME UtType = 4
INIT_PROCESS UtType = 5
LOGIN_PROCESS UtType = 6
USER_PROCESS UtType = 7

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

NEW_TIME UtType = 3
OLD_TIME UtType = 4
INIT_PROCESS UtType = 5
LOGIN_PROCESS UtType = 6

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

BOOT_TIME UtType = 2
NEW_TIME UtType = 3
OLD_TIME UtType = 4
INIT_PROCESS UtType = 5

Choose a reason for hiding this comment

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

don't use ALL_CAPS in Go names; use CamelCase

protocol.Registry.Register(ProtocolName, New)
}

func New(config config.Config) protocol.Protocol {

Choose a reason for hiding this comment

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

exported function New should have comment or be unexported

)

const (
ProtocolName = "v6"

Choose a reason for hiding this comment

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

exported const ProtocolName should have comment (or a comment on this block) or be unexported

return header, nil
}

func ReadV5Header(buf *bytes.Buffer, source net.Addr) (count int, ts time.Time, metadata record.Map, err error) {

Choose a reason for hiding this comment

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

exported function ReadV5Header should have comment or be unexported

SamplingInterval uint16
}

func ReadPacketHeader(buf *bytes.Buffer) (header PacketHeader, err error) {

Choose a reason for hiding this comment

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

exported function ReadPacketHeader should have comment or be unexported

return v1.NewProtocol(ProtocolID, &templateV5, ReadV5Header, log.New(config.LogOutput(), LogPrefix, 0))
}

type PacketHeader struct {

Choose a reason for hiding this comment

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

exported type PacketHeader should have comment or be unexported

return p.version
}

func (NetflowProtocol) Start() error {

Choose a reason for hiding this comment

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

exported method NetflowProtocol.Start should have comment or be unexported

}
}

func (p *NetflowProtocol) Version() uint16 {

Choose a reason for hiding this comment

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

exported method NetflowProtocol.Version should have comment or be unexported

return NewProtocol(ProtocolID, &templateV1, readV1Header, log.New(config.LogOutput(), LogPrefix, 0))
}

func NewProtocol(version uint16, template *template.Template, readHeader ReadHeaderFn, logger *log.Logger) protocol.Protocol {

Choose a reason for hiding this comment

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

exported function NewProtocol should have comment or be unexported

protocol.Registry.Register(ProtocolName, New)
}

func New(config config.Config) protocol.Protocol {

Choose a reason for hiding this comment

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

exported function New should have comment or be unexported


type ReadHeaderFn func(*bytes.Buffer, net.Addr) (int, time.Time, record.Map, error)

type NetflowProtocol struct {

Choose a reason for hiding this comment

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

exported type NetflowProtocol should have comment or be unexported


// +build integration

package transaction_log

Choose a reason for hiding this comment

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

don't use an underscore in package name

// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

package transaction_log

Choose a reason for hiding this comment

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

don't use an underscore in package name

// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

package transaction_log

Choose a reason for hiding this comment

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

don't use an underscore in package name

return nil
}

func (p *NetflowV9Protocol) OnPacket(buf *bytes.Buffer, source net.Addr) (flows []record.Record, err error) {

Choose a reason for hiding this comment

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

exported method NetflowV9Protocol.OnPacket should have comment or be unexported

return nil
}

func (p *NetflowV9Protocol) Stop() error {

Choose a reason for hiding this comment

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

exported method NetflowV9Protocol.Stop should have comment or be unexported

return total - removedSession, removedSession, aliveTemplates, removedTemplates
}

func (m *SessionMap) CleanupLoop(interval time.Duration, done <-chan struct{}, logger *log.Logger) {

Choose a reason for hiding this comment

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

exported method SessionMap.CleanupLoop should have comment or be unexported

}
}

func (m *SessionMap) GetOrCreate(key SessionKey) *SessionState {

Choose a reason for hiding this comment

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

exported method SessionMap.GetOrCreate should have comment or be unexported

Sessions map[SessionKey]*SessionState
}

func NewSessionMap() SessionMap {

Choose a reason for hiding this comment

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

exported function NewSessionMap should have comment or be unexported

return
}

type SessionMap struct {

Choose a reason for hiding this comment

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

exported type SessionMap should have comment or be unexported

return total - removed, removed
}

func (s *SessionState) CheckReset(seqNum uint32) (reset bool) {

Choose a reason for hiding this comment

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

exported method SessionState.CheckReset should have comment or be unexported

return template
}

func (s *SessionState) ExpireTemplates() (alive int, removed int) {

Choose a reason for hiding this comment

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

exported method SessionState.ExpireTemplates should have comment or be unexported

s.Templates[key] = &TemplateWrapper{Template: t}
}

func (s *SessionState) GetTemplate(sourceId uint32, id uint16) (template *template.Template) {

Choose a reason for hiding this comment

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

exported method SessionState.GetTemplate should have comment or be unexported
method parameter sourceId should be sourceID

}
}

func (s *SessionState) AddTemplate(sourceId uint32, t *template.Template) {

Choose a reason for hiding this comment

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

exported method SessionState.AddTemplate should have comment or be unexported
method parameter sourceId should be sourceID

Delete atomic.Bool
}

func NewSession() *SessionState {

Choose a reason for hiding this comment

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

exported function NewSession should have comment or be unexported

Delete atomic.Bool
}

type SessionState struct {

Choose a reason for hiding this comment

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

exported type SessionState should have comment or be unexported

SetID, Length uint16
}

func (h SetHeader) BodyLength() int {

Choose a reason for hiding this comment

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

exported method SetHeader.BodyLength should have comment or be unexported

SequenceNo, SourceID uint32
}

type SetHeader struct {

Choose a reason for hiding this comment

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

exported type SetHeader should have comment or be unexported

return templates, nil
}

type PacketHeader struct {

Choose a reason for hiding this comment

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

exported type PacketHeader should have comment or be unexported

return templates, nil
}

func (d DecoderV9) ReadOptionsTemplateFlowSet(buf *bytes.Buffer) (templates []*template.Template, err error) {

Choose a reason for hiding this comment

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

exported method DecoderV9.ReadOptionsTemplateFlowSet should have comment or be unexported

return record, nil
}

func ReadTemplateFlowSet(d Decoder, buf *bytes.Buffer) (templates []*template.Template, err error) {

Choose a reason for hiding this comment

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

exported function ReadTemplateFlowSet should have comment or be unexported

}
if length == template.VariableLength {
record.VariableLength = true
record.Length += 1

Choose a reason for hiding this comment

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

should replace record.Length += 1 with record.Length++

return field, length, nil
}

func ReadFields(d Decoder, buf *bytes.Buffer, count int) (record template.Template, err error) {

Choose a reason for hiding this comment

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

exported function ReadFields should have comment or be unexported

}
}

func (d DecoderV9) ReadFieldDefinition(buf *bytes.Buffer) (field fields.Key, length uint16, err error) {

Choose a reason for hiding this comment

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

exported method DecoderV9.ReadFieldDefinition should have comment or be unexported

}, nil
}

func (d DecoderV9) ReadTemplateSet(setID uint16, buf *bytes.Buffer) ([]*template.Template, error) {

Choose a reason for hiding this comment

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

exported method DecoderV9.ReadTemplateSet should have comment or be unexported

return header, buf, int(header.Count), nil
}

func (_ DecoderV9) ReadSetHeader(buf *bytes.Buffer) (SetHeader, error) {

Choose a reason for hiding this comment

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

exported method DecoderV9.ReadSetHeader should have comment or be unexported
receiver name should not be an underscore, omit the name if it is unused

Reserved uint32
}

func ReadPacketHeader(buf *bytes.Buffer) (header PacketHeader, err error) {

Choose a reason for hiding this comment

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

exported function ReadPacketHeader should have comment or be unexported

return nil
}

type PacketHeader struct {

Choose a reason for hiding this comment

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

exported type PacketHeader should have comment or be unexported

return nil
}

func (NetflowV8Protocol) Stop() error {

Choose a reason for hiding this comment

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

exported method NetflowV8Protocol.Stop should have comment or be unexported

return flows, nil
}

func (NetflowV8Protocol) Start() error {

Choose a reason for hiding this comment

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

exported method NetflowV8Protocol.Start should have comment or be unexported

return ProtocolID
}

func (p *NetflowV8Protocol) OnPacket(buf *bytes.Buffer, source net.Addr) (flows []record.Record, err error) {

Choose a reason for hiding this comment

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

exported method NetflowV8Protocol.OnPacket should have comment or be unexported

}
}

func (NetflowV8Protocol) Version() uint16 {

Choose a reason for hiding this comment

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

exported method NetflowV8Protocol.Version should have comment or be unexported

protocol.Registry.Register(ProtocolName, New)
}

func New(config config.Config) protocol.Protocol {

Choose a reason for hiding this comment

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

exported function New should have comment or be unexported

},
}

type NetflowV8Protocol struct {

Choose a reason for hiding this comment

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

exported type NetflowV8Protocol should have comment or be unexported

type AggType uint8

const (
RouterAS AggType = iota + 1

Choose a reason for hiding this comment

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

exported const RouterAS should have comment (or a comment on this block) or be unexported

)

const (
ProtocolName = "v8"

Choose a reason for hiding this comment

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

exported const ProtocolName should have comment (or a comment on this block) or be unexported

)

const (
ProtocolName = "v1"

Choose a reason for hiding this comment

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

exported const ProtocolName should have comment (or a comment on this block) or be unexported

return true
}

func AssertRecordsEqual(t testing.TB, expected record.Record, actual record.Record) bool {

Choose a reason for hiding this comment

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

exported function AssertRecordsEqual should have comment or be unexported

return bytes.NewBuffer(r)
}

func AssertMapEqual(t testing.TB, expected record.Map, actual record.Map) bool {

Choose a reason for hiding this comment

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

exported function AssertMapEqual should have comment or be unexported

}
}

func MakePacket(data []uint16) *bytes.Buffer {

Choose a reason for hiding this comment

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

exported function MakePacket should have comment or be unexported

return len(buf), nil
}

func MakeAddress(t testing.TB, ipPortPair string) net.Addr {

Choose a reason for hiding this comment

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

exported function MakeAddress should have comment or be unexported

"github.com/elastic/beats/x-pack/filebeat/input/netflow/decoder/record"
)

type TestLogWriter struct {

Choose a reason for hiding this comment

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

exported type TestLogWriter should have comment or be unexported
type name will be used as test.TestLogWriter by other packages, and that stutters; consider calling this LogWriter

return
}

func AssertTemplateEquals(t testing.TB, expected *Template, actual *Template) bool {

Choose a reason for hiding this comment

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

exported function AssertTemplateEquals should have comment or be unexported

assert.Equal(t, 0, template.ScopeFields)
}

func AssertFieldsEquals(t testing.TB, expected []FieldTemplate, actual []FieldTemplate) (succeeded bool) {

Choose a reason for hiding this comment

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

exported function AssertFieldsEquals should have comment or be unexported

if !isVariable {
sum += int(field.Length)
} else {
sum += 1

Choose a reason for hiding this comment

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

should replace sum += 1 with sum++

}
}

func ValidateTemplate(t testing.TB, template *Template) bool {

Choose a reason for hiding this comment

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

exported function ValidateTemplate should have comment or be unexported


// ProtocolRegistry allows protocols to be registered and be discovered by
// their protocol name.
type ProtocolRegistry map[string]ProtocolFactory

Choose a reason for hiding this comment

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

type name will be used as protocol.ProtocolRegistry by other packages, and that stutters; consider calling this Registry


// ProtocolFactory is the type for a factory method that creates instances
// of a protocol.
type ProtocolFactory func(config config.Config) Protocol

Choose a reason for hiding this comment

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

type name will be used as protocol.ProtocolFactory by other packages, and that stutters; consider calling this Factory

return proto
}

func (*IPFixProtocol) Version() uint16 {

Choose a reason for hiding this comment

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

exported method IPFixProtocol.Version should have comment or be unexported

protocol.Registry.Register(ProtocolName, New)
}

func New(config config.Config) protocol.Protocol {

Choose a reason for hiding this comment

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

exported function New should have comment or be unexported

LogPrefix = "[ipfix] "
)

type IPFixProtocol struct {

Choose a reason for hiding this comment

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

exported type IPFixProtocol should have comment or be unexported
type name will be used as ipfix.IPFixProtocol by other packages, and that stutters; consider calling this Protocol

)

const (
ProtocolName = "ipfix"

Choose a reason for hiding this comment

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

exported const ProtocolName should have comment (or a comment on this block) or be unexported

return field, length, nil
}

func (d DecoderIPFIX) ReadOptionsTemplateFlowSet(buf *bytes.Buffer) (templates []*template.Template, err error) {

Choose a reason for hiding this comment

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

exported method DecoderIPFIX.ReadOptionsTemplateFlowSet should have comment or be unexported

}
}

func (d DecoderIPFIX) ReadFieldDefinition(buf *bytes.Buffer) (field fields.Key, length uint16, err error) {

Choose a reason for hiding this comment

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

exported method DecoderIPFIX.ReadFieldDefinition should have comment or be unexported

return header, bytes.NewBuffer(payload), math.MaxUint16, nil
}

func (d DecoderIPFIX) ReadTemplateSet(setID uint16, buf *bytes.Buffer) ([]*template.Template, error) {

Choose a reason for hiding this comment

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

exported method DecoderIPFIX.ReadTemplateSet should have comment or be unexported


var _ v9.Decoder = (*DecoderIPFIX)(nil)

func (_ DecoderIPFIX) ReadPacketHeader(buf *bytes.Buffer) (header v9.PacketHeader, newBuf *bytes.Buffer, countRecords int, err error) {

Choose a reason for hiding this comment

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

exported method DecoderIPFIX.ReadPacketHeader should have comment or be unexported
receiver name should not be an underscore, omit the name if it is unused


package fields

var AssortedFields = FieldDict{

Choose a reason for hiding this comment

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

exported var AssortedFields should have comment or be unexported

return math.MaxUint16
}

func (u UnsupportedDecoder) Decode(data []byte) (interface{}, error) {

Choose a reason for hiding this comment

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

exported method UnsupportedDecoder.Decode should have comment or be unexported

return 0
}

func (u UnsupportedDecoder) MaxLength() uint16 {

Choose a reason for hiding this comment

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

exported method UnsupportedDecoder.MaxLength should have comment or be unexported


type UnsupportedDecoder struct{}

func (u UnsupportedDecoder) MinLength() uint16 {

Choose a reason for hiding this comment

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

exported method UnsupportedDecoder.MinLength should have comment or be unexported


var _ Decoder = (*IPAddressDecoder)(nil)

type UnsupportedDecoder struct{}

Choose a reason for hiding this comment

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

exported type UnsupportedDecoder should have comment or be unexported

return uint16(u)
}

func (u IPAddressDecoder) Decode(data []byte) (interface{}, error) {

Choose a reason for hiding this comment

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

exported method IPAddressDecoder.Decode should have comment or be unexported

return uint16(u)
}

func (u IPAddressDecoder) MaxLength() uint16 {

Choose a reason for hiding this comment

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

exported method IPAddressDecoder.MaxLength should have comment or be unexported


type IPAddressDecoder uint8

func (u IPAddressDecoder) MinLength() uint16 {

Choose a reason for hiding this comment

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

exported method IPAddressDecoder.MinLength should have comment or be unexported


var _ Decoder = (*NTPTimestampDecoder)(nil)

type IPAddressDecoder uint8

Choose a reason for hiding this comment

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

exported type IPAddressDecoder should have comment or be unexported

return 8
}

func (u NTPTimestampDecoder) Decode(data []byte) (interface{}, error) {

Choose a reason for hiding this comment

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

exported method NTPTimestampDecoder.Decode should have comment or be unexported


var _ Decoder = (*DateTimeSecondsDecoder)(nil)

type DateTimeMillisecondsDecoder struct{}

Choose a reason for hiding this comment

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

exported type DateTimeMillisecondsDecoder should have comment or be unexported

return 4
}

func (u DateTimeSecondsDecoder) Decode(data []byte) (interface{}, error) {

Choose a reason for hiding this comment

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

exported method DateTimeSecondsDecoder.Decode should have comment or be unexported

return 4
}

func (u DateTimeSecondsDecoder) MaxLength() uint16 {

Choose a reason for hiding this comment

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

exported method DateTimeSecondsDecoder.MaxLength should have comment or be unexported


type DateTimeSecondsDecoder struct{}

func (u DateTimeSecondsDecoder) MinLength() uint16 {

Choose a reason for hiding this comment

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

exported method DateTimeSecondsDecoder.MinLength should have comment or be unexported


var _ Decoder = (*StringDecoder)(nil)

type DateTimeSecondsDecoder struct{}

Choose a reason for hiding this comment

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

exported type DateTimeSecondsDecoder should have comment or be unexported

@ruflin
Copy link
Member

ruflin commented Apr 17, 2019

@jsoriano Could you take a look at this again. @dov0211 I assume it's ready for review now.

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Is the screenshot updated?
I still wonder what do the active applications visualization mean, are they number of connections of these applications during the selected period? I'd prefer to have a view over time.
Regarding the Top queries, shouldn't they be aggregated so the count is the sum of same queries? Though this can be less meaningful with real world queries that include unique parameters.

"filter": [],
"index": "metricbeat-*",
"query": {
"language": "lucene",
Copy link
Member

Choose a reason for hiding this comment

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

Query language should be kuery now, see #11268

"mode": "quick",
"to": "now"
},
"time_zone": "Asia/Jerusalem",
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why this is here, timezones shouldn't be stored in the dashboard.

},
"type": "phrase",
"value": ""
},
Copy link
Member

Choose a reason for hiding this comment

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

I see in the screenshot that there is a filter for empty queries, when does it happen? Should we use this filter only in the visualization of recent queries?

}
],
"timeRestore": false,
"title": "[Metricbeat Postgresql] overview",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"title": "[Metricbeat Postgresql] overview",
"title": "[Metricbeat Postgresql] Overview",

}
}
},
"title": "[Postgresql] Number of deadlock over time",
Copy link
Member

Choose a reason for hiding this comment

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

Visualization titles of this dashboard should have [Metricbeat Postgresql] as suffix

Suggested change
"title": "[Postgresql] Number of deadlock over time",
"title": "Number of deadlock over time [Metricbeat Postgresql]",

@dov0211
Copy link
Author

dov0211 commented Apr 18, 2019

image

@cwurm cwurm removed the request for review from a team April 18, 2019 13:01
@jsoriano
Copy link
Member

It LGTM, but tests in failures are related.

We test dashboards setup with the versions of the stack in metricbeat dockerfiles, and there we are still using 6.6.0. Dashboard in this PR were generated with 7.0 and they fail to be imported in 6.6 with:

2019-04-18T13:55:33.549Z	ERROR	instance/beat.go:856	Exiting: Failed to import dashboard: Failed to load directory /go/src/github.com/elastic/beats/metricbeat/build/system-tests/run/test_base.Test.test_dashboards/kibana/7/dashboard:
  error loading /go/src/github.com/elastic/beats/metricbeat/build/system-tests/run/test_base.Test.test_dashboards/kibana/7/dashboard/Metricbeat-postgresql-overview.json: returned 400 to import file: <nil>. Response: {"statusCode":400,"error":"Bad Request","message":"Document \"63b041e4-61ce-11e9-91d0-efd192a57cbc\" has property \"dashboard\" which belongs to a more recent version of Kibana (7.0.0)."}
Exiting: Failed to import dashboard: Failed to load directory /go/src/github.com/elastic/beats/metricbeat/build/system-tests/run/test_base.Test.test_dashboards/kibana/7/dashboard:
  error loading /go/src/github.com/elastic/beats/metricbeat/build/system-tests/run/test_base.Test.test_dashboards/kibana/7/dashboard/Metricbeat-postgresql-overview.json: returned 400 to import file: <nil>. Response: {"statusCode":400,"error":"Bad Request","message":"Document \"63b041e4-61ce-11e9-91d0-efd192a57cbc\" has property \"dashboard\" which belongs to a more recent version of Kibana (7.0.0)."}

I have opened #11883 to try to update the dockerfiles to 7.0.

Not sure if there would be a way to convert it to the 6.X format in the meantime.

@jsoriano
Copy link
Member

@dov0211 issue with 7.0 should be fixed now, could you try to update this branch with master?

@cachedout cachedout removed the request for review from a team June 26, 2019 10:21
@jsoriano
Copy link
Member

Dashboard for Postgresql added in #13187, closing this one.

@jsoriano jsoriano closed this Aug 23, 2019
@jsoriano jsoriano removed needs_backport PR is waiting to be backported to other branches. review labels Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Dashboards Metricbeat Metricbeat module Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants