-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Conversation
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 You also need to run |
There was a problem hiding this 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.
@dov0211 Any updates on this one? |
@ruflin will look at this one this week |
f6876cd
to
6f7e6c0
Compare
@jsoriano Could you check the above to see if this can be merged. Would be great to have a postgres dashboard. |
@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 "-"... |
@dov0211 Can we reactive this PR? Would be still great to get this dashboard in. |
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) { |
There was a problem hiding this comment.
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
metricbeat/module/redis/key/key.go
Outdated
} | ||
|
||
// KeyPattern contains the information required to query keys | ||
type KeyPattern struct { |
There was a problem hiding this comment.
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
metricbeat/module/redis/key/key.go
Outdated
} | ||
|
||
// KeyPattern contains the information required to query keys | ||
type KeyPattern struct { |
There was a problem hiding this comment.
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
packetbeat/procs/procs.go
Outdated
// 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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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{} |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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{} |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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{} |
There was a problem hiding this comment.
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
There was a problem hiding this 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", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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": "" | ||
}, |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"title": "[Metricbeat Postgresql] overview", | |
"title": "[Metricbeat Postgresql] Overview", |
} | ||
} | ||
}, | ||
"title": "[Postgresql] Number of deadlock over time", |
There was a problem hiding this comment.
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
"title": "[Postgresql] Number of deadlock over time", | |
"title": "Number of deadlock over time [Metricbeat Postgresql]", |
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:
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. |
@dov0211 issue with 7.0 should be fixed now, could you try to update this branch with master? |
Dashboard for Postgresql added in #13187, closing this one. |
Postgres dashboard added in metricbeat