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

[Metricbeat] Add performance metricset to Oracle module #12547

Merged
merged 16 commits into from
Aug 23, 2019

Conversation

sayden
Copy link
Contributor

@sayden sayden commented Jun 14, 2019

In the performance Metricset of Oracle module a list of key performance metrics for Oracle must be included.

Cursor and cache data are included in this first PR.

@sayden sayden added enhancement in progress Pull request is currently in progress. Metricbeat Metricbeat Team:Integrations Label for the Integrations team labels Jun 14, 2019
@sayden sayden self-assigned this Jun 14, 2019
return port
}

// GetOracleEnvUsername returns the port of the Oracle server or the value of the environment variable ORACLE_PASSWORD if not empty

Choose a reason for hiding this comment

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

comment on exported function GetOracleEnvPassword should be of the form "GetOracleEnvPassword ..."

@sayden
Copy link
Contributor Author

sayden commented Jul 8, 2019

@odbaeu pinging you in case you want to contribute with something or add some comments 😉

@sayden sayden force-pushed the feature/xp/mb/oracle/performance branch 2 times, most recently from d90fa1c to d1ee956 Compare July 8, 2019 11:10
return s.Valid
}

func (s *StringValue) Value() interface{} {

Choose a reason for hiding this comment

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

exported method StringValue.Value should have comment or be unexported

return i.Int64
}

type StringValue struct {

Choose a reason for hiding this comment

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

exported type StringValue should have comment or be unexported

return i.Valid
}

func (i *Int64Value) Value() interface{} {

Choose a reason for hiding this comment

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

exported method Int64Value.Value should have comment or be unexported

return i.Float64
}

type Int64Value struct {

Choose a reason for hiding this comment

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

exported type Int64Value should have comment or be unexported

return i.Valid
}

func (i *Float64Value) Value() interface{} {

Choose a reason for hiding this comment

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

exported method Float64Value.Value should have comment or be unexported


type SqlValueWrapper struct {
Field string
SqlValue SqlValue

Choose a reason for hiding this comment

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

struct field SqlValue should be SQLValue

}
}

type SqlValueWrapper struct {

Choose a reason for hiding this comment

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

exported type SqlValueWrapper should have comment or be unexported
type SqlValueWrapper should be SQLValueWrapper

return
}

func NewSqlWrapper(fieldName string, value SqlValue) *SqlValueWrapper {

Choose a reason for hiding this comment

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

exported function NewSqlWrapper should have comment or be unexported
func NewSqlWrapper should be NewSQLWrapper

)

// checkNullString avoid setting an invalid empty string value on Metricbeat event
func CheckNullSqlValue(logger *logp.Logger, output map[string]common.MapStr, parentTargetFieldName, targetFieldName string, v SqlValue) {

Choose a reason for hiding this comment

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

func CheckNullSqlValue should be CheckNullSQLValue

"github.com/elastic/beats/libbeat/logp"
)

// checkNullString avoid setting an invalid empty string value on Metricbeat event

Choose a reason for hiding this comment

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

comment on exported function CheckNullSqlValue should be of the form "CheckNullSqlValue ..."

@odbaeu
Copy link

odbaeu commented Jul 10, 2019

Hey @sayden,

thank you for pinging me! I very much appreciate that you continue to develop the oracle mb.

For me as an experienced Oracle DBA, it's more important to focus monitoring things which cause an outage that performance. But I know that performance monitoring sells much better than availability monitoring :-).

When monitoring performance in Oracle we have to be very careful to not query views which belong to the Enterprise Edition Option "Diagnostic" or "Tuning". For example: All view starting with DBA_HIST*, DBA_ADVISOR*, v$active_session_history
If we use these views, we should warn the users that they need an Oracle license. But I don't think wee need these views for now.

I was thinking about the metrics above... here are some thoughts:

  • Cache hit ratios
    In the past (5+ years ago) the cache hit ratio was an important value for me but this changed. Today I prefer to look at the view v$db_cache_advice. The reason is that some databases will never reach a good hit ratio. With the information from v$db_cache_advice I can tell, if adding memory would help or not (actually it's more tricky than just looking at the view because the view would very often tell "not more mem is needed" but that's actually wrong. It depends on HOW the view tells me the information :-) ). Maybe we can add v$db_cache_advice in a later release.
  • Wait times
    (y) Top 10 (foreground) wait events is the place I look at first when analysing the performance of a database.
  • Response times
    What do you mean by "response time"? Average response time of all SQLs? Or response time of select * from dual;? Hmm...
    I would prefer to monitor the following:
  • The top 10 SQLs of the following categories: CPU consumption, number of executions, elapsed time, I/O, memory consumption (optional)
  • Shared pool data
    Nice to have... Would be low priority for me...
  • PGA performance data
    I almost never look at PGA performance data. I must admit that I never took care of a database with a very large number (10k+) of active connections. Most DBs have a connection pool of 20-50 connections from an application server.
    Would be low priority for me...
  • I/O response time
    It's very interesting how the response time is distributed. Let's say: 40% of all I/O requests 1ms - 10ms response time, 60% of all I/O requests 11ms - 50ms. This gives much more intel on how good the I/O performance is then just the average.
  • For most of the foreground wait events it's very interesting to look at the wait time distribution as described in "I/O response time". Especially all wait events related to I/O, concurrency and redo management.
    For example "checkpoint not complete" can be very costly if there is a large percentage above 1 second (or even more than a minute!).

It's quite late... I hope there are not too many grammar or spelling mistakes... If you find one, you can keep it ;-).

@sayden sayden force-pushed the feature/xp/mb/oracle/performance branch from ff24d8d to 9fcc315 Compare August 21, 2019 12:39
@sayden sayden added review and removed in progress Pull request is currently in progress. labels Aug 21, 2019
@sayden sayden marked this pull request as ready for review August 21, 2019 12:41
@sayden sayden requested a review from a team as a code owner August 21, 2019 12:41
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.

This is looking pretty good, you did a good job looking for the queries and adapting the results.

I think it'd be good to add some additional explanations on the queries, to help understand what they do, and on the docs to explain the events that are being generated by the metricset.

x-pack/metricbeat/module/oracle/performance/extractor.go Outdated Show resolved Hide resolved
x-pack/metricbeat/module/oracle/performance/cursors.go Outdated Show resolved Hide resolved
x-pack/metricbeat/module/oracle/performance/library.go Outdated Show resolved Hide resolved
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 for addressing the comments, thanks to having the example data files I have found a possible problem with mapping conflicts. This would be the only important pending thing.

It would be also nice to automate the collection of data files as suggested, but this can be left for a future change.

hitRatio sql.NullFloat64
}

/*
Copy link
Member

Choose a reason for hiding this comment

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

Nit. Not important because they are not exported method, but it'd be nice to follow godocs and start with something like this:

Suggested change
/*
/*
* bufferCacheHitRatio collects information about the cache hit ratio of an Oracle database server

x-pack/metricbeat/module/oracle/performance/cursors.go Outdated Show resolved Hide resolved
@sayden
Copy link
Contributor Author

sayden commented Aug 23, 2019

Error is unrelated. Merging

@sayden sayden merged commit dbced15 into elastic:master Aug 23, 2019
@sorantis
Copy link
Contributor

Partially addresses #1935

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Metricbeat Metricbeat review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants